diff --git a/general/Configuration.h b/general/Configuration.h index b523647b9addd4b0786c8e962bebae37aa1f7482..a732ac88042ad9254072d38e1638642d8087f6d1 100644 --- a/general/Configuration.h +++ b/general/Configuration.h @@ -105,7 +105,7 @@ public: _slow_down_distance = 0.2; //ff router quickest - _recalc_interval = 5; + _recalc_interval = 3; //ff router _has_specific_goals = false; diff --git a/routing/ff_router/ffRouter.cpp b/routing/ff_router/ffRouter.cpp index d2d2c1dac4b08ee9928ce28464dabc4318ed3cb6..64cd6b1ce74415ea082c92da8f838f2ba8a46b65 100644 --- a/routing/ff_router/ffRouter.cpp +++ b/routing/ff_router/ffRouter.cpp @@ -426,6 +426,14 @@ int FFRouter::FindExit(Pedestrian* p) // } // } if (_mode == quickest) { + if (p->GetGlobalTime() > _recalc_interval && _building->GetRoom(p->GetRoomID())->GetSubRoom(p->GetSubRoomID())->IsInSubRoom(p) + && _locffviafm[p->GetRoomID()]->getCostToDestination(p->GetExitIndex(), p->GetPos()) > 3.0 + && p->GetExitIndex() != -1) { + //delay possible + if ((int) p->GetGlobalTime() % 10 != p->GetID() % 10) { + return p->GetExitIndex(); //stay with old target + } + } //new version: recalc densityspeed every x seconds if ((p->GetGlobalTime() > _timeToRecalc) && (p->GetGlobalTime() > Pedestrian::GetMinPremovementTime() + _recalc_interval)) { _plzReInit = true;