SUMO - Simulation of Urban MObility
MSPerson.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // The class for modelling person-movements
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
38 #include <utils/common/ToString.h>
40 #include <utils/geom/GeomHelper.h>
41 #include <microsim/MSNet.h>
42 #include <microsim/MSEdge.h>
43 #include <microsim/MSLane.h>
44 #include "MSPerson.h"
47 #include <microsim/MSVehicle.h>
48 #include "MSPModel.h"
49 
50 #ifdef CHECK_MEMORY_LEAKS
51 #include <foreign/nvwa/debug_new.h>
52 #endif // CHECK_MEMORY_LEAKS
53 
54 // ===========================================================================
55 // method definitions
56 // ===========================================================================
57 /* -------------------------------------------------------------------------
58  * MSPerson::MSPersonStage_Walking - methods
59  * ----------------------------------------------------------------------- */
61  MSStoppingPlace* toStop,
62  SUMOTime walkingTime, SUMOReal speed,
63  SUMOReal departPos, SUMOReal arrivalPos) :
64  MSTransportable::Stage(*route.back(), toStop, SUMOVehicleParameter::interpretEdgePos(
65  arrivalPos, route.back()->getLength(), SUMO_ATTR_ARRIVALPOS, "person walking to " + route.back()->getID()), MOVING_WITHOUT_VEHICLE), myWalkingTime(walkingTime), myRoute(route),
66  myCurrentInternalEdge(0),
67  myDepartPos(departPos),
68  mySpeed(speed),
69  myPedestrianState(0) {
71  myDepartPos, myRoute.front()->getLength(), SUMO_ATTR_DEPARTPOS, "person walking from " + myRoute.front()->getID());
72  if (walkingTime > 0) {
74  }
75 }
76 
77 
79 }
80 
81 
82 const MSEdge*
84  if (myCurrentInternalEdge != 0) {
85  return myCurrentInternalEdge;
86  } else {
87  return *myRouteStep;
88  }
89 }
90 
91 
92 const MSEdge*
94  return myRoute.front();
95 }
96 
97 
100  return myPedestrianState->getEdgePos(*this, now);
101 }
102 
103 
104 Position
106  return myPedestrianState->getPosition(*this, now);
107 }
108 
109 
110 SUMOReal
112  return myPedestrianState->getAngle(*this, now);
113 }
114 
115 
116 SUMOTime
118  return myPedestrianState->getWaitingTime(*this, now);
119 }
120 
121 
122 SUMOReal
124  return myPedestrianState->getSpeed(*this);
125 }
126 
127 
128 void
130  previous->getEdge()->removePerson(person);
131  myRouteStep = myRoute.begin();
132  if (myWalkingTime == 0) {
133  if (!person->proceed(net, now)) {
135  }
136  return;
137  }
139  if (previous->getEdgePos(now) >= 0) {
140  myDepartPos = previous->getEdgePos(now);
141  if (myWalkingTime > 0) {
143  }
144  }
145  myPedestrianState = MSPModel::getModel()->add(dynamic_cast<MSPerson*>(person), this, now);
146  (*myRouteStep)->addPerson(person);
147 }
148 
149 
150 SUMOReal
152  SUMOReal length = 0;
153  for (ConstMSEdgeVector::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) {
154  length += (*i)->getLength();
155  }
156  length -= myDepartPos;
157  length -= myRoute.back()->getLength() - myArrivalPos;
158  return length / STEPS2TIME(myWalkingTime + 1); // avoid systematic rounding errors
159 }
160 
161 
162 void
164  os.openTag("walk").writeAttr("arrival", time2string(myArrived)).closeTag();
165 }
166 
167 
168 void
171  if (myWalkingTime > 0) {
173  } else if (mySpeed > 0) {
175  }
176  os.closeTag();
177 }
178 
179 
180 void
182  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure")
183  .writeAttr("agent", p.getID()).writeAttr("link", myRoute.front()->getID()).closeTag();
184 }
185 
186 
187 void
189  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival")
190  .writeAttr("agent", p.getID()).writeAttr("link", myRoute.back()->getID()).closeTag();
191 }
192 
193 
194 bool
196  ((MSEdge*)getEdge())->removePerson(person);
197  //std::cout << SIMTIME << " moveToNextEdge person=" << person->getID() << "\n";
198  if (myRouteStep == myRoute.end() - 1) {
200  if (myDestinationStop != 0) {
202  }
203  if (!person->proceed(MSNet::getInstance(), currentTime)) {
205  }
206  //std::cout << " end walk. myRouteStep=" << (*myRouteStep)->getID() << "\n";
207  return true;
208  } else {
209  if (nextInternal == 0) {
210  ++myRouteStep;
212  } else {
213  myCurrentInternalEdge = nextInternal;
214  }
215  ((MSEdge*) getEdge())->addPerson(person);
216  return false;
217  }
218 }
219 
220 
221 
222 /* -------------------------------------------------------------------------
223  * MSPerson::MSPersonStage_Driving - methods
224  * ----------------------------------------------------------------------- */
226  MSStoppingPlace* toStop, const SUMOReal arrivalPos, const std::vector<std::string>& lines)
227  : MSTransportable::Stage(destination, toStop, arrivalPos, DRIVING), myLines(lines.begin(), lines.end()),
228  myVehicle(0) {}
229 
230 
232 
233 
234 const MSEdge*
236  if (myVehicle != 0) {
237  return myVehicle->getEdge();
238  }
239  return myWaitingEdge;
240 }
241 
242 
243 const MSEdge*
245  return myWaitingEdge;
246 }
247 
248 
249 SUMOReal
251  if (isWaiting4Vehicle()) {
252  return myWaitingPos;
253  }
254  // vehicle may already have passed the lane (check whether this is correct)
256 }
257 
258 
259 Position
261  if (isWaiting4Vehicle()) {
263  return myStopWaitPos;
264  }
266  }
267  return myVehicle->getPosition();
268 }
269 
270 
271 SUMOReal
273  if (!isWaiting4Vehicle()) {
274  MSVehicle* veh = dynamic_cast<MSVehicle*>(myVehicle);
275  if (veh != 0) {
276  return veh->getAngle();
277  } else {
278  return 0;
279  }
280  }
282 }
283 
284 
285 
286 void
288  if (previous->getDestinationStop() != 0) {
289  // the arrival stop may have an access point
290  myWaitingEdge = &previous->getDestinationStop()->getLane().getEdge();
292  } else {
293  myWaitingEdge = previous->getEdge();
295  }
296  myWaitingPos = previous->getEdgePos(now);
297  myWaitingSince = now;
298  SUMOVehicle* availableVehicle = net->getVehicleControl().getWaitingVehicle(myWaitingEdge, myLines, myWaitingPos, person->getID());
299  if (availableVehicle != 0 && availableVehicle->getParameter().departProcedure == DEPART_TRIGGERED) {
300  myVehicle = availableVehicle;
301  myWaitingEdge->removePerson(person);
302  myVehicle->addPerson(person);
306  } else {
307  net->getPersonControl().addWaiting(myWaitingEdge, person);
308  myWaitingEdge->addPerson(person);
309  }
310 }
311 
312 
313 bool
314 MSPerson::MSPersonStage_Driving::isWaitingFor(const std::string& line) const {
315  return myLines.count(line) > 0;
316 }
317 
318 
319 bool
321  return myVehicle == 0;
322 }
323 
324 
325 SUMOTime
327  return isWaiting4Vehicle() ? now - myWaitingSince : 0;
328 }
329 
330 
331 SUMOReal
333  return isWaiting4Vehicle() ? 0 : myVehicle->getSpeed();
334 }
335 
336 
337 std::string
339  return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "driving";
340 }
341 
342 
343 void
345  os.openTag("ride").writeAttr("depart", time2string(myDeparted)).writeAttr("arrival", time2string(myArrived)).closeTag();
346 }
347 
348 
349 void
353 }
354 
355 
356 void
358  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
359 }
360 
361 
362 void
364  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
365 }
366 
367 
368 
369 /* -------------------------------------------------------------------------
370  * MSPerson::MSPersonStage_Waiting - methods
371  * ----------------------------------------------------------------------- */
373  SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) :
374  MSTransportable::Stage(destination, 0, SUMOVehicleParameter::interpretEdgePos(
375  pos, destination.getLength(), SUMO_ATTR_DEPARTPOS, "person stopping at " + destination.getID()), WAITING),
376  myWaitingDuration(duration),
377  myWaitingUntil(until),
378  myActType(actType) {
379 }
380 
381 
383 
384 
385 const MSEdge*
387  return &myDestination;
388 }
389 
390 
391 const MSEdge*
393  return &myDestination;
394 }
395 
396 
397 SUMOReal
399  return myArrivalPos;
400 }
401 
402 
403 SUMOTime
405  return myWaitingUntil;
406 }
407 
408 
409 Position
412 }
413 
414 
415 SUMOReal
418 }
419 
420 
421 void
423  previous->getEdge()->addPerson(person);
424  myWaitingStart = now;
425  const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil);
426  net->getPersonControl().setWaitEnd(until, person);
427 }
428 
429 
430 void
432  os.openTag("stop").writeAttr("arrival", time2string(myArrived)).closeTag();
433 }
434 
435 
436 void
439  if (myWaitingDuration >= 0) {
441  }
442  if (myWaitingUntil >= 0) {
444  }
445  os.closeTag();
446 }
447 
448 
449 void
451  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType)
452  .writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
453 }
454 
455 
456 void
458  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", p.getID())
459  .writeAttr("link", getEdge()->getID()).closeTag();
460 }
461 
462 
463 SUMOTime
465  return now - myWaitingStart;
466 }
467 
468 
469 SUMOReal
471  return 0;
472 }
473 
474 
475 
476 
477 /* -------------------------------------------------------------------------
478  * MSPerson - methods
479  * ----------------------------------------------------------------------- */
481  : MSTransportable(pars, vtype, plan) {
482 }
483 
484 
486 }
487 
488 
489 bool
491  MSTransportable::Stage* prior = *myStep;
492  prior->setArrived(time);
493  /*
494  if(myWriteEvents) {
495  (*myStep)->endEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output"));
496  }
497  */
498  myStep++;
499  if (myStep != myPlan->end()) {
500  (*myStep)->proceed(net, this, time, prior);
501  /*
502  if(myWriteEvents) {
503  (*myStep)->beginEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output"));
504  }
505  */
506  return true;
507  } else {
508  prior->getEdge()->removePerson(this);
509  return false;
510  }
511 }
512 
513 
514 void
516  MSTransportable::MSTransportablePlan::const_iterator i = myPlan->begin();
517  if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast<MSPersonStage_Waiting*>(*i)->getUntil()) {
518  ++i;
519  }
520  for (; i != myPlan->end(); ++i) {
521  (*i)->routeOutput(os);
522  }
523 }
524 
525 const std::string&
527 // if (getCurrentStageType() == MOVING_WITHOUT_VEHICLE) {
528 // MSPersonStage_Walking* walkingStage = dynamic_cast<MSPersonStage_Walking*>(*myStep);
529 // assert(walkingStage != 0);
530 // const MSEdge* nextEdge = walkingStage->getPedestrianState()->getNextEdge(*walkingStage);
531 // if (nextEdge != 0) {
532 // return nextEdge->getID();
533 // }
534 // }
535 // return StringUtils::emptyString;
536  const MSEdge* nextEdge = getNextEdgePtr();
537  if (nextEdge != 0) {
538  return nextEdge->getID();
539  }
541 }
542 
543 const MSEdge*
546  MSPersonStage_Walking* walkingStage = dynamic_cast<MSPersonStage_Walking*>(*myStep);
547  assert(walkingStage != 0);
548  return walkingStage->getPedestrianState()->getNextEdge(*walkingStage);
549 
550  }
551  return 0;
552 }
553 /****************************************************************************/
554 
The departure is person triggered.
virtual const MSEdge * getNextEdge(const MSPerson::MSPersonStage_Walking &stage) const =0
return the list of internal edges if the pedestrian is on an intersection
SUMOTime getUntil() const
Definition: MSPerson.cpp:404
SUMOReal getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSPerson.cpp:416
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
void setArrived(SUMOTime now)
logs end of the step
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:467
const MSEdge * myWaitingEdge
Definition: MSPerson.h:299
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
long long int SUMOTime
Definition: SUMOTime.h:43
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:244
virtual ~MSPerson()
destructor
Definition: MSPerson.cpp:485
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSPerson.cpp:464
virtual void erase(MSTransportable *person)
removes a single person
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:450
SUMOReal getSpeed() const
the speed of the transportable
Definition: MSPerson.cpp:470
A lane area vehicles can halt at.
virtual SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the time the person spent standing
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSPerson.cpp:287
#define M_PI
Definition: angles.h:37
MSEdge * myCurrentInternalEdge
The current internal edge this person is on or 0.
Definition: MSPerson.h:183
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:235
virtual const MSEdge * getEdge() const =0
Returns the current edge.
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle&#39;s position along the lane.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
virtual SUMOReal getEdgePos(SUMOTime now) const =0
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
Definition: MSPerson.h:298
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSPerson.cpp:105
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:431
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:59
const std::set< std::string > myLines
the lines to choose from
Definition: MSPerson.h:291
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Definition: MSPerson.cpp:320
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:250
SUMOTime myWaitingUntil
the time until the person is waiting
Definition: MSPerson.h:376
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
const MSEdge * getNextEdgePtr() const
returns the next edge ptr if this person is walking and the pedestrian model allows it ...
Definition: MSPerson.cpp:544
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:169
const std::string & getID() const
returns the id of the transportable
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines, const SUMOReal position, const std::string ridingID)
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles to a given edge.
void setWalking(MSTransportable *p)
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
virtual bool proceed(MSNet *net, SUMOTime time)=0
MSTransportablePlan::iterator myStep
the iterator over the route
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:181
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:344
T MAX3(T a, T b, T c)
Definition: StdDefs.h:89
SUMOReal getEdgeAngle(const MSEdge *e, SUMOReal at) const
get angle of the edge at a certain position
The simulated network and simulation perfomer.
Definition: MSNet.h:94
The car-following model and parameter.
Definition: MSVehicleType.h:74
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:99
void addTransportable(MSTransportable *p)
adds a transportable to this stop
void setWaitEnd(SUMOTime time, MSTransportable *person)
sets the arrival time for a waiting or walking person
virtual Position getPosition(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the network coordinate of the person
SUMOTime getDesiredDepart() const
Returns the desired departure time.
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:83
virtual PedestrianState * add(MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)=0
register the given person as a pedestrian
static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
const MSEdge & getDestination() const
returns the destination edge
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSPerson.cpp:129
ConstMSEdgeVector myRoute
The route of the person.
Definition: MSPerson.h:177
const std::string & getID() const
Returns the id.
Definition: Named.h:65
A road/street connecting two junctions.
Definition: MSEdge.h:80
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:515
virtual SUMOReal getAngle(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the direction in which the person faces in degrees
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:562
Position getEdgePosition(const MSEdge *e, SUMOReal at, SUMOReal offset) const
get position on edge e at length at with orthogonal offset
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:589
const MSLane & getLane() const
Returns the lane this stop is located at.
SUMOTime myArrived
the time at which this stage ended
bool moveToNextEdge(MSPerson *person, SUMOTime currentTime, MSEdge *nextInternal=0)
move forward and return whether the person arrived
Definition: MSPerson.cpp:195
the edges of a route
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:398
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:159
SUMOTime myDeparted
the time at which this stage started
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:585
Representation of a vehicle.
Definition: SUMOVehicle.h:65
MSStoppingPlace *const myDestinationStop
the stop to reach by getting transported (if any)
static MSPModel * getModel()
Definition: MSPModel.cpp:63
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
SUMOReal getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSPerson.cpp:272
SUMOReal getSpeed() const
the speed of the transportable
Definition: MSPerson.cpp:332
SUMOReal computeAverageSpeed() const
Definition: MSPerson.cpp:151
StageType getCurrentStageType() const
the current stage type of the transportable
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:308
SUMOTime myWaitingDuration
the time the person is waiting
Definition: MSPerson.h:373
SUMOReal myArrivalPos
the position at which we want to arrive
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSPerson.cpp:410
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
T MIN2(T a, T b)
Definition: StdDefs.h:69
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:350
std::string myActType
The type of activity.
Definition: MSPerson.h:382
ConstMSEdgeVector::iterator myRouteStep
Definition: MSPerson.h:180
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:392
virtual void proceed(MSNet *net, MSTransportable *person, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSPerson.cpp:422
Position getWaitPosition() const
Returns the next free waiting place for pedestrians / containers.
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSPerson.cpp:117
bool isWaitingFor(const std::string &line) const
Whether the person waits for a vehicle of the line specified.
Definition: MSPerson.cpp:314
MSPersonStage_Waiting(const MSEdge &destination, SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string &actType)
constructor
Definition: MSPerson.cpp:372
void unregisterOneWaitingForPerson()
decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
void unsetWalking(MSTransportable *p)
static std::string emptyString
An empty string.
Definition: StringUtils.h:84
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:457
SUMOReal getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSPerson.cpp:111
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:188
void addWaiting(const MSEdge *edge, MSTransportable *person)
adds a person to the list of persons waiting for a vehicle on the specified edge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:386
static const SUMOReal SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk ...
Definition: MSPModel.h:81
MSPersonStage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, const std::vector< std::string > &lines)
constructor
Definition: MSPerson.cpp:225
virtual SUMOReal getSpeed() const =0
Returns the vehicle&#39;s current speed.
Structure representing possible vehicle parameter.
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:437
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:357
virtual MSPersonControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:690
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:349
SUMOTime myWaitingStart
the time the person is waiting
Definition: MSPerson.h:379
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle&#39;s parameter (including departure definition)
SUMOTime myWalkingTime
the time the person is walking
Definition: MSPerson.h:174
~MSPersonStage_Walking()
destructor
Definition: MSPerson.cpp:78
const std::string & getNextEdge() const
return the list of internal edges if this person is walking and the pedestrian model allows it ...
Definition: MSPerson.cpp:526
virtual Position getPosition(const SUMOReal offset=0) const =0
Return current position (x/y, cartesian)
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSPerson.cpp:260
std::string getStageDescription() const
return string representation of the current stage
Definition: MSPerson.cpp:338
PedestrianState * myPedestrianState
state that is to be manipulated by MSPModel
Definition: MSPerson.h:189
bool proceed(MSNet *net, SUMOTime time)
Definition: MSPerson.cpp:490
virtual void addPerson(MSTransportable *person)=0
Adds a person to this vehicle.
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
Definition: MSPerson.cpp:326
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:93
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:160
MSPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
constructor
Definition: MSPerson.cpp:480
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:363
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:213
MSTransportablePlan * myPlan
the plan of the transportable
MSPersonStage_Walking(const ConstMSEdgeVector &route, MSStoppingPlace *toStop, SUMOTime walkingTime, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos)
constructor
Definition: MSPerson.cpp:60
SUMOVehicle * myVehicle
The taken vehicle.
Definition: MSPerson.h:294
SUMOReal getSpeed() const
the speed of the transportable
Definition: MSPerson.cpp:123
const MSEdge & myDestination
the next edge to reach by getting transported
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
virtual SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking &stage) const =0
return the current speed of the person
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:163
virtual SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking &stage, SUMOTime now) const =0
return the offset from the start of the current edge measured in its natural direction ...
static const Position INVALID
Definition: Position.h:261
SUMOReal getAngle() const
Returns the vehicle&#39;s direction in degrees.
Definition: MSVehicle.h:452