Eclipse SUMO - Simulation of Urban MObility
MSTransportable.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 common superclass for modelling transportable objects like persons and containers
15 /****************************************************************************/
16 #ifndef MSTransportable_h
17 #define MSTransportable_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <set>
25 #include <cassert>
26 #include <utils/common/SUMOTime.h>
28 #include <utils/geom/Position.h>
30 #include <utils/geom/Boundary.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSEdge;
39 class MSLane;
40 class MSNet;
41 class MSStoppingPlace;
42 class MSVehicleType;
43 class OutputDevice;
45 class SUMOVehicle;
47 
48 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
59 public:
60  enum StageType {
62  WAITING = 1,
63  MOVING_WITHOUT_VEHICLE = 2, // walking for persons, tranship for containers
64  DRIVING = 3,
65  ACCESS = 4,
66  TRIP = 5
67  };
68 
73  class Stage {
74  public:
76  Stage(const MSEdge* destination, MSStoppingPlace* toStop, const double arrivalPos, StageType type);
77 
79  virtual ~Stage();
80 
82  const MSEdge* getDestination() const;
83 
86  return myDestinationStop;
87  }
88 
90  virtual const MSStoppingPlace* getOriginStop() const {
91  return nullptr;
92  }
93 
94  double getArrivalPos() const {
95  return myArrivalPos;
96  }
97 
99  virtual const MSEdge* getEdge() const;
100  virtual const MSEdge* getFromEdge() const;
101  virtual double getEdgePos(SUMOTime now) const;
102 
104  virtual Position getPosition(SUMOTime now) const = 0;
105 
107  virtual double getAngle(SUMOTime now) const = 0;
108 
111  return myType;
112  }
113 
115  virtual std::string getStageDescription() const = 0;
116 
118  virtual std::string getStageSummary() const = 0;
119 
121  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous) = 0;
122 
124  virtual void abort(MSTransportable*) {};
125 
127  virtual void setSpeed(double) {};
128 
130  SUMOTime getDeparted() const;
131 
133  void setDeparted(SUMOTime now);
134 
136  virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
137 
139  virtual bool isWaitingFor(const SUMOVehicle* vehicle) const;
140 
142  virtual bool isWaiting4Vehicle() const {
143  return false;
144  }
145 
147  virtual SUMOVehicle* getVehicle() const {
148  return nullptr;
149  }
150 
152  virtual SUMOTime getWaitingTime(SUMOTime now) const;
153 
155  virtual double getSpeed() const;
156 
158  virtual ConstMSEdgeVector getEdges() const;
159 
161  Position getEdgePosition(const MSEdge* e, double at, double offset) const;
162 
164  Position getLanePosition(const MSLane* lane, double at, double offset) const;
165 
167  double getEdgeAngle(const MSEdge* e, double at) const;
168 
169  void setDestination(const MSEdge* newDestination, MSStoppingPlace* newDestStop);
170 
172  virtual double getDistance() const = 0;
173 
178  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const = 0;
179 
185  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
186 
191  virtual void beginEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
192 
197  virtual void endEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
198 
199  virtual Stage* clone() const = 0;
200 
201  protected:
204 
207 
209  double myArrivalPos;
210 
213 
216 
219 
220  private:
222  Stage(const Stage&);
223 
226 
227  };
228 
232  class Stage_Trip : public Stage {
233  public:
235  Stage_Trip(const MSEdge* origin, MSStoppingPlace* fromStop,
236  const MSEdge* destination, MSStoppingPlace* toStop,
237  const SUMOTime duration, const SVCPermissions modeSet,
238  const std::string& vTypes, const double speed, const double walkFactor,
239  const double departPosLat, const bool hasArrivalPos, const double arrivalPos);
240 
242  virtual ~Stage_Trip();
243 
244  Stage* clone() const;
245 
246  const MSEdge* getEdge() const;
247 
249  return myOriginStop;
250  }
251 
252  double getEdgePos(SUMOTime now) const;
253 
254  Position getPosition(SUMOTime now) const;
255 
256  double getAngle(SUMOTime now) const;
257 
258  double getDistance() const {
259  // invalid
260  return -1;
261  }
262 
263  std::string getStageDescription() const {
264  return "trip";
265  }
266 
267  std::string getStageSummary() const;
268 
270  virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
271 
273  void setOrigin(const MSEdge* origin) {
274  myOrigin = origin;
275  }
276 
278  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
279 
285  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
286 
292  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
293 
298  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
299 
304  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
305 
306  private:
308  const MSEdge* myOrigin;
309 
312 
315 
318 
320  const std::string myVTypes;
321 
323  const double mySpeed;
324 
326  const double myWalkFactor;
327 
329  double myDepartPos;
330 
332  const double myDepartPosLat;
333 
335  const bool myHaveArrivalPos;
336 
337  private:
340 
343 
344  };
345 
349  class Stage_Waiting : public Stage {
350  public:
352  Stage_Waiting(const MSEdge* destination, MSStoppingPlace* toStop, SUMOTime duration, SUMOTime until,
353  double pos, const std::string& actType, const bool initial);
354 
356  virtual ~Stage_Waiting();
357 
358  Stage* clone() const;
359 
361  void abort(MSTransportable*);
362 
363  SUMOTime getUntil() const;
364 
366  Position getPosition(SUMOTime now) const;
367 
368  double getAngle(SUMOTime now) const;
369 
371  double getDistance() const {
372  return 0;
373  }
374 
375  SUMOTime getWaitingTime(SUMOTime now) const;
376 
377  std::string getStageDescription() const {
378  return "waiting (" + myActType + ")";
379  }
380 
381  std::string getStageSummary() const;
382 
384  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
385 
391  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
392 
398  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
399 
404  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
405 
410  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
411 
412  private:
415 
418 
420  std::string myActType;
421 
422  private:
425 
428 
429  };
430 
435  class Stage_Driving : public Stage {
436  public:
438  Stage_Driving(const MSEdge* destination, MSStoppingPlace* toStop,
439  const double arrivalPos, const std::vector<std::string>& lines,
440  const std::string& intendedVeh = "", SUMOTime intendedDepart = -1);
441 
443  virtual ~Stage_Driving();
444 
446  void abort(MSTransportable*);
447 
449  const MSEdge* getEdge() const;
450  const MSEdge* getFromEdge() const;
451  double getEdgePos(SUMOTime now) const;
452 
454  Position getPosition(SUMOTime now) const;
455 
456  double getAngle(SUMOTime now) const;
457 
459  double getDistance() const {
460  return myVehicleDistance;
461  }
462 
464  bool isWaitingFor(const SUMOVehicle* vehicle) const;
465 
467  bool isWaiting4Vehicle() const;
468 
470  std::string getWaitingDescription() const;
471 
473  return myVehicle;
474  }
475 
477  SUMOTime getWaitingTime(SUMOTime now) const;
478 
479  double getSpeed() const;
480 
481  ConstMSEdgeVector getEdges() const;
482 
483  void setVehicle(SUMOVehicle* v);
484 
486  void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
487 
492  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
493 
498  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
499 
500  const std::set<std::string>& getLines() const {
501  return myLines;
502  }
503 
504  std::string getIntendedVehicleID() const {
505  return myIntendedVehicleID;
506  }
507 
509  return myIntendedDepart;
510  }
511 
512  protected:
514  const std::set<std::string> myLines;
515 
519  std::string myVehicleID;
520  std::string myVehicleLine;
521 
524 
525  double myWaitingPos;
530 
531  std::string myIntendedVehicleID;
533 
534  private:
537 
540 
541  };
542 
545  bool isVehicle() const {
546  return false;
547  }
548 
549  bool isStopped() const {
550  return getCurrentStageType() == WAITING;
551  }
552 
553  double getSlope() const;
554 
555  double getChosenSpeedFactor() const {
556  return 1.0;
557  }
558 
559  SUMOVehicleClass getVClass() const;
560 
561  double getMaxSpeed() const;
562 
563  SUMOTime getWaitingTime() const;
564 
565  double getPreviousSpeed() const {
566  return getSpeed();
567  }
568 
569  double getAcceleration() const {
570  return 0.0;
571  }
572 
573  double getPositionOnLane() const {
574  return getEdgePos();
575  }
576 
577  double getBackPositionOnLane(const MSLane* /*lane*/) const {
578  return getEdgePos();
579  }
580 
581  Position getPosition(const double /*offset*/) const {
582  return getPosition();
583  }
585 
587  typedef std::vector<MSTransportable::Stage*> MSTransportablePlan;
588 
591 
593  virtual ~MSTransportable();
594 
595  /* @brief proceeds to the next step of the route,
596  * @return Whether the transportables plan continues */
597  virtual bool proceed(MSNet* net, SUMOTime time) = 0;
598 
600  const std::string& getID() const;
601 
602  inline const SUMOVehicleParameter& getParameter() const {
603  return *myParameter;
604  }
605 
606  inline const MSVehicleType& getVehicleType() const {
607  return *myVType;
608  }
609 
611  SUMOTime getDesiredDepart() const;
612 
614  void setDeparted(SUMOTime now);
615 
617  const MSEdge* getDestination() const {
618  return (*myStep)->getDestination();
619  }
620 
622  const MSEdge* getNextDestination() const {
623  return (*(myStep + 1))->getDestination();
624  }
625 
627  const MSEdge* getEdge() const {
628  return (*myStep)->getEdge();
629  }
630 
632  const MSEdge* getFromEdge() const {
633  return (*myStep)->getFromEdge();
634  }
635 
637  virtual double getEdgePos() const;
638 
640  virtual Position getPosition() const;
641 
643  virtual double getAngle() const;
644 
646  virtual double getWaitingSeconds() const;
647 
649  virtual double getSpeed() const;
650 
652  virtual double getSpeedFactor() const {
653  return 1;
654  }
655 
658  return (*myStep)->getStageType();
659  }
660 
662  StageType getStageType(int next) const {
663  assert(myStep + next < myPlan->end());
664  assert(myStep + next >= myPlan->begin());
665  return (*(myStep + next))->getStageType();
666  }
667 
669  std::string getStageSummary(int stageIndex) const;
670 
672  std::string getCurrentStageDescription() const {
673  return (*myStep)->getStageDescription();
674  }
675 
678  return *myStep;
679  }
680 
683  assert(myStep + next >= myPlan->begin());
684  assert(myStep + next < myPlan->end());
685  return *(myStep + next);
686  }
687 
689  ConstMSEdgeVector getEdges(int next) const {
690  assert(myStep + next < myPlan->end());
691  assert(myStep + next >= myPlan->begin());
692  return (*(myStep + next))->getEdges();
693  }
694 
696  int getNumRemainingStages() const;
697 
699  int getNumStages() const;
700 
706  virtual void tripInfoOutput(OutputDevice& os) const = 0;
707 
713  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
714 
716  bool isWaitingFor(const SUMOVehicle* vehicle) const {
717  return (*myStep)->isWaitingFor(vehicle);
718  }
719 
721  bool isWaiting4Vehicle() const {
722  return (*myStep)->isWaiting4Vehicle();
723  }
724 
727  return (*myStep)->getVehicle();
728  }
729 
731  void appendStage(Stage* stage, int next = -1);
732 
734  void removeStage(int next);
735 
737  void setSpeed(double speed);
738 
740  double getArrivalPos() const {
741  return myPlan->back()->getArrivalPos();
742  }
743 
745  const MSEdge* getArrivalEdge() const {
746  return myPlan->back()->getEdges().back();
747  }
748 
757  void replaceVehicleType(MSVehicleType* type);
758 
759 
768 
769 
772 
774  bool hasArrived() const;
775 
777  bool hasDeparted() const;
778 
780  void rerouteParkingArea(MSStoppingPlace* orig, MSStoppingPlace* replacement);
781 
783  MSTransportableDevice* getDevice(const std::type_info& type) const;
784 
788  inline const std::vector<MSTransportableDevice*>& getDevices() const {
789  return myDevices;
790  }
791 
792 protected:
794  static const double ROADSIDE_OFFSET;
795 
798 
802 
805 
808 
810  MSTransportablePlan::iterator myStep;
811 
813  std::vector<MSTransportableDevice*> myDevices;
814 
815 private:
818 
821 
822 };
823 
824 
825 #endif
826 
827 /****************************************************************************/
MSTransportable::Stage::setDeparted
void setDeparted(SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:101
MSTransportable::Stage_Trip::setOrigin
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition: MSTransportable.h:273
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
MSTransportable::Stage_Trip::myDepartPosLat
const double myDepartPosLat
The lateral depart position.
Definition: MSTransportable.h:332
MSTransportable::Stage::getFromEdge
virtual const MSEdge * getFromEdge() const
Definition: MSTransportable.cpp:69
MSTransportable::Stage::isWaiting4Vehicle
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:142
MSTransportable::Stage_Waiting::getStageDescription
std::string getStageDescription() const
return (brief) string representation of the current stage
Definition: MSTransportable.h:377
Boundary.h
MSTransportable::Stage_Trip::operator=
Stage_Trip & operator=(const Stage_Trip &)
Invalidated assignment operator.
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
MSTransportable::Stage_Driving::isWaitingFor
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the person waits for the given vehicle.
Definition: MSTransportable.cpp:564
MSTransportable::Stage_Driving::getEdges
ConstMSEdgeVector getEdges() const
the edges of the current stage
Definition: MSTransportable.cpp:593
MSTransportable::Stage::clone
virtual Stage * clone() const =0
MSTransportable::Stage::operator=
Stage & operator=(const Stage &)
Invalidated assignment operator.
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:59
MSTransportable::hasDeparted
bool hasDeparted() const
return whether the transportable has started it's plan
Definition: MSTransportable.cpp:846
MSTransportable::Stage_Driving::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:459
MSTransportable::Stage_Driving::myWaitingEdge
const MSEdge * myWaitingEdge
Definition: MSTransportable.h:528
MSTransportable::Stage_Driving::myIntendedVehicleID
std::string myIntendedVehicleID
Definition: MSTransportable.h:531
MSTransportable::Stage_Trip::myOrigin
const MSEdge * myOrigin
the origin edge
Definition: MSTransportable.h:308
MSTransportable::Stage_Trip::myOriginStop
const MSStoppingPlace * myOriginStop
the origin edge
Definition: MSTransportable.h:311
MSTransportable::getDestination
const MSEdge * getDestination() const
Returns the current destination.
Definition: MSTransportable.h:617
MSTransportable::Stage::myArrivalPos
double myArrivalPos
the position at which we want to arrive
Definition: MSTransportable.h:209
MSTransportable::Stage_Trip::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:181
MSTransportable::Stage_Trip::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
Definition: MSTransportable.cpp:336
MSTransportable::Stage_Trip::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:195
MSTransportable::Stage_Driving::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Definition: MSTransportable.cpp:575
MSTransportable::Stage_Trip::myVTypes
const std::string myVTypes
The possible vehicles to use.
Definition: MSTransportable.h:320
SUMOTime.h
MSTransportable::getStageSummary
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Definition: MSTransportable.cpp:833
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSTransportable::Stage::Stage
Stage(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
Definition: MSTransportable.cpp:51
MSTransportable::Stage_Waiting::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
Definition: MSTransportable.cpp:429
MSTransportable::appendStage
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
Definition: MSTransportable.cpp:750
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSTransportable::Stage_Waiting::getWaitingTime
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSTransportable.cpp:459
MSTransportable::Stage::getLanePosition
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
Definition: MSTransportable.cpp:128
MSTransportable::Stage::myDestinationStop
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
Definition: MSTransportable.h:206
MSTransportable::getArrivalEdge
const MSEdge * getArrivalEdge() const
returns the final arrival edge
Definition: MSTransportable.h:745
MSTransportable::Stage_Driving
Definition: MSTransportable.h:435
MSTransportable::Stage_Trip::myHaveArrivalPos
const bool myHaveArrivalPos
whether an arrivalPos was in the input
Definition: MSTransportable.h:335
MSTransportable::Stage::myDestination
const MSEdge * myDestination
the next edge to reach by getting transported
Definition: MSTransportable.h:203
MSTransportable::Stage_Trip::myDepartPos
double myDepartPos
The depart position.
Definition: MSTransportable.h:329
MSTransportable::getEdges
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
Definition: MSTransportable.h:689
MSTransportable::isStopped
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSTransportable.h:549
MSTransportable::Stage_Driving::myVehicleLine
std::string myVehicleLine
Definition: MSTransportable.h:520
MSTransportable::Stage::getDistance
virtual double getDistance() const =0
get travel distance in this stage
MSTransportable::myParameter
const SUMOVehicleParameter * myParameter
the plan of the transportable
Definition: MSTransportable.h:797
MSTransportable::Stage::setSpeed
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
Definition: MSTransportable.h:127
MSTransportable::Stage_Trip::beginEventOutput
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSTransportable.cpp:341
MSTransportable::Stage::setDestination
void setDestination(const MSEdge *newDestination, MSStoppingPlace *newDestStop)
Definition: MSTransportable.cpp:139
MSTransportable::~MSTransportable
virtual ~MSTransportable()
destructor
Definition: MSTransportable.cpp:675
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
MSTransportable::myWriteEvents
bool myWriteEvents
Whether events shall be written.
Definition: MSTransportable.h:804
MSTransportable::Stage_Driving::myWaitingSince
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
Definition: MSTransportable.h:527
MSTransportable::getNextDestination
const MSEdge * getNextDestination() const
Returns the destination after the current destination.
Definition: MSTransportable.h:622
MSTransportable::Stage_Trip::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSTransportable.cpp:324
MSTransportable::Stage
Definition: MSTransportable.h:73
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSTransportable::getDevices
const std::vector< MSTransportableDevice * > & getDevices() const
Returns this vehicle's devices.
Definition: MSTransportable.h:788
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
MSTransportable::Stage_Waiting::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:371
MSTransportable::Stage_Trip::myWalkFactor
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSTransportable.h:326
MSTransportable::StageType
StageType
Definition: MSTransportable.h:60
MSTransportable::Stage::getEdges
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
Definition: MSTransportable.cpp:93
MSTransportable::Stage::setArrived
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:113
MSTransportable::Stage::getEdgePos
virtual double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:75
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
MSTransportable::Stage_Driving::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:509
MSTransportable
Definition: MSTransportable.h:58
MSTransportable::proceed
virtual bool proceed(MSNet *net, SUMOTime time)=0
PositionVector
A list of positions.
Definition: PositionVector.h:45
MSTransportable::Stage_Trip::Stage_Trip
Stage_Trip(const Stage_Trip &)
Invalidated copy constructor.
MSTransportable::Stage_Driving::myStopWaitPos
Position myStopWaitPos
Definition: MSTransportable.h:529
MSTransportable::Stage_Driving::myIntendedDepart
SUMOTime myIntendedDepart
Definition: MSTransportable.h:532
MSTransportable::getStageType
StageType getStageType(int next) const
the stage type for the nth next stage
Definition: MSTransportable.h:662
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:657
MSTransportable::Stage::getDestination
const MSEdge * getDestination() const
returns the destination edge
Definition: MSTransportable.cpp:57
MSTransportable::Stage_Driving::Stage_Driving
Stage_Driving(const Stage_Driving &)
Invalidated copy constructor.
MSTransportable::Stage::getEdge
virtual const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:63
MSTransportable::getDevice
MSTransportableDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
Definition: MSTransportable.cpp:907
MSTransportable::Stage::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
proceeds to this stage
MSTransportable::Stage_Waiting::Stage_Waiting
Stage_Waiting(const Stage_Waiting &)
Invalidated copy constructor.
MSTransportable::getSpeedFactor
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSTransportable.h:652
MSTransportable::Stage_Trip::~Stage_Trip
virtual ~Stage_Trip()
destructor
Definition: MSTransportable.cpp:170
MSTransportable::Stage_Driving::abort
void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.cpp:628
MSTransportable::Stage::getWaitingTime
virtual SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSTransportable.cpp:81
MSTransportable::setDeparted
void setDeparted(SUMOTime now)
logs depart time of the current stage
Definition: MSTransportable.cpp:709
MSTransportable::getPositionOnLane
double getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSTransportable.h:573
MSTransportable::Stage::abort
virtual void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.h:124
MSTransportable::Stage_Waiting::getUntil
SUMOTime getUntil() const
Definition: MSTransportable.cpp:380
MSTransportable::Stage_Waiting::myActType
std::string myActType
The type of activity.
Definition: MSTransportable.h:420
MSTransportable::Stage_Driving::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:550
MSTransportable::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.h:627
MSTransportable::Stage_Driving::getLines
const std::set< std::string > & getLines() const
Definition: MSTransportable.h:500
MSTransportable::Stage_Trip::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:188
MSTransportable::Stage::myDeparted
SUMOTime myDeparted
the time at which this stage started
Definition: MSTransportable.h:212
MSTransportable::Stage_Trip::Stage_Trip
Stage_Trip(const MSEdge *origin, MSStoppingPlace *fromStop, const MSEdge *destination, MSStoppingPlace *toStop, const SUMOTime duration, const SVCPermissions modeSet, const std::string &vTypes, const double speed, const double walkFactor, const double departPosLat, const bool hasArrivalPos, const double arrivalPos)
constructor
Definition: MSTransportable.cpp:152
MSTransportable::Stage_Driving::operator=
Stage_Driving & operator=(const Stage_Driving &)=delete
Invalidated assignment operator.
MSTransportable::getCurrentStage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
Definition: MSTransportable.h:677
MSTransportable::Stage::getStageDescription
virtual std::string getStageDescription() const =0
return (brief) string representation of the current stage
MSTransportable::Stage_Driving::setVehicle
void setVehicle(SUMOVehicle *v)
Definition: MSTransportable.cpp:617
MSTransportable::MSTransportable
MSTransportable(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
Definition: MSTransportable.cpp:667
MSTransportable::Stage_Trip::myDuration
SUMOTime myDuration
the time the trip should take (applies to only walking)
Definition: MSTransportable.h:314
MSTransportable::WAITING
@ WAITING
Definition: MSTransportable.h:62
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
MSTransportable::MSTransportable
MSTransportable(const MSTransportable &)
Invalidated copy constructor.
MSTransportable::Stage_Driving::getSpeed
double getSpeed() const
the speed of the transportable
Definition: MSTransportable.cpp:587
MSTransportable::Stage_Driving::getVehicle
SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:472
MSTransportable::getNumStages
int getNumStages() const
Return the total number stages in this persons plan.
Definition: MSTransportable.cpp:745
MSTransportable::getWaitingSeconds
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Definition: MSTransportable.cpp:729
MSTransportable::getMaxSpeed
double getMaxSpeed() const
Returns the vehicle's maximum speed.
Definition: MSTransportable.cpp:930
MSTransportable::Stage_Waiting::operator=
Stage_Waiting & operator=(const Stage_Waiting &)
Invalidated assignment operator.
MSTransportable::Stage_Waiting::tripInfoOutput
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Definition: MSTransportable.cpp:416
SUMOVehicleClass.h
MSTransportable::Stage_Waiting::Stage_Waiting
Stage_Waiting(const MSEdge *destination, MSStoppingPlace *toStop, SUMOTime duration, SUMOTime until, double pos, const std::string &actType, const bool initial)
constructor
Definition: MSTransportable.cpp:360
MSTransportable::getVehicle
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
Definition: MSTransportable.h:726
MSTransportable::Stage_Trip::getEdgePos
double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:201
MSTransportable::Stage::getPosition
virtual Position getPosition(SUMOTime now) const =0
returns the position of the transportable
MSTransportable::Stage_Driving::getFromEdge
const MSEdge * getFromEdge() const
Definition: MSTransportable.cpp:521
MSTransportable::Stage_Driving::~Stage_Driving
virtual ~Stage_Driving()
destructor
Definition: MSTransportable.cpp:506
MSTransportable::Stage::myArrived
SUMOTime myArrived
the time at which this stage ended
Definition: MSTransportable.h:215
MSTransportable::Stage_Waiting::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:393
MSTransportable::Stage_Trip::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:258
MSTransportable::Stage_Waiting::beginEventOutput
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSTransportable.cpp:445
MSTransportable::getBackPositionOnLane
double getBackPositionOnLane(const MSLane *) const
Get the vehicle's back position along the given lane.
Definition: MSTransportable.h:577
MSTransportable::Stage_Driving::Stage_Driving
Stage_Driving(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines, const std::string &intendedVeh="", SUMOTime intendedDepart=-1)
constructor
Definition: MSTransportable.cpp:489
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
MSTransportable::rerouteParkingArea
void rerouteParkingArea(MSStoppingPlace *orig, MSStoppingPlace *replacement)
adapt plan when the vehicle reroutes and now stops at replacement instead of orig
Definition: MSTransportable.cpp:852
MSTransportable::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:721
MSTransportable::Stage_Driving::setArrived
void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
marks arrival time and records driven distance
Definition: MSTransportable.cpp:601
MSTransportable::Stage_Driving::myWaitingPos
double myWaitingPos
Definition: MSTransportable.h:525
MSTransportable::Stage::tripInfoOutput
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const =0
Called on writing tripinfo output.
MSTransportable::Stage_Waiting::clone
Stage * clone() const
Definition: MSTransportable.cpp:375
MSTransportable::operator=
MSTransportable & operator=(const MSTransportable &)
Invalidated assignment operator.
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSTransportable::Stage_Trip::tripInfoOutput
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Definition: MSTransportable.cpp:331
MSTransportable::Stage::getVehicle
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:147
MSTransportable::getPosition
Position getPosition(const double) const
Return current position (x/y, cartesian)
Definition: MSTransportable.h:581
MSTransportable::getSlope
double getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSTransportable.cpp:917
MSTransportable::Stage::getOriginStop
virtual const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
Definition: MSTransportable.h:90
MSTransportable::Stage::getDeparted
SUMOTime getDeparted() const
get departure time of stage
Definition: MSTransportable.cpp:108
MSTransportable::DRIVING
@ DRIVING
Definition: MSTransportable.h:64
MSTransportable::Stage::getSpeed
virtual double getSpeed() const
the speed of the transportable
Definition: MSTransportable.cpp:87
MSTransportable::Stage::getStageType
StageType getStageType() const
Definition: MSTransportable.h:110
MSTransportable::Stage_Trip::setArrived
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:207
MSTransportableDevice
Abstract in-person device.
Definition: MSTransportableDevice.h:52
MSTransportable::Stage_Driving::getWaitingTime
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
Definition: MSTransportable.cpp:581
MSTransportable::isVehicle
bool isVehicle() const
Get the vehicle's ID.
Definition: MSTransportable.h:545
MSTransportable::Stage::getArrivalPos
double getArrivalPos() const
Definition: MSTransportable.h:94
MSTransportable::isWaitingFor
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
Definition: MSTransportable.h:716
MSTransportable::Stage_Driving::getEdgePos
double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:527
MSTransportable::getEdgePos
virtual double getEdgePos() const
Return the position on the edge.
Definition: MSTransportable.cpp:714
MSTransportable::getAcceleration
double getAcceleration() const
Returns the vehicle's acceleration.
Definition: MSTransportable.h:569
MSTransportable::Stage_Waiting
Definition: MSTransportable.h:349
MSTransportable::Stage_Trip::getStageSummary
std::string getStageSummary() const
return string summary of the current stage
Definition: MSTransportable.cpp:351
MSTransportable::tripInfoOutput
virtual void tripInfoOutput(OutputDevice &os) const =0
Called on writing tripinfo output.
MSTransportable::Stage_Driving::myVehicleID
std::string myVehicleID
cached vehicle data for output after the vehicle has been removed
Definition: MSTransportable.h:519
MSTransportable::Stage::isWaitingFor
virtual bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle.
Definition: MSTransportable.cpp:118
MSTransportable::Stage_Driving::myVehicleVClass
SUMOVehicleClass myVehicleVClass
Definition: MSTransportable.h:522
MSTransportable::Stage_Driving::getIntendedVehicleID
std::string getIntendedVehicleID() const
Definition: MSTransportable.h:504
Position.h
MSTransportable::Stage::endEventOutput
virtual void endEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (end of an action)
MSTransportable::getBoundingBox
PositionVector getBoundingBox() const
return the bounding box of the person
Definition: MSTransportable.cpp:815
MSTransportable::Stage_Trip::getOriginStop
const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
Definition: MSTransportable.h:248
MSTransportable::MSTransportablePlan
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
Definition: MSTransportable.h:587
MSTransportable::getNumRemainingStages
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Definition: MSTransportable.cpp:740
MSTransportable::getPreviousSpeed
double getPreviousSpeed() const
Returns the vehicle's previous speed.
Definition: MSTransportable.h:565
MSTransportable::Stage_Waiting::endEventOutput
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSTransportable.cpp:452
MSTransportable::Stage::getEdgePosition
Position getEdgePosition(const MSEdge *e, double at, double offset) const
get position on edge e at length at with orthogonal offset
Definition: MSTransportable.cpp:123
MSTransportable::getSpeed
virtual double getSpeed() const
the current speed of the transportable
Definition: MSTransportable.cpp:734
MSTransportable::Stage_Waiting::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:386
MSTransportable::getArrivalPos
double getArrivalPos() const
returns the final arrival pos
Definition: MSTransportable.h:740
MSTransportable::ACCESS
@ ACCESS
Definition: MSTransportable.h:65
MSTransportable::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
Definition: MSTransportable.h:606
MSTransportable::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const =0
Called on writing vehroute output.
MSTransportable::getNextStage
MSTransportable::Stage * getNextStage(int next) const
Return the current stage.
Definition: MSTransportable.h:682
MSTransportable::Stage_Driving::endEventOutput
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSTransportable.cpp:658
MSTransportable::hasArrived
bool hasArrived() const
return whether the person has reached the end of its plan
Definition: MSTransportable.cpp:841
MSTransportable::getVClass
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
Definition: MSTransportable.cpp:935
MSTransportable::Stage_Waiting::myWaitingUntil
SUMOTime myWaitingUntil
the time until the person is waiting
Definition: MSTransportable.h:417
MSTransportable::Stage::getEdgeAngle
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
Definition: MSTransportable.cpp:133
MSTransportable::getDesiredDepart
SUMOTime getDesiredDepart() const
Returns the desired departure time.
Definition: MSTransportable.cpp:704
MSTransportable::setSpeed
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
Definition: MSTransportable.cpp:787
MSTransportable::Stage_Trip
Definition: MSTransportable.h:232
MSTransportable::getID
const std::string & getID() const
returns the id of the transportable
Definition: MSTransportable.cpp:699
MSTransportable::getChosenSpeedFactor
double getChosenSpeedFactor() const
Definition: MSTransportable.h:555
MSTransportable::myDevices
std::vector< MSTransportableDevice * > myDevices
The devices this transportable has.
Definition: MSTransportable.h:813
MSTransportable::getPosition
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Definition: MSTransportable.cpp:719
MSTransportable::Stage_Waiting::~Stage_Waiting
virtual ~Stage_Waiting()
destructor
Definition: MSTransportable.cpp:372
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSTransportable.h:46
MSTransportable::TRIP
@ TRIP
Definition: MSTransportable.h:66
MSTransportable::Stage_Driving::myVehicle
SUMOVehicle * myVehicle
The taken vehicle.
Definition: MSTransportable.h:517
MSTransportable::Stage_Waiting::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSTransportable.cpp:399
MSTransportable::Stage::~Stage
virtual ~Stage()
destructor
Definition: MSTransportable.cpp:54
MSTransportable::Stage_Waiting::abort
void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.cpp:465
config.h
MSTransportable::myStep
MSTransportablePlan::iterator myStep
the iterator over the route
Definition: MSTransportable.h:810
MSTransportable::MOVING_WITHOUT_VEHICLE
@ MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:63
MSTransportable::Stage_Trip::mySpeed
const double mySpeed
The walking speed.
Definition: MSTransportable.h:323
MSTransportable::Stage::getDestinationStop
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
Definition: MSTransportable.h:85
MSTransportable::Stage_Driving::getWaitingDescription
std::string getWaitingDescription() const
Return where the person waits and for what.
Definition: MSTransportable.cpp:642
MSTransportable::removeStage
void removeStage(int next)
removes the nth next stage
Definition: MSTransportable.cpp:766
MSTransportable::Stage_Driving::myVehicleDistance
double myVehicleDistance
Definition: MSTransportable.h:523
MSTransportable::Stage_Driving::getIntendedDepart
SUMOTime getIntendedDepart() const
Definition: MSTransportable.h:508
SUMOTrafficObject.h
MSTransportable::myPlan
MSTransportablePlan * myPlan
the plan of the transportable
Definition: MSTransportable.h:807
MSTransportable::Stage::getStageSummary
virtual std::string getStageSummary() const =0
return string summary of the current stage
MSTransportable::Stage_Trip::clone
Stage * clone() const
Definition: MSTransportable.cpp:173
MSTransportable::Stage::myType
StageType myType
The type of this stage.
Definition: MSTransportable.h:218
MSTransportable::getWaitingTime
SUMOTime getWaitingTime() const
Definition: MSTransportable.cpp:925
MSTransportable::Stage_Waiting::getStageSummary
std::string getStageSummary() const
return string summary of the current stage
Definition: MSTransportable.cpp:474
MSTransportable::getFromEdge
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSTransportable.h:632
MSTransportable::Stage_Trip::getStageDescription
std::string getStageDescription() const
return (brief) string representation of the current stage
Definition: MSTransportable.h:263
MSTransportable::Stage_Waiting::myWaitingDuration
SUMOTime myWaitingDuration
the time the person is waiting
Definition: MSTransportable.h:414
MSTransportable::myVType
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Definition: MSTransportable.h:801
MSTransportable::WAITING_FOR_DEPART
@ WAITING_FOR_DEPART
Definition: MSTransportable.h:61
MSTransportable::Stage_Driving::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:537
SUMOAbstractRouter.h
MSTransportable::Stage_Trip::endEventOutput
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Definition: MSTransportable.cpp:346
MSTransportable::getParameter
const SUMOVehicleParameter & getParameter() const
Definition: MSTransportable.h:602
MSTransportable::getAngle
virtual double getAngle() const
return the current angle of the transportable
Definition: MSTransportable.cpp:724
MSTransportable::Stage::getAngle
virtual double getAngle(SUMOTime now) const =0
returns the angle of the transportable
MSTransportable::Stage::Stage
Stage(const Stage &)
Invalidated copy constructor.
PositionVector.h
MSTransportable::Stage_Driving::myLines
const std::set< std::string > myLines
the lines to choose from
Definition: MSTransportable.h:514
MSTransportable::Stage::beginEventOutput
virtual void beginEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (begin of an action)
MSTransportable::Stage_Trip::myModeSet
const SVCPermissions myModeSet
The allowed modes of transportation.
Definition: MSTransportable.h:317
MSTransportable::ROADSIDE_OFFSET
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
Definition: MSTransportable.h:794
MSTransportable::replaceVehicleType
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSTransportable.cpp:795
MSTransportable::Stage::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const =0
Called on writing vehroute output.
MSTransportable::Stage_Driving::beginEventOutput
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSTransportable.cpp:652
MSTransportable::getSingularType
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
Definition: MSTransportable.cpp:804
MSTransportable::getCurrentStageDescription
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
Definition: MSTransportable.h:672