SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-sim.org/
13 // Copyright (C) 2001-2014 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>
39 #include "MSNet.h"
40 #include "MSEdge.h"
41 #include "MSLane.h"
42 #include "MSPerson.h"
43 #include "MSPersonControl.h"
44 #include "MSInsertionControl.h"
45 #include "MSVehicle.h"
46 
47 #ifdef CHECK_MEMORY_LEAKS
48 #include <foreign/nvwa/debug_new.h>
49 #endif // CHECK_MEMORY_LEAKS
50 
51 /* -------------------------------------------------------------------------
52  * static member definitions
53  * ----------------------------------------------------------------------- */
55 
56 // ===========================================================================
57 // method definitions
58 // ===========================================================================
59 /* -------------------------------------------------------------------------
60  * MSPerson::MSPersonStage - methods
61  * ----------------------------------------------------------------------- */
63  : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
64 
65 
67 
68 
69 const MSEdge&
71  return myDestination;
72 }
73 
74 
75 void
77  if (myDeparted < 0) {
78  myDeparted = now;
79  }
80 }
81 
82 
83 void
85  myArrived = now;
86 }
87 
88 
89 bool
90 MSPerson::MSPersonStage::isWaitingFor(const std::string& /*line*/) const {
91  return false;
92 }
93 
94 
97  // @todo: well, definitely not the nicest way... Should be precomputed
98  const MSLane* lane = e->getLanes()[0];
99  PositionVector shp = lane->getShape();
100  shp.move2side(offset);
102 }
103 
104 
105 SUMOReal
107  // @todo: well, definitely not the nicest way... Should be precomputed
108  PositionVector shp = e->getLanes()[0]->getShape();
109  return shp.rotationDegreeAtOffset(at);
110 }
111 
112 
113 
114 /* -------------------------------------------------------------------------
115  * MSPerson::MSPersonStage_Walking - methods
116  * ----------------------------------------------------------------------- */
117 MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(const std::vector<const MSEdge*>& route,
118  MSBusStop* toBS,
119  SUMOTime walkingTime, SUMOReal speed,
120  SUMOReal departPos, SUMOReal arrivalPos) :
121  MSPersonStage(*route.back(), WALKING), myWalkingTime(walkingTime), myRoute(route),
122  myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS),
123  mySpeed(speed) {
125  myDepartPos, myRoute.front()->getLength(), SUMO_ATTR_DEPARTPOS, "person walking from " + myRoute.front()->getID());
127  myArrivalPos, myRoute.back()->getLength(), SUMO_ATTR_ARRIVALPOS, "person walking to " + myRoute.back()->getID());
128  if (walkingTime > 0) {
129  SUMOReal length = 0;
130  for (std::vector<const MSEdge*>::const_iterator i = route.begin(); i != route.end(); ++i) {
131  length += (*i)->getLength();
132  }
133  length -= myDepartPos;
134  length -= route.back()->getLength() - myArrivalPos;
135  mySpeed = length / STEPS2TIME(walkingTime);
136  }
137 }
138 
139 
141 
142 
143 const MSEdge*
145  return *myRouteStep;
146 }
147 
148 
149 const MSEdge*
151  return myRoute.front();
152 }
153 
154 
155 SUMOReal
157  SUMOReal off = STEPS2TIME(now - myLastEntryTime);
158  return myCurrentBeginPos + myCurrentLength / myCurrentDuration * off;
159 }
160 
161 
162 Position
164  const MSEdge* e = getEdge();
165  SUMOReal off = STEPS2TIME(now - myLastEntryTime);
166  return getEdgePosition(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off, SIDEWALK_OFFSET);
167 }
168 
169 
170 SUMOReal
172  const MSEdge* e = getEdge();
173  SUMOReal off = STEPS2TIME(now - myLastEntryTime);
174  return getEdgeAngle(e, myCurrentBeginPos + myCurrentLength / myCurrentDuration * off) + 90;
175 }
176 
177 
178 void
180  MSEdge* previousEdge, const SUMOReal at) {
181  previousEdge->removePerson(person);
182  myRouteStep = myRoute.begin();
183  myLastEntryTime = now;
184  if (myWalkingTime == 0) {
185  if (!person->proceed(net, now)) {
187  };
188  return;
189  }
191  if (at >= 0) {
192  myDepartPos = at;
193  }
194  ((MSEdge*) *myRouteStep)->addPerson(person);
195  myRoute.size() == 1
196  ? computeWalkingTime(*myRouteStep, myDepartPos, myArrivalPos, myDestinationBusStop)
197  : computeWalkingTime(*myRouteStep, myDepartPos, -1, 0);
198  net->getBeginOfTimestepEvents().addEvent(new MoveToNextEdge(person, *this), now + TIME2STEPS(myCurrentDuration), MSEventControl::ADAPT_AFTER_EXECUTION);
199 }
200 
201 
202 void
204  if (bs != 0) {
205  toPos = bs->getEndLanePosition();
206  } else if (toPos < 0) {
207  toPos = e->getLanes()[0]->getLength();
208  }
209  if (fromPos < 0) {
210  fromPos = 0;
211  }
212  myCurrentBeginPos = fromPos;
213  myCurrentLength = toPos - fromPos;
214  assert(myCurrentLength >= 0);
215  myCurrentDuration = MAX2(myCurrentLength, (SUMOReal)1.0) / mySpeed;
216 }
217 
218 
219 void
221  os.openTag("walk").writeAttr("arrival", time2string(myArrived)).closeTag();
222 }
223 
224 
225 void
227  os.openTag("walk").writeAttr(SUMO_ATTR_EDGES, myRoute);
228  if (myWalkingTime > 0) {
229  os.writeAttr(SUMO_ATTR_DURATION, time2string(myWalkingTime));
230  } else if (mySpeed > 0) {
231  os.writeAttr(SUMO_ATTR_SPEED, mySpeed);
232  }
233  os.closeTag();
234 }
235 
236 
237 void
239  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure")
240  .writeAttr("agent", p.getID()).writeAttr("link", myRoute.front()->getID()).closeTag();
241 }
242 
243 
244 void
246  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival")
247  .writeAttr("agent", p.getID()).writeAttr("link", myRoute.back()->getID()).closeTag();
248 }
249 
250 
251 SUMOTime
253  ((MSEdge*) *myRouteStep)->removePerson(person);
254  if (myRouteStep == myRoute.end() - 1) {
256  if (myDestinationBusStop != 0) {
257  myDestinationBusStop->addPerson(person);
258  }
259  if (!person->proceed(MSNet::getInstance(), currentTime)) {
261  }
262  return 0;
263  } else {
264  ++myRouteStep;
265  myRouteStep == myRoute.end() - 1
266  ? computeWalkingTime(*myRouteStep, 0, myArrivalPos, myDestinationBusStop)
267  : computeWalkingTime(*myRouteStep, 0, -1, 0);
268  ((MSEdge*) *myRouteStep)->addPerson(person);
269  myLastEntryTime = currentTime;
270  return TIME2STEPS(myCurrentDuration);
271  }
272 }
273 
274 
275 
276 /* -------------------------------------------------------------------------
277  * MSPerson::MSPersonStage_Driving - methods
278  * ----------------------------------------------------------------------- */
280  MSBusStop* toBS, const std::vector<std::string>& lines)
281  : MSPersonStage(destination, DRIVING), myLines(lines.begin(), lines.end()),
282  myVehicle(0), myDestinationBusStop(toBS) {}
283 
284 
286 
287 
288 const MSEdge*
290  if (myVehicle != 0) {
291  return myVehicle->getEdge();
292  }
293  return myWaitingEdge;
294 }
295 
296 
297 const MSEdge*
299  return myWaitingEdge;
300 }
301 
302 
303 SUMOReal
305  if (myVehicle != 0) {
306  // vehicle may already have passed the lane (check whether this is correct)
307  return MIN2(myVehicle->getPositionOnLane(), getEdge()->getLength());
308  }
309  return myWaitingPos;
310 }
311 
312 
313 Position
315  if (myVehicle != 0) {
317  return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtOffset(myVehicle->getPositionOnLane());
318  }
319  return getEdgePosition(myWaitingEdge, myWaitingPos, SIDEWALK_OFFSET);
320 }
321 
322 
323 SUMOReal
325  if (myVehicle != 0) {
326  MSVehicle* veh = dynamic_cast<MSVehicle*>(myVehicle);
327  if (veh != 0) {
328  return veh->getAngle() + 90;
329  } else {
330  return 0;
331  }
332  }
333  return getEdgeAngle(myWaitingEdge, myWaitingPos);
334 }
335 
336 
337 
338 void
340  MSEdge* previousEdge, const SUMOReal at) {
341  myWaitingEdge = previousEdge;
342  myWaitingPos = at;
343  myWaitingSince = now;
344  myVehicle = net->getVehicleControl().getWaitingVehicle(previousEdge, myLines);
345  if (myVehicle != 0 && myVehicle->getParameter().departProcedure == DEPART_TRIGGERED) {
346  previousEdge->removePerson(person);
347  myVehicle->addPerson(person);
348  net->getInsertionControl().add(myVehicle);
349  net->getVehicleControl().removeWaiting(previousEdge, myVehicle);
351  } else {
352  net->getPersonControl().addWaiting(previousEdge, person);
353  previousEdge->addPerson(person);
354  }
355 }
356 
357 
358 bool
359 MSPerson::MSPersonStage_Driving::isWaitingFor(const std::string& line) const {
360  return myLines.count(line) > 0;
361 }
362 
363 
364 bool
366  return myVehicle == 0;
367 }
368 
369 
370 SUMOTime
372  return isWaiting4Vehicle() ? now - myWaitingSince : 0;
373 }
374 
375 
376 std::string
378  return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "driving";
379 }
380 
381 
382 void
384  os.openTag("ride").writeAttr("depart", time2string(myDeparted)).writeAttr("arrival", time2string(myArrived)).closeTag();
385 }
386 
387 
388 void
391  os.writeAttr(SUMO_ATTR_LINES, myLines).closeTag();
392 }
393 
394 
395 void
397  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
398 }
399 
400 
401 void
403  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
404 }
405 
406 
407 
408 /* -------------------------------------------------------------------------
409  * MSPerson::MSPersonStage_Waiting - methods
410  * ----------------------------------------------------------------------- */
412  SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) :
413  MSPersonStage(destination, WAITING),
414  myWaitingDuration(duration),
415  myWaitingUntil(until),
416  myActType(actType),
417  myStartPos(pos) {
420 }
421 
422 
424 
425 
426 const MSEdge*
428  return &myDestination;
429 }
430 
431 
432 const MSEdge*
434  return &myDestination;
435 }
436 
437 
438 SUMOReal
440  return myStartPos;
441 }
442 
443 
444 SUMOTime
446  return myWaitingUntil;
447 }
448 
449 
450 Position
452  return getEdgePosition(&myDestination, myStartPos, SIDEWALK_OFFSET);
453 }
454 
455 
456 SUMOReal
458  return getEdgeAngle(&myDestination, myStartPos) + 45;
459 }
460 
461 
462 void
464  MSEdge* previousEdge, const SUMOReal /* at */) {
465  previousEdge->addPerson(person);
466  const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil);
467  net->getPersonControl().setWaitEnd(until, person);
468 }
469 
470 
471 void
473  os.openTag("stop").writeAttr("arrival", time2string(myArrived)).closeTag();
474 }
475 
476 
477 void
480  if (myWaitingDuration >= 0) {
481  os.writeAttr(SUMO_ATTR_DURATION, time2string(myWaitingDuration));
482  }
483  if (myWaitingUntil >= 0) {
484  os.writeAttr(SUMO_ATTR_UNTIL, time2string(myWaitingUntil));
485  }
486  os.closeTag();
487 }
488 
489 
490 void
492  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType)
493  .writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
494 }
495 
496 
497 void
499  os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", p.getID())
500  .writeAttr("link", getEdge()->getID()).closeTag();
501 }
502 
503 
504 
505 /* -------------------------------------------------------------------------
506  * MSPerson - methods
507  * ----------------------------------------------------------------------- */
509  : myParameter(pars), myVType(vtype), myPlan(plan) {
510  myStep = myPlan->begin();
511 }
512 
513 
515  for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
516  delete *i;
517  }
518  delete myPlan;
519  delete myParameter;
520 }
521 
522 
523 const std::string&
525  return myParameter->id;
526 }
527 
528 
529 bool
531  MSEdge* arrivedAt = (MSEdge*)(*myStep)->getEdge();
532  SUMOReal atPos = (*myStep)->getEdgePos(time);
533  //MSPersonPlan::iterator prior = myStep;
534  (*myStep)->setArrived(time);
535  /*
536  if(myWriteEvents) {
537  (*myStep)->endEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output"));
538  }
539  */
540  Position pos = (*myStep)->getPosition(time);
541  myStep++;
542  if (myStep != myPlan->end()) {
543  (*myStep)->proceed(net, this, time, arrivedAt, atPos);
544  /*
545  if(myWriteEvents) {
546  (*myStep)->beginEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output"));
547  }
548  */
549  return true;
550  } else {
551  arrivedAt->removePerson(this);
552  return false;
553  }
554 }
555 
556 
557 SUMOTime
559  return myParameter->depart;
560 }
561 
562 
563 void
565  (*myStep)->setDeparted(now);
566 }
567 
568 
569 void
571  for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
572  (*i)->tripInfoOutput(os);
573  }
574 }
575 
576 
577 void
579  MSPersonPlan::const_iterator i = myPlan->begin();
580  if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast<MSPersonStage_Waiting*>(*i)->getUntil()) {
581  ++i;
582  }
583  for (; i != myPlan->end(); ++i) {
584  (*i)->routeOutput(os);
585  }
586 }
587 
588 
589 /****************************************************************************/
590 
The departure is person triggered.
SUMOTime getUntil() const
Definition: MSPerson.cpp:445
SUMOReal getAngle(SUMOTime now) const
Definition: MSPerson.cpp:457
const std::string & getID() const
returns the person id
Definition: MSPerson.cpp:524
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
virtual void beginEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:396
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:298
SUMOTime getDesiredDepart() const
Returns the desired departure time.
Definition: MSPerson.cpp:558
virtual ~MSPerson()
destructor
Definition: MSPerson.cpp:514
const SUMOVehicleParameter * myParameter
the plan of the person
Definition: MSPerson.h:479
const MSEdge & getDestination() const
returns the destination edge
Definition: MSPerson.cpp:70
Position positionAtOffset(SUMOReal pos) const
Returns the position at the given length.
void setDeparted(SUMOTime now)
logs end of the step
Definition: MSPerson.cpp:564
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:168
MSPersonStage(const MSEdge &destination, StageType type)
constructor
Definition: MSPerson.cpp:62
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:289
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Definition: MSPerson.h:576
std::vector< const MSEdge * > myRoute
The route of the person.
Definition: MSPerson.h:264
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.h:519
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSPerson.h:524
static const SUMOReal SIDEWALK_OFFSET
the offset for computing person positions when walking
Definition: MSPerson.h:597
virtual bool isWaitingFor(const std::string &line) const
Whether the person waits for a vehicle of the line specified.
Definition: MSPerson.cpp:90
virtual void beginEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:491
void setDeparted(SUMOTime now)
logs end of the step
Definition: MSPerson.cpp:76
Position getPosition(SUMOTime now) const
Definition: MSPerson.cpp:163
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:472
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:61
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Definition: MSPerson.cpp:365
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:304
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:154
T MAX2(T a, T b)
Definition: StdDefs.h:71
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:226
const MSVehicleType * myVType
This Persons's type. (mainly used for drawing related information.
Definition: MSPerson.h:482
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
#define TIME2STEPS(x)
Definition: SUMOTime.h:66
SUMOReal getEndLanePosition() const
Returns the end position of this bus stop.
Definition: MSBusStop.cpp:71
SUMOReal getEdgeAngle(const MSEdge *e, SUMOReal at) const
Definition: MSPerson.cpp:106
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:383
T MAX3(T a, T b, T c)
Definition: StdDefs.h:85
virtual void proceed(MSNet *net, MSPerson *person, SUMOTime now, MSEdge *previousEdge, const SUMOReal at)
proceeds to the next step
Definition: MSPerson.cpp:179
The simulated network and simulation perfomer.
Definition: MSNet.h:89
The car-following model and parameter.
Definition: MSVehicleType.h:74
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:156
const MSEdge & getDestination() const
Returns the current destination.
Definition: MSPerson.h:514
MSPersonStage_Walking(const std::vector< const MSEdge * > &route, MSBusStop *toBS, SUMOTime walkingTime, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos)
constructor
Definition: MSPerson.cpp:117
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:144
static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines)
const std::string & getID() const
Returns the id.
Definition: Named.h:60
A road/street connecting two junctions.
Definition: MSEdge.h:73
Position getEdgePosition(const MSEdge *e, SUMOReal at, SUMOReal offset) const
get position on edge e at length at with orthogonal offset
Definition: MSPerson.cpp:96
MSPersonPlan * myPlan
the plan of the person
Definition: MSPerson.h:485
void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:578
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.cpp:568
SUMOTime moveToNextEdge(MSPerson *person, SUMOTime currentTime)
Definition: MSPerson.cpp:252
the edges of a route
SUMOReal getEdgePos(SUMOTime now) const
Definition: MSPerson.cpp:439
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
SUMOReal getAngle(SUMOTime now) const
Definition: MSPerson.cpp:324
A lane area vehicles can halt at.
Definition: MSBusStop.h:63
A list of positions.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:263
void addWaiting(const MSEdge *edge, MSPerson *person)
adds a person to the list of persons waiting for a vehicle on the specified edge
virtual void endEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:245
SUMOTime depart
The vehicle's departure time.
Position getPosition(SUMOTime now) const
Definition: MSPerson.cpp:451
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
virtual void proceed(MSNet *net, MSPerson *person, SUMOTime now, MSEdge *previousEdge, const SUMOReal at)
proceeds to the next step
Definition: MSPerson.cpp:463
T MIN2(T a, T b)
Definition: StdDefs.h:65
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:389
virtual void removePerson(MSPerson *p) const
Definition: MSEdge.h:441
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:433
void setWaitEnd(SUMOTime time, MSPerson *person)
sets the arrival time for a waiting or walking person
virtual void addPerson(MSPerson *p) const
Definition: MSEdge.h:437
void unsetWalking(MSPerson *p)
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
bool isWaitingFor(const std::string &line) const
Whether the person waits for a vehicle of the line specified.
Definition: MSPerson.cpp:359
MSPersonStage_Waiting(const MSEdge &destination, SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string &actType)
constructor
Definition: MSPerson.cpp:411
void unregisterOneWaitingForPerson()
decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
std::string getStageTypeName() const
return string representation of the current stage
Definition: MSPerson.cpp:377
SUMOReal getAngle(SUMOTime now) const
Definition: MSPerson.cpp:171
MSPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSPersonPlan *plan)
constructor
Definition: MSPerson.cpp:508
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
virtual void beginEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSPerson.cpp:238
void computeWalkingTime(const MSEdge *const e, SUMOReal fromPos, SUMOReal toPos, MSBusStop *bs)
Definition: MSPerson.cpp:203
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSPerson.cpp:427
Structure representing possible vehicle parameter.
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Definition: MSPerson.cpp:478
virtual void endEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:402
void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:570
virtual MSPersonControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:611
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:294
void setWalking(MSPerson *p)
MSPersonPlan::iterator myStep
the iterator over the route
Definition: MSPerson.h:488
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:334
int SUMOTime
Definition: SUMOTime.h:43
Position getPosition(SUMOTime now) const
Definition: MSPerson.cpp:314
SUMOTime timeWaiting4Vehicle(SUMOTime now) const
time spent waiting for a ride
Definition: MSPerson.cpp:371
bool proceed(MSNet *net, SUMOTime time)
Definition: MSPerson.cpp:530
MSPersonStage_Driving(const MSEdge &destination, MSBusStop *toBS, const std::vector< std::string > &lines)
constructor
Definition: MSPerson.cpp:279
virtual void endEventOutput(const MSPerson &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSPerson.cpp:498
const MSEdge * getFromEdge() const
Definition: MSPerson.cpp:150
const PositionVector & getShape() const
Returns this lane's shape.
Definition: MSLane.h:323
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:152
void move2side(SUMOReal amount)
Patch the time in a way that it is at least as high as the simulation begin time. ...
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:215
virtual void proceed(MSNet *net, MSPerson *person, SUMOTime now, MSEdge *previousEdge, const SUMOReal at)
proceeds to the next step
Definition: MSPerson.cpp:339
const MSEdge & myDestination
the next edge to reach (either by walking or driving)
Definition: MSPerson.h:161
virtual ~MSPersonStage()
destructor
Definition: MSPerson.cpp:66
MSEventControl & getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:334
SUMOReal myDepartPos
A vector of computed times an edge is reached.
Definition: MSPerson.h:272
void setArrived(SUMOTime now)
logs end of the step
Definition: MSPerson.cpp:84
virtual void erase(MSPerson *person)
removes a single person
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
std::vector< MSPersonStage * > MSPersonPlan
the structure holding the plan of a person
Definition: MSPerson.h:475
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
Definition: MSPerson.cpp:220
std::string id
The vehicle's id.
SUMOReal getAngle() const
Returns the vehicle's direction in degrees.
Definition: MSVehicle.cpp:639