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