Skip to content

Commit

Permalink
[JuPedSim] Minor style changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoueraud87 authored and behrisch committed Jan 29, 2024
1 parent 0d9f473 commit 47dd7d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
@@ -292,21 +292,21 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
}

// Updates the agent position.
auto agent = JPS_Simulation_GetAgent(myJPSSimulation, state->getAgentId(), nullptr);
const JPS_Agent agent = JPS_Simulation_GetAgent(myJPSSimulation, state->getAgentId(), nullptr);
state->setPreviousPosition(state->getPosition(*stage, DELTA_T));
const auto position = JPS_Agent_GetPosition(agent);
const JPS_Point position = JPS_Agent_GetPosition(agent);
state->setPosition(position.x, position.y);

// Updates the agent direction.
const auto orientation = JPS_Agent_GetOrientation(agent);
const JPS_Point orientation = JPS_Agent_GetOrientation(agent);
state->setAngle(atan2(orientation.y, orientation.x));

// Find on which edge the pedestrian is, using route's forward-looking edges because of how moveToXY is written.
Position newPosition(position.x, position.y);
ConstMSEdgeVector route = stage->getEdges();
const int routeIndex = (int)(stage->getRouteStep() - stage->getRoute().begin());
ConstMSEdgeVector forwardRoute = ConstMSEdgeVector(route.begin() + routeIndex, route.end());
double bestDistance = std::numeric_limits<double>::max();
const double bestDistance = std::numeric_limits<double>::max();
MSLane* candidateLane = nullptr;
double candidateLaneLongitudinalPosition = 0.0;
int routeOffset = 0;

0 comments on commit 47dd7d5

Please sign in to comment.