Skip to content

Commit

Permalink
[JuPedSim] A pedestrian's speed is possibly adjusted from its lane's …
Browse files Browse the repository at this point in the history
…speed.
  • Loading branch information
bcoueraud87 authored and behrisch committed Jan 29, 2024
1 parent 1f67698 commit d24eae2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
UNUSED_PARAMETER(result);
assert(result == false); // The person has not arrived yet.
stage->activateEntryReminders(person);
JPS_CollisionFreeSpeedModelState modelState = JPS_Agent_GetCollisionFreeSpeedModelState(agent, nullptr);
const double newMaxSpeed = MIN2(candidateLane->getSpeedLimit(), person->getMaxSpeed());
if (newMaxSpeed != JPS_CollisionFreeSpeedModelState_GetV0(modelState)) {
JPS_CollisionFreeSpeedModelState_SetV0(modelState, newMaxSpeed);
}
}

if (newPosition.distanceTo2D(state->getNextWaypoint()) < 2 * myExitTolerance) {
Expand Down

0 comments on commit d24eae2

Please sign in to comment.