Commit d193aa1e authored by Mohcine Chraibi's avatar Mohcine Chraibi

Make changes to merge voronoi into develop

there are some nasty fixes for peds coming
from a queue who do not have any navline.
This means their v0 can not be calculated, which is
especially bad for 3D geometries (ramps)
parent 1f2e2c84
......@@ -73,7 +73,8 @@ EventManager::EventManager(Building *_b, unsigned int seed)
_file = fopen("../events/events.txt", "r");
if (!_file) {
Log->Write("INFO:\tFiles 'events.txt' missing.");
Log->Write("INFO:\tFiles 'events.txt' missing. "
"Realtime interaction with the simulation not possible.");
} else {
Log->Write("INFO:\tFile 'events.txt' will be monitored for new events.");
_dynamic = true;
......@@ -163,7 +164,9 @@ bool EventManager::ReadEventsXml()
Log->Write("INFO: \tEvents were initialized");
//create some events
//FIXME: creating some engine before starting is not working.
// seom doors are still perceived as beeing closed.
return true;
......@@ -708,10 +711,15 @@ void EventManager::CreateSomeEngines()
Log->Write("INFO: \tpopulating routers");
std::map<int, bool> doors_states;
for(auto&& t:_building->GetAllTransitions())
printf("ID: %d IsOpen: %d\n",t.second->GetID(),t.second->IsOpen());
//save the doors states
for(auto&& t:_building->GetAllTransitions())
doors_states[t.second->GetID()]= t.second->IsOpen();
//open all doors
......@@ -747,5 +755,12 @@ void EventManager::CreateSomeEngines()
Log->Write("INFO: \tdone");
for(auto&& t:_building->GetAllTransitions())
printf("ID: %d IsOpen: %d\n",t.second->GetID(),t.second->IsOpen());
This diff is collapsed.
......@@ -523,6 +523,11 @@ double Pedestrian::GetV0Norm() const
//detect the walking direction based on the elevation
SubRoom* sub=_building->GetRoom(_roomID)->GetSubRoom(_subRoomID);
double ped_elevation = sub->GetElevation(_ellipse.GetCenter());
if (_navLine ==nullptr)
printf("Error: ped %d has no navline\n", _id);
const Point& target = _navLine->GetCentre();
double nav_elevation = sub->GetElevation(target);
double delta = nav_elevation - ped_elevation;
This diff is collapsed.
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