Maintenance at Wednesday, 30. June 2021, from 8:15 to 9:15
Some of the planned changes may require user action

Commit 4fd4b561 authored by qiancheng xu's avatar qiancheng xu
Browse files

Crossings in different rooms can have same ID

parent db7aaeb9
Pipeline #14348 failed with stages
in 15 minutes and 13 seconds
......@@ -300,7 +300,7 @@ void Simulation::UpdateRoutesAndLocations()
auto allRooms = _building->GetAllRooms();
#pragma omp parallel for shared(pedsToRemove, allRooms)
for (unsigned int p = 0; p < allPeds.size(); ++p) {
for (signed int p = 0; p < allPeds.size(); ++p) {
auto ped = allPeds[p];
Room* room = _building->GetRoom(ped->GetRoomID());
SubRoom* sub0 = room->GetSubRoom(ped->GetSubRoomID());
......
......@@ -784,15 +784,19 @@ Room* Building::GetRoom(string caption) const
bool Building::AddCrossing(Crossing* line)
{
if (_crossings.count(line->GetID())!=0) {
char tmp[CLENGTH];
sprintf(tmp,
"ERROR: Duplicate index for crossing found [%d] in Routing::AddCrossing()",
line->GetID());
Log->Write(tmp);
exit(EXIT_FAILURE);
}
_crossings[line->GetID()] = line;
int IDRoom = line->GetRoom1()->GetID();
int IDLine = line->GetID();
int IDCrossing = 1000 * IDRoom + IDLine;
if (_crossings.count(IDCrossing) != 0)
{
char tmp[CLENGTH];
sprintf(tmp,
"ERROR: Duplicate index for crossing found [%d] in Routing::AddCrossing()",
IDCrossing);
Log->Write(tmp);
exit(EXIT_FAILURE);
}
_crossings[IDCrossing] = line;
return true;
}
......
......@@ -120,7 +120,7 @@ bool GradientModel::Init (Building* building)
pedsToRemove.clear();
bool error_occurred = false;
#pragma omp parallel for
for(unsigned int p=0;p<allPeds.size();p++) {
for(signed int p=0;p<allPeds.size();p++) {
Pedestrian* ped = allPeds[p];
double cosPhi, sinPhi;
//a destination could not be found for that pedestrian
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment