Skip to content

Commit

Permalink
influencing speed in polygons #14325
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Feb 14, 2024
1 parent dc3dc54 commit a4d069b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,17 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
}
}
}
} else { // areaType == "influencer"
for (JPS_AgentId agentID = JPS_AgentIdIterator_Next(agentsInArea); agentID != 0; agentID = JPS_AgentIdIterator_Next(agentsInArea)) {
if (area.params.count("speed") > 0) {
const JPS_Agent agent = JPS_Simulation_GetAgent(myJPSSimulation, agentID, nullptr);
JPS_CollisionFreeSpeedModelState modelState = JPS_Agent_GetCollisionFreeSpeedModelState(agent, nullptr);
const double newMaxSpeed = StringUtils::toDouble(area.params.at("speed"));
if (newMaxSpeed != JPS_CollisionFreeSpeedModelState_GetV0(modelState)) {
JPS_CollisionFreeSpeedModelState_SetV0(modelState, newMaxSpeed);
}
}
}
}
JPS_AgentIdIterator_Free(agentsInArea);
}
Expand Down

0 comments on commit a4d069b

Please sign in to comment.