Eclipse SUMO - Simulation of Urban MObility
MSPModel_Remote.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2014-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The pedestrian following model for remote controlled pedestrian movement
16 /****************************************************************************/
17 
18 #include "MSPModel_Remote.h"
19 #include <grpc++/grpc++.h>
20 #include "microsim/MSEdge.h"
21 #include "microsim/MSLane.h"
22 #include "microsim/MSEdgeControl.h"
24 #include "microsim/MSGlobals.h"
25 #include "hybridsim.grpc.pb.h"
26 #include "utils/geom/Position.h"
28 
29 using grpc::Channel;
30 using grpc::ClientContext;
31 using grpc::Status;
32 
34  : myNet(net) {
35  const std::string address = oc.getString("pedestrian.remote.address");
36  myHybridsimStub = hybridsim::HybridSimulation::NewStub(grpc::CreateChannel(
37  address, grpc::InsecureChannelCredentials()));
38 
39  initialize();
40 
41  Event* e = new Event(this);
43 }
45 
47 
48  PState* state = new PState(person, stage);
49 
50  hybridsim::Agent req;
51  int id = myLastId++;
52  remoteIdPStateMapping[id] = state;
53  req.set_id(id);
54 
55  MSLane* departureLane = getFirstPedestrianLane(*(stage->getRoute().begin()));
56  double departureOffsetAlongLane = stage->getDepartPos();
57 
58  //TODO fix this on casim side [GL]
59  double offset = departureOffsetAlongLane == 0 ? 0.4 : -0.4;
60  departureOffsetAlongLane += offset;
61 
62  Position departurePos = departureLane->getShape().positionAtOffset(departureOffsetAlongLane);
63  hybridsim::Coordinate* departureCoordinate = req.mutable_enterlocation();
64  departureCoordinate->set_x(departurePos.x());
65  departureCoordinate->set_y(departurePos.y());
66 
67  MSLane* arrivalLane = getFirstPedestrianLane(*(stage->getRoute().end() - 1));
68  double arrivalOffsetAlongLange = stage->getArrivalPos();
69  Position arrivalPos = arrivalLane->getShape().positionAtOffset(arrivalOffsetAlongLange);
70  hybridsim::Coordinate* arrivalCoordinate = req.mutable_leavelocation();
71  arrivalCoordinate->set_x(arrivalPos.x());
72  arrivalCoordinate->set_y(arrivalPos.y());
73 
74 
75  const MSEdge* prv = 0;
76  for (ConstMSEdgeVector::const_iterator it = stage->getRoute().begin(); it != stage->getRoute().end(); it++) {
77  const MSEdge* edge = *it;
78  int dir = FORWARD;//default
79  if (prv == 0) {
80  if (stage->getRoute().size() > 1) {
81  const MSEdge* nxt = *(it + 1);
82  dir = (edge->getFromJunction() == nxt->getFromJunction()
83  || edge->getFromJunction() == nxt->getToJunction()) ? BACKWARD : FORWARD;
84  } else {
85  dir = stage->getDepartPos() == 0 ? FORWARD : BACKWARD;
86  }
87  } else {
88  dir = (edge->getFromJunction() == prv->getToJunction()
89  || edge->getFromJunction() == prv->getFromJunction()) ? FORWARD : BACKWARD;
90  }
91  if (edgesTransitionsMapping.find(edge) == edgesTransitionsMapping.end()) {
92  throw ProcessError("Cannot map edge : " + edge->getID() + " to remote simulation");
93  };
94  std::tuple<int, int> transitions = edgesTransitionsMapping[edge];
95 
96  int frId = dir == FORWARD ? std::get<0>(transitions) : std::get<1>(transitions);
97  int toId = dir == FORWARD ? std::get<1>(transitions) : std::get<0>(transitions);
98  hybridsim::Destination* destFr = req.add_dests();
99  destFr->set_id(frId);
100  hybridsim::Destination* destTo = req.add_dests();
101  destTo->set_id(toId);
102  prv = edge;
103  }
104 
105  hybridsim::Boolean rpl;
106  ClientContext context;
107  Status st = myHybridsimStub->transferAgent(&context, req, &rpl);
108  if (!st.ok()) {
109  throw ProcessError("Person: " + person->getID() + " could not be transferred to remote simulation");
110  }
111  if (!rpl.val()) {
112  //TODO not yet implemented
113  throw ProcessError("Remote simulation declined to accept person: " + person->getID() + ".");
114  }
115 
116  return state;
117 }
118 
120 
121  hybridsim::Empty req;
122  hybridsim::Empty rpl;
123  ClientContext context1;
124  Status st = myHybridsimStub->shutdown(&context1, req, &rpl);
125  if (!st.ok()) {
126  throw ProcessError("Could not shutdown remote server");
127  }
128 
129 
130 }
131 
133 
134  hybridsim::LeftClosedRightOpenTimeInterval interval;
135  interval.set_fromtimeincluding(time / DELTA_T);
136  interval.set_totimeexcluding((time + DELTA_T) / DELTA_T);
137 
138 
139  //1. simulate time interval
140  hybridsim::Empty rpl;
141  ClientContext context1;
142  Status st = myHybridsimStub->simulatedTimeInerval(&context1, interval, &rpl);
143  if (!st.ok()) {
144  throw ProcessError("Could not simulated time interval from: " + toString(time) + " to: " + toString(time + DELTA_T));
145  }
146 
147  //2. receive trajectories
148  hybridsim::Empty req2;
149  hybridsim::Trajectories trajectories;
150  ClientContext context2;
151  Status st2 = myHybridsimStub->receiveTrajectories(&context2, req2, &trajectories);
152  if (!st2.ok()) {
153  throw ProcessError("Could not receive trajectories from remote simulation");
154  }
155  for (hybridsim::Trajectory trajectory : trajectories.trajectories()) {
156  if (remoteIdPStateMapping.find(trajectory.id()) != remoteIdPStateMapping.end()) {
157  PState* pState = remoteIdPStateMapping[trajectory.id()];
158  pState->setPosition(trajectory.x(), trajectory.y());
159  pState->setPhi(trajectory.phi());
160  if (transitionsEdgesMapping.find(trajectory.currentdest().id()) != transitionsEdgesMapping.end()) {
161  const MSEdge* nextTargetEdge = transitionsEdgesMapping[trajectory.currentdest().id()];
162  const MSEdge* nextStageEdge = pState->getStage()->getNextRouteEdge();
163 // const MSEdge* currentStageEdge = pState->getStage()->getEdge();
164  if (nextTargetEdge == nextStageEdge) {
165  const bool arrived = pState->getStage()->moveToNextEdge(pState->getPerson(), time);
166  std::cout << "next edge" << std::endl;
167  }
168  }
169 // pState.
170  } else {
171  throw ProcessError("Pedestrian with id: " + toString(trajectory.id()) + " is not known.");
172  }
173  }
174 
175  //3. retrieve agents that are ready to come back home to SUMO
176  hybridsim::Empty req3;
177  hybridsim::Agents agents;
178  ClientContext context3;
179  Status st3 = myHybridsimStub->queryRetrievableAgents(&context3, req3, &agents);
180  if (!st3.ok()) {
181  throw ProcessError("Could not query retrievable agents");
182  }
183  //TODO check whether agents can be retrieved
184  for (hybridsim::Agent agent : agents.agents()) {
185  if (remoteIdPStateMapping.find(agent.id()) != remoteIdPStateMapping.end()) {
186  PState* pState = remoteIdPStateMapping[agent.id()];
187  while (!pState->getStage()->moveToNextEdge(pState->getPerson(), time)) {
188  remoteIdPStateMapping.erase(agent.id());
189  }
190  }
191  }
192 
193  //4. confirm transferred agents
194  hybridsim::Empty rpl2;
195  ClientContext context4;
196  Status st4 = myHybridsimStub->confirmRetrievedAgents(&context4, agents, &rpl2);
197  if (!st4.ok()) {
198  throw ProcessError("Could not confirm retrieved agents");
199  }
200 
201  return DELTA_T;
202 }
204  for (MSLane* lane : edge->getLanes()) {
205  if (lane->getPermissions() == SVC_PEDESTRIAN) {
206  return lane;
207  }
208  }
209  throw ProcessError("Edge: " + edge->getID() + " does not allow pedestrians.");
210 }
211 
213 
214 }
215 
218 }
219 
221  hybridsim::Scenario req;
222 
223  //1. for all edges
224  for (MSEdge* e : myNet->getEdgeControl().getEdges()) {
225  if (e->isInternal()) {
226  continue;
227  }
228  if (e->isWalkingArea()) {
229  handleWalkingArea(e, req);
230  continue;
231  }
232  for (MSLane* l : e->getLanes()) {
233  if (l->getPermissions() == SVC_PEDESTRIAN) {
234  handlePedestrianLane(l, req);
235  }
236  }
237  }
238 
239  //add boundary
240  hybridsim::Edge* edge = req.add_edges();
241  edge->mutable_c0()->set_x(myBoundary.xmin());
242  edge->mutable_c0()->set_y(myBoundary.ymin());
243  edge->mutable_c1()->set_x(myBoundary.xmax());
244  edge->mutable_c1()->set_y(myBoundary.ymin());
245  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
246 
247  edge = req.add_edges();
248  edge->mutable_c0()->set_x(myBoundary.xmax());
249  edge->mutable_c0()->set_y(myBoundary.ymin());
250  edge->mutable_c1()->set_x(myBoundary.xmax());
251  edge->mutable_c1()->set_y(myBoundary.ymax());
252  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
253 
254  edge = req.add_edges();
255  edge->mutable_c0()->set_x(myBoundary.xmax());
256  edge->mutable_c0()->set_y(myBoundary.ymax());
257  edge->mutable_c1()->set_x(myBoundary.xmin());
258  edge->mutable_c1()->set_y(myBoundary.ymax());
259  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
260 
261  edge = req.add_edges();
262  edge->mutable_c0()->set_x(myBoundary.xmin());
263  edge->mutable_c0()->set_y(myBoundary.ymax());
264  edge->mutable_c1()->set_x(myBoundary.xmin());
265  edge->mutable_c1()->set_y(myBoundary.ymin());
266  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
267 
268 
269  hybridsim::Empty rpl;
270  ClientContext context;
271  Status st = myHybridsimStub->initScenario(&context, req, &rpl);
272  if (!st.ok()) {
273  throw ProcessError("Remote side could not initialize scenario!");
274  }
275 
276 }
277 void MSPModel_Remote::handleWalkingArea(MSEdge* msEdge, hybridsim::Scenario& scenario) {
278  MSLane* l = *(msEdge->getLanes().begin());
279 
280  const PositionVector shape = l->getShape();
281  if (shape.size() < 2) {//should never happen
282  return;
283  }
284 
285  handleShape(shape, scenario);
286 
287 
288  //close walking area
289  Position frst = *shape.begin();
290  Position scnd = *(shape.end() - 1);
291  hybridsim::Edge* edge = scenario.add_edges();
292  edge->mutable_c0()->set_x(frst.x());
293  edge->mutable_c0()->set_y(frst.y());
294  edge->mutable_c1()->set_x(scnd.x());
295  edge->mutable_c1()->set_y(scnd.y());
296  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
297 
298 
299 }
300 void MSPModel_Remote::handlePedestrianLane(MSLane* l, hybridsim::Scenario& scenario) {
301  double width = l->getWidth();
302  PositionVector centerLine = PositionVector(l->getShape());
303  if (centerLine.size() < 2) {//should never happen
304  return;
305  }
306 
307 
308  int fromId = myLastTransitionId++;
309  int toId = myLastTransitionId++;
310  edgesTransitionsMapping[&(l->getEdge())] = std::make_tuple(fromId, toId);
311  transitionsEdgesMapping[fromId] = &(l->getEdge());
312  transitionsEdgesMapping[toId] = &(l->getEdge());
313 
314  hybridsim::Edge_Type edgeType;
315  if (l->getEdge().isCrossing()) {
316  edgeType = hybridsim::Edge_Type_TRANSITION_HOLDOVER;
317  } else if (l->getEdge().isWalkingArea()) {
318  edgeType = hybridsim::Edge_Type_TRANSITION_INTERNAL;
319  } else {
320  edgeType = hybridsim::Edge_Type_TRANSITION;
321  }
322 
323  //start and end
324  Position frst = *centerLine.begin();
325  Position scnd = *(centerLine.begin() + 1);
326  makeStartOrEndTransition(frst, scnd, width, scenario, edgeType, fromId);
327  Position thrd = *(centerLine.end() - 1);
328  Position frth = *(centerLine.end() - 2);
329  makeStartOrEndTransition(thrd, frth, width, scenario, edgeType, toId);
330 
331  centerLine.move2side(-width / 2.);
332  handleShape(centerLine, scenario);
333  centerLine.move2side(width);
334  handleShape(centerLine, scenario);
335 
336 }
337 void
338 MSPModel_Remote::makeStartOrEndTransition(Position frst, Position scnd, double width, hybridsim::Scenario& scenario,
339  hybridsim::Edge_Type type, int id) {
340 
341  double dx = scnd.x() - frst.x();
342  double dy = scnd.y() - frst.y();
343  double length = sqrt(dx * dx + dy * dy);
344  dx /= length;
345  dy /= length;
346  double x0 = frst.x() - dy * width / 2.;
347  double y0 = frst.y() + dx * width / 2.;
348  double x1 = frst.x() + dy * width / 2.;
349  double y1 = frst.y() - dx * width / 2.;
350  hybridsim::Edge* edge = scenario.add_edges();
351  edge->mutable_c0()->set_x(x0);
352  edge->mutable_c0()->set_y(y0);
353  edge->mutable_c1()->set_x(x1);
354  edge->mutable_c1()->set_y(y1);
355  edge->set_type(type);
356  edge->set_id(id);
357 
358 }
359 void MSPModel_Remote::handleShape(const PositionVector& shape, hybridsim::Scenario& scenario) {
360  PositionVector::const_iterator it = shape.begin();
361  Position frst = *it;
362 
363  myBoundary.add(frst.x(), frst.y());
364  it++;
365  for (; it != shape.end(); it++) {
366  hybridsim::Edge* edge = scenario.add_edges();
367  edge->mutable_c0()->set_x(frst.x());
368  edge->mutable_c0()->set_y(frst.y());
369  edge->mutable_c1()->set_x((*it).x());
370  edge->mutable_c1()->set_y((*it).y());
371  edge->set_type(hybridsim::Edge_Type_OBSTACLE);
372  frst = *it;
373  myBoundary.add(frst.x(), frst.y());
374  }
375 }
376 
377 
378 
379 // ===========================================================================
380 // MSPModel_Remote::PState method definitions
381 // ===========================================================================
383  : myPerson(person), myPhi(0), myPosition(0, 0), myStage(stage) {
384 
385 
386 }
388 
389 }
391  return 0;
392 }
394  return myPosition;
395 }
397  return myPhi;
398 }
400  return 0;
401 }
403  return 0;
404 }
406  return nullptr;
407 }
408 void MSPModel_Remote::PState::setPosition(double x, double y) {
409  myPosition.set(x, y);
410 }
412  myPhi = phi;
413 }
415  return myStage;
416 }
418  return myPerson;
419 }
420 
421 bool
424 }
425 
MSNet::hasInternalLinks
bool hasInternalLinks() const
return whether the network contains internal links
Definition: MSNet.h:642
SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:157
MSPModel_Remote::makeStartOrEndTransition
void makeStartOrEndTransition(Position position, Position scnd, double width, hybridsim::Scenario &scenario, hybridsim::Edge_Type type, int i)
Definition: MSPModel_Remote.cpp:338
MSPModel_Remote::PState::getPosition
Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const override
return the network coordinate of the person
Definition: MSPModel_Remote.cpp:393
MSEventControl::addEvent
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Definition: MSEventControl.cpp:53
MSPModel_Remote::myLastTransitionId
int myLastTransitionId
Definition: MSPModel_Remote.h:93
MSPModel::BACKWARD
static const int BACKWARD
Definition: MSPModel.h:104
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
Boundary::ymin
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:131
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
MSPModel_Remote::handlePedestrianLane
void handlePedestrianLane(MSLane *pLane, hybridsim::Scenario &scenario)
Definition: MSPModel_Remote.cpp:300
MSPModel_Remote::PState::setPhi
void setPhi(double phi)
Definition: MSPModel_Remote.cpp:411
MSPerson::MSPersonStage_Walking::getDepartPos
double getDepartPos() const
Definition: MSPerson.h:153
MSPModel_Remote::transitionsEdgesMapping
std::map< int, const MSEdge * > transitionsEdgesMapping
Definition: MSPModel_Remote.h:91
MSNet::getBeginOfTimestepEvents
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:430
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
MSPerson
Definition: MSPerson.h:64
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:202
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
Boundary::xmax
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:125
MSPModel_Remote::myNet
MSNet * myNet
Definition: MSPModel_Remote.h:79
MSPModel_Remote::PState::getWaitingTime
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const override
return the time the person spent standing
Definition: MSPModel_Remote.cpp:399
MSPModel_Remote::PState::getSpeed
double getSpeed(const MSPerson::MSPersonStage_Walking &stage) const override
return the current speed of the person
Definition: MSPModel_Remote.cpp:402
MSPModel_Remote::MSPModel_Remote
MSPModel_Remote(const OptionsCont &oc, MSNet *net)
Definition: MSPModel_Remote.cpp:33
MSPModel_Remote::Event
Definition: MSPModel_Remote.h:40
MSEdge.h
PositionVector
A list of positions.
Definition: PositionVector.h:46
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:658
MSPModel_Remote::add
PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now) override
register the given person as a pedestrian
Definition: MSPModel_Remote.cpp:44
PedestrianState
abstract base class for managing callbacks to retrieve various state information from the model
Definition: MSPModel.h:128
MSEdge::getFromJunction
const MSJunction * getFromJunction() const
Definition: MSEdge.h:357
MSPModel_Remote::cleanupHelper
void cleanupHelper() override
Definition: MSPModel_Remote.cpp:216
MSEdge::isCrossing
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:238
MSPModel_Remote::PState::getEdgePos
double getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const override
return the offset from the start of the current edge measured in its natural direction
Definition: MSPModel_Remote.cpp:390
Boundary::xmin
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:119
MSPModel_Remote::myLastId
int myLastId
Definition: MSPModel_Remote.h:92
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
MSPModel_Remote::~MSPModel_Remote
~MSPModel_Remote()
Definition: MSPModel_Remote.cpp:119
PositionVector::positionAtOffset
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:246
MSPModel_Remote::PState::setPosition
void setPosition(double x, double y)
Definition: MSPModel_Remote.cpp:408
ProcessError
Definition: UtilExceptions.h:40
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
MSGlobals.h
MSPModel_Remote::PState::getNextEdge
const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const override
return the list of internal edges if the pedestrian is on an intersection
Definition: MSPModel_Remote.cpp:405
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSEdge::getToJunction
const MSJunction * getToJunction() const
Definition: MSEdge.h:361
MSPModel_Remote::handleWalkingArea
void handleWalkingArea(MSEdge *msEdge, hybridsim::Scenario &scenario)
Definition: MSPModel_Remote.cpp:277
MSPerson::MSPersonStage_Walking::getArrivalPos
double getArrivalPos() const
Definition: MSPerson.h:161
MSPModel_Remote::execute
SUMOTime execute(SUMOTime time)
Definition: MSPModel_Remote.cpp:132
MSPModel_Remote::PState::getPerson
MSPerson * getPerson()
Definition: MSPModel_Remote.cpp:417
MSPModel_Remote::PState::getAngle
double getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const override
return the direction in which the person faces in degrees
Definition: MSPModel_Remote.cpp:396
MSGlobals::gUsingInternalLanes
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:69
MSLane::getEdge
MSEdge & getEdge() const
Returns the lane's edge.
Definition: MSLane.h:670
MSPModel_Remote::myHybridsimStub
std::unique_ptr< hybridsim::HybridSimulation::Stub > myHybridsimStub
Definition: MSPModel_Remote.h:80
MSEdge::isWalkingArea
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:252
MSEdgeControl.h
MSPModel_Remote::PState
Container for pedestrian state and individual position update function.
Definition: MSPModel_Remote.h:56
Position.h
MSPModel_Remote::myBoundary
Boundary myBoundary
Definition: MSPModel_Remote.h:81
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
MSPModel::FORWARD
static const int FORWARD
Definition: MSPModel.h:100
MSLane::getShape
const PositionVector & getShape() const
Returns this lane's shape.
Definition: MSLane.h:478
MSPModel_Remote::handleShape
void handleShape(const PositionVector &shape, hybridsim::Scenario &scenario)
Definition: MSPModel_Remote.cpp:359
MSPModel_Remote::remove
void remove(PedestrianState *state) override
remove the specified person from the pedestrian simulation
Definition: MSPModel_Remote.cpp:212
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
MSPModel_Remote.h
MSPerson::MSPersonStage_Walking::moveToNextEdge
bool moveToNextEdge(MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=nullptr)
move forward and return whether the person arrived
Definition: MSPerson.cpp:328
MSPerson::MSPersonStage_Walking::getRoute
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:175
MSPModel::cleanupHelper
virtual void cleanupHelper()
Definition: MSPModel.h:100
MSPModel_Remote::PState::getStage
MSPerson::MSPersonStage_Walking * getStage()
Definition: MSPModel_Remote.cpp:414
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:71
MSPModel_Remote::getFirstPedestrianLane
MSLane * getFirstPedestrianLane(const MSEdge *const &edge)
Definition: MSPModel_Remote.cpp:203
MSTransportable::getID
const std::string & getID() const
returns the id of the transportable
Definition: MSTransportable.cpp:694
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
MSPModel_Remote::PState::~PState
~PState() override
Definition: MSPModel_Remote.cpp:387
MSLane::getWidth
double getWidth() const
Returns the lane's width.
Definition: MSLane.h:557
MSPModel_Remote::remoteIdPStateMapping
std::map< int, PState * > remoteIdPStateMapping
Definition: MSPModel_Remote.h:89
MSPModel_Remote::usingInternalLanes
bool usingInternalLanes()
whether movements on intersections are modelled
Definition: MSPModel_Remote.cpp:422
MSTransportable::MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:64
MSEventControl.h
MSLane.h
MSNet::getEdgeControl
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:380
MSPModel_Remote::PState::PState
PState(MSPerson *person, MSPerson::MSPersonStage_Walking *stage)
Definition: MSPModel_Remote.cpp:382
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSPerson::MSPersonStage_Walking::getNextRouteEdge
const MSEdge * getNextRouteEdge() const
Definition: MSPerson.h:172
PositionVector.h
MSPModel_Remote::initialize
void initialize()
Definition: MSPModel_Remote.cpp:220
MSEdgeControl::getEdges
const MSEdgeVector & getEdges() const
Returns loaded edges.
Definition: MSEdgeControl.h:168
MSPModel_Remote::edgesTransitionsMapping
std::map< const MSEdge *, std::tuple< int, int > > edgesTransitionsMapping
Definition: MSPModel_Remote.h:90
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1086
Boundary::ymax
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:137