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 /****************************************************************************/
15 // The common superclass for modelling transportable objects like persons and containers
16 /****************************************************************************/
17 #ifndef MSTransportable_h
18 #define MSTransportable_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <set>
26 #include <cassert>
27 #include <utils/common/SUMOTime.h>
29 #include <utils/geom/Position.h>
31 #include <utils/geom/Boundary.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSEdge;
40 class MSLane;
41 class MSNet;
42 class MSStoppingPlace;
43 class MSVehicleType;
44 class OutputDevice;
46 class SUMOVehicle;
48 
49 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
60 public:
61  enum StageType {
63  WAITING = 1,
64  MOVING_WITHOUT_VEHICLE = 2, // walking for persons, tranship for containers
65  DRIVING = 3,
66  ACCESS = 4,
67  TRIP = 5
68  };
69 
74  class Stage {
75  public:
77  Stage(const MSEdge* destination, MSStoppingPlace* toStop, const double arrivalPos, StageType type);
78 
80  virtual ~Stage();
81 
83  const MSEdge* getDestination() const;
84 
87  return myDestinationStop;
88  }
89 
91  virtual const MSStoppingPlace* getOriginStop() const {
92  return nullptr;
93  }
94 
95  double getArrivalPos() const {
96  return myArrivalPos;
97  }
98 
100  virtual const MSEdge* getEdge() const;
101  virtual const MSEdge* getFromEdge() const;
102  virtual double getEdgePos(SUMOTime now) const;
103 
105  virtual Position getPosition(SUMOTime now) const = 0;
106 
108  virtual double getAngle(SUMOTime now) const = 0;
109 
112  return myType;
113  }
114 
116  virtual std::string getStageDescription() const = 0;
117 
119  virtual std::string getStageSummary() const = 0;
120 
122  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous) = 0;
123 
125  virtual void abort(MSTransportable*) {};
126 
128  virtual void setSpeed(double) {};
129 
131  SUMOTime getDeparted() const;
132 
134  void setDeparted(SUMOTime now);
135 
137  virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
138 
140  virtual bool isWaitingFor(const SUMOVehicle* vehicle) const;
141 
143  virtual bool isWaiting4Vehicle() const {
144  return false;
145  }
146 
148  virtual SUMOVehicle* getVehicle() const {
149  return nullptr;
150  }
151 
153  virtual SUMOTime getWaitingTime(SUMOTime now) const;
154 
156  virtual double getSpeed() const;
157 
159  virtual ConstMSEdgeVector getEdges() const;
160 
162  Position getEdgePosition(const MSEdge* e, double at, double offset) const;
163 
165  Position getLanePosition(const MSLane* lane, double at, double offset) const;
166 
168  double getEdgeAngle(const MSEdge* e, double at) const;
169 
170  void setDestination(const MSEdge* newDestination, MSStoppingPlace* newDestStop);
171 
173  virtual double getDistance() const = 0;
174 
179  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const = 0;
180 
186  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
187 
192  virtual void beginEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
193 
198  virtual void endEventOutput(const MSTransportable& transportable, SUMOTime t, OutputDevice& os) const = 0;
199 
200  virtual Stage* clone() const = 0;
201 
202  protected:
205 
208 
210  double myArrivalPos;
211 
214 
217 
220 
221  private:
223  Stage(const Stage&);
224 
226  Stage& operator=(const Stage&);
227 
228  };
229 
233  class Stage_Trip : public Stage {
234  public:
236  Stage_Trip(const MSEdge* origin, MSStoppingPlace* fromStop,
237  const MSEdge* destination, MSStoppingPlace* toStop,
238  const SUMOTime duration, const SVCPermissions modeSet,
239  const std::string& vTypes, const double speed, const double walkFactor,
240  const double departPosLat, const bool hasArrivalPos, const double arrivalPos);
241 
243  virtual ~Stage_Trip();
244 
245  Stage* clone() const;
246 
247  const MSEdge* getEdge() const;
248 
250  return myOriginStop;
251  }
252 
253  double getEdgePos(SUMOTime now) const;
254 
255  Position getPosition(SUMOTime now) const;
256 
257  double getAngle(SUMOTime now) const;
258 
259  double getDistance() const {
260  // invalid
261  return -1;
262  }
263 
264  std::string getStageDescription() const {
265  return "trip";
266  }
267 
268  std::string getStageSummary() const;
269 
271  virtual void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
272 
274  void setOrigin(const MSEdge* origin) {
275  myOrigin = origin;
276  }
277 
279  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
280 
286  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
287 
293  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
294 
299  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
300 
305  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
306 
307  private:
309  const MSEdge* myOrigin;
310 
313 
316 
319 
321  const std::string myVTypes;
322 
324  const double mySpeed;
325 
327  const double myWalkFactor;
328 
330  double myDepartPos;
331 
333  const double myDepartPosLat;
334 
336  const bool myHaveArrivalPos;
337 
338  private:
340  Stage_Trip(const Stage_Trip&);
341 
344 
345  };
346 
350  class Stage_Waiting : public Stage {
351  public:
353  Stage_Waiting(const MSEdge* destination, MSStoppingPlace* toStop, SUMOTime duration, SUMOTime until,
354  double pos, const std::string& actType, const bool initial);
355 
357  virtual ~Stage_Waiting();
358 
359  Stage* clone() const;
360 
362  void abort(MSTransportable*);
363 
364  SUMOTime getUntil() const;
365 
367  Position getPosition(SUMOTime now) const;
368 
369  double getAngle(SUMOTime now) const;
370 
372  double getDistance() const {
373  return 0;
374  }
375 
376  SUMOTime getWaitingTime(SUMOTime now) const;
377 
378  std::string getStageDescription() const {
379  return "waiting (" + myActType + ")";
380  }
381 
382  std::string getStageSummary() const;
383 
385  virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, Stage* previous);
386 
392  virtual void tripInfoOutput(OutputDevice& os, const MSTransportable* const transportable) const;
393 
399  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const;
400 
405  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
406 
411  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
412 
413  private:
416 
419 
421  std::string myActType;
422 
423  private:
426 
429 
430  };
431 
436  class Stage_Driving : public Stage {
437  public:
439  Stage_Driving(const MSEdge* destination, MSStoppingPlace* toStop,
440  const double arrivalPos, const std::vector<std::string>& lines,
441  const std::string& intendedVeh = "", SUMOTime intendedDepart = -1);
442 
444  virtual ~Stage_Driving();
445 
447  void abort(MSTransportable*);
448 
450  const MSEdge* getEdge() const;
451  const MSEdge* getFromEdge() const;
452  double getEdgePos(SUMOTime now) const;
453 
455  Position getPosition(SUMOTime now) const;
456 
457  double getAngle(SUMOTime now) const;
458 
460  double getDistance() const {
461  return myVehicleDistance;
462  }
463 
465  bool isWaitingFor(const SUMOVehicle* vehicle) const;
466 
468  bool isWaiting4Vehicle() const;
469 
471  std::string getWaitingDescription() const;
472 
474  return myVehicle;
475  }
476 
478  SUMOTime getWaitingTime(SUMOTime now) const;
479 
480  double getSpeed() const;
481 
482  ConstMSEdgeVector getEdges() const;
483 
484  void setVehicle(SUMOVehicle* v);
485 
487  void setArrived(MSNet* net, MSTransportable* transportable, SUMOTime now);
488 
493  virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
494 
499  virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
500 
501  const std::set<std::string>& getLines() const {
502  return myLines;
503  }
504 
505  std::string getIntendedVehicleID() const {
506  return myIntendedVehicleID;
507  }
508 
510  return myIntendedDepart;
511  }
512 
513  protected:
515  const std::set<std::string> myLines;
516 
520  std::string myVehicleID;
521  std::string myVehicleLine;
522 
525 
526  double myWaitingPos;
531 
532  std::string myIntendedVehicleID;
534 
535  private:
538 
541 
542  };
543 
546  bool isVehicle() const {
547  return false;
548  }
549 
550  bool isStopped() const {
551  return getCurrentStageType() == WAITING;
552  }
553 
554  double getSlope() const;
555 
556  double getChosenSpeedFactor() const {
557  return 1.0;
558  }
559 
560  SUMOVehicleClass getVClass() const;
561 
562  double getMaxSpeed() const;
563 
564  SUMOTime getWaitingTime() const;
565 
566  double getPreviousSpeed() const {
567  return getSpeed();
568  }
569 
570  double getAcceleration() const {
571  return 0.0;
572  }
573 
574  double getPositionOnLane() const {
575  return getEdgePos();
576  }
577 
578  double getBackPositionOnLane(const MSLane* /*lane*/) const {
579  return getEdgePos();
580  }
581 
582  Position getPosition(const double /*offset*/) const {
583  return getPosition();
584  }
586 
588  typedef std::vector<MSTransportable::Stage*> MSTransportablePlan;
589 
592 
594  virtual ~MSTransportable();
595 
596  /* @brief proceeds to the next step of the route,
597  * @return Whether the transportables plan continues */
598  virtual bool proceed(MSNet* net, SUMOTime time) = 0;
599 
601  const std::string& getID() const;
602 
603  inline const SUMOVehicleParameter& getParameter() const {
604  return *myParameter;
605  }
606 
607  inline const MSVehicleType& getVehicleType() const {
608  return *myVType;
609  }
610 
612  SUMOTime getDesiredDepart() const;
613 
615  void setDeparted(SUMOTime now);
616 
618  const MSEdge* getDestination() const {
619  return (*myStep)->getDestination();
620  }
621 
623  const MSEdge* getNextDestination() const {
624  return (*(myStep + 1))->getDestination();
625  }
626 
628  const MSEdge* getEdge() const {
629  return (*myStep)->getEdge();
630  }
631 
633  const MSEdge* getFromEdge() const {
634  return (*myStep)->getFromEdge();
635  }
636 
638  virtual double getEdgePos() const;
639 
641  virtual Position getPosition() const;
642 
644  virtual double getAngle() const;
645 
647  virtual double getWaitingSeconds() const;
648 
650  virtual double getSpeed() const;
651 
653  virtual double getSpeedFactor() const {
654  return 1;
655  }
656 
659  return (*myStep)->getStageType();
660  }
661 
663  StageType getStageType(int next) const {
664  assert(myStep + next < myPlan->end());
665  assert(myStep + next >= myPlan->begin());
666  return (*(myStep + next))->getStageType();
667  }
668 
670  std::string getStageSummary(int stageIndex) const;
671 
673  std::string getCurrentStageDescription() const {
674  return (*myStep)->getStageDescription();
675  }
676 
679  return *myStep;
680  }
681 
684  assert(myStep + next >= myPlan->begin());
685  assert(myStep + next < myPlan->end());
686  return *(myStep + next);
687  }
688 
690  ConstMSEdgeVector getEdges(int next) const {
691  assert(myStep + next < myPlan->end());
692  assert(myStep + next >= myPlan->begin());
693  return (*(myStep + next))->getEdges();
694  }
695 
697  int getNumRemainingStages() const;
698 
700  int getNumStages() const;
701 
707  virtual void tripInfoOutput(OutputDevice& os) const = 0;
708 
714  virtual void routeOutput(OutputDevice& os, const bool withRouteLength) const = 0;
715 
717  bool isWaitingFor(const SUMOVehicle* vehicle) const {
718  return (*myStep)->isWaitingFor(vehicle);
719  }
720 
722  bool isWaiting4Vehicle() const {
723  return (*myStep)->isWaiting4Vehicle();
724  }
725 
728  return (*myStep)->getVehicle();
729  }
730 
732  void appendStage(Stage* stage, int next = -1);
733 
735  void removeStage(int next);
736 
738  void setSpeed(double speed);
739 
741  double getArrivalPos() const {
742  return myPlan->back()->getArrivalPos();
743  }
744 
746  const MSEdge* getArrivalEdge() const {
747  return myPlan->back()->getEdges().back();
748  }
749 
758  void replaceVehicleType(MSVehicleType* type);
759 
760 
769 
770 
773 
775  bool hasArrived() const;
776 
778  bool hasDeparted() const;
779 
781  void rerouteParkingArea(MSStoppingPlace* orig, MSStoppingPlace* replacement);
782 
784  MSTransportableDevice* getDevice(const std::type_info& type) const;
785 
789  inline const std::vector<MSTransportableDevice*>& getDevices() const {
790  return myDevices;
791  }
792 
793 protected:
795  static const double ROADSIDE_OFFSET;
796 
799 
803 
806 
809 
811  MSTransportablePlan::iterator myStep;
812 
814  std::vector<MSTransportableDevice*> myDevices;
815 
816 private:
819 
822 
823 };
824 
825 
826 #endif
827 
828 /****************************************************************************/
MSTransportable::Stage::setDeparted
void setDeparted(SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:102
MSTransportable::Stage_Trip::setOrigin
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
Definition: MSTransportable.h:274
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
MSTransportable::Stage_Trip::myDepartPosLat
const double myDepartPosLat
The lateral depart position.
Definition: MSTransportable.h:333
MSTransportable::Stage::getFromEdge
virtual const MSEdge * getFromEdge() const
Definition: MSTransportable.cpp:70
MSTransportable::Stage::isWaiting4Vehicle
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:143
MSTransportable::Stage_Driving::operator=
Stage_Driving & operator=(const Stage_Driving &)
Invalidated assignment operator.
MSTransportable::Stage_Waiting::getStageDescription
std::string getStageDescription() const
return (brief) string representation of the current stage
Definition: MSTransportable.h:378
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:48
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
MSTransportable::Stage_Driving::isWaitingFor
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the person waits for the given vehicle.
Definition: MSTransportable.cpp:565
MSTransportable::Stage_Driving::getEdges
ConstMSEdgeVector getEdges() const
the edges of the current stage
Definition: MSTransportable.cpp:591
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:60
MSTransportable::hasDeparted
bool hasDeparted() const
return whether the transportable has started it's plan
Definition: MSTransportable.cpp:841
MSTransportable::Stage_Driving::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:460
MSTransportable::Stage_Driving::myWaitingEdge
const MSEdge * myWaitingEdge
Definition: MSTransportable.h:529
MSTransportable::Stage_Driving::myIntendedVehicleID
std::string myIntendedVehicleID
Definition: MSTransportable.h:532
MSTransportable::Stage_Trip::myOrigin
const MSEdge * myOrigin
the origin edge
Definition: MSTransportable.h:309
MSTransportable::Stage_Trip::myOriginStop
const MSStoppingPlace * myOriginStop
the origin edge
Definition: MSTransportable.h:312
MSTransportable::getDestination
const MSEdge * getDestination() const
Returns the current destination.
Definition: MSTransportable.h:618
MSTransportable::Stage::myArrivalPos
double myArrivalPos
the position at which we want to arrive
Definition: MSTransportable.h:210
MSTransportable::Stage_Trip::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:182
MSTransportable::Stage_Trip::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
Definition: MSTransportable.cpp:337
MSTransportable::Stage_Trip::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:196
MSTransportable::Stage_Driving::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
Definition: MSTransportable.cpp:573
MSTransportable::Stage_Trip::myVTypes
const std::string myVTypes
The possible vehicles to use.
Definition: MSTransportable.h:321
SUMOTime.h
MSTransportable::getStageSummary
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Definition: MSTransportable.cpp:828
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSTransportable::Stage::Stage
Stage(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
Definition: MSTransportable.cpp:52
MSTransportable::Stage_Waiting::routeOutput
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
Definition: MSTransportable.cpp:430
MSTransportable::appendStage
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
Definition: MSTransportable.cpp:745
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
MSTransportable::Stage_Waiting::getWaitingTime
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSTransportable.cpp:460
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:129
MSTransportable::Stage::myDestinationStop
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
Definition: MSTransportable.h:207
MSTransportable::getArrivalEdge
const MSEdge * getArrivalEdge() const
returns the final arrival edge
Definition: MSTransportable.h:746
MSTransportable::Stage_Driving
Definition: MSTransportable.h:436
MSTransportable::Stage_Trip::myHaveArrivalPos
const bool myHaveArrivalPos
whether an arrivalPos was in the input
Definition: MSTransportable.h:336
MSTransportable::Stage::myDestination
const MSEdge * myDestination
the next edge to reach by getting transported
Definition: MSTransportable.h:204
MSTransportable::Stage_Trip::myDepartPos
double myDepartPos
The depart position.
Definition: MSTransportable.h:330
MSTransportable::getEdges
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
Definition: MSTransportable.h:690
MSTransportable::isStopped
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSTransportable.h:550
MSTransportable::Stage_Driving::myVehicleLine
std::string myVehicleLine
Definition: MSTransportable.h:521
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:798
MSTransportable::Stage::setSpeed
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
Definition: MSTransportable.h:128
MSTransportable::Stage_Trip::beginEventOutput
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSTransportable.cpp:342
MSTransportable::Stage::setDestination
void setDestination(const MSEdge *newDestination, MSStoppingPlace *newDestStop)
Definition: MSTransportable.cpp:140
MSTransportable::~MSTransportable
virtual ~MSTransportable()
destructor
Definition: MSTransportable.cpp:673
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
MSTransportable::myWriteEvents
bool myWriteEvents
Whether events shall be written.
Definition: MSTransportable.h:805
MSTransportable::Stage_Driving::myWaitingSince
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
Definition: MSTransportable.h:528
MSTransportable::getNextDestination
const MSEdge * getNextDestination() const
Returns the destination after the current destination.
Definition: MSTransportable.h:623
MSTransportable::Stage_Trip::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSTransportable.cpp:325
MSTransportable::Stage
Definition: MSTransportable.h:74
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
MSTransportable::getDevices
const std::vector< MSTransportableDevice * > & getDevices() const
Returns this vehicle's devices.
Definition: MSTransportable.h:789
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
MSTransportable::Stage_Waiting::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:372
MSTransportable::Stage_Trip::myWalkFactor
const double myWalkFactor
The factor to apply to walking durations.
Definition: MSTransportable.h:327
MSTransportable::StageType
StageType
Definition: MSTransportable.h:61
MSTransportable::Stage::getEdges
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
Definition: MSTransportable.cpp:94
MSTransportable::Stage::setArrived
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:114
MSTransportable::Stage::getEdgePos
virtual double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:76
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
MSTransportable::Stage_Driving::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:510
MSTransportable
Definition: MSTransportable.h:59
MSTransportable::proceed
virtual bool proceed(MSNet *net, SUMOTime time)=0
PositionVector
A list of positions.
Definition: PositionVector.h:46
MSTransportable::Stage_Driving::myStopWaitPos
Position myStopWaitPos
Definition: MSTransportable.h:530
MSTransportable::Stage_Driving::myIntendedDepart
SUMOTime myIntendedDepart
Definition: MSTransportable.h:533
MSTransportable::getStageType
StageType getStageType(int next) const
the stage type for the nth next stage
Definition: MSTransportable.h:663
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:658
MSTransportable::Stage::getDestination
const MSEdge * getDestination() const
returns the destination edge
Definition: MSTransportable.cpp:58
MSTransportable::Stage::getEdge
virtual const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:64
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:902
MSTransportable::Stage::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
proceeds to this stage
MSTransportable::getSpeedFactor
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSTransportable.h:653
MSTransportable::Stage_Trip::~Stage_Trip
virtual ~Stage_Trip()
destructor
Definition: MSTransportable.cpp:171
MSTransportable::Stage_Driving::abort
void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.cpp:626
MSTransportable::Stage::getWaitingTime
virtual SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Definition: MSTransportable.cpp:82
MSTransportable::setDeparted
void setDeparted(SUMOTime now)
logs depart time of the current stage
Definition: MSTransportable.cpp:704
MSTransportable::getPositionOnLane
double getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSTransportable.h:574
MSTransportable::Stage::abort
virtual void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.h:125
MSTransportable::Stage_Waiting::getUntil
SUMOTime getUntil() const
Definition: MSTransportable.cpp:381
MSTransportable::Stage_Waiting::myActType
std::string myActType
The type of activity.
Definition: MSTransportable.h:421
MSTransportable::Stage_Driving::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:551
MSTransportable::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.h:628
MSTransportable::Stage_Driving::getLines
const std::set< std::string > & getLines() const
Definition: MSTransportable.h:501
MSTransportable::Stage_Trip::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:189
MSTransportable::Stage::myDeparted
SUMOTime myDeparted
the time at which this stage started
Definition: MSTransportable.h:213
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:153
MSTransportable::getCurrentStage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
Definition: MSTransportable.h:678
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:615
MSTransportable::MSTransportable
MSTransportable(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
Definition: MSTransportable.cpp:665
MSTransportable::Stage_Trip::myDuration
SUMOTime myDuration
the time the trip should take (applies to only walking)
Definition: MSTransportable.h:315
MSTransportable::WAITING
Definition: MSTransportable.h:63
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:219
MSTransportable::Stage_Driving::getSpeed
double getSpeed() const
the speed of the transportable
Definition: MSTransportable.cpp:585
MSTransportable::Stage_Driving::getVehicle
SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:473
MSTransportable::getNumStages
int getNumStages() const
Return the total number stages in this persons plan.
Definition: MSTransportable.cpp:740
MSTransportable::getWaitingSeconds
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Definition: MSTransportable.cpp:724
MSTransportable::getMaxSpeed
double getMaxSpeed() const
Returns the vehicle's maximum speed.
Definition: MSTransportable.cpp:925
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:417
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:361
MSTransportable::getVehicle
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
Definition: MSTransportable.h:727
MSTransportable::Stage_Trip::getEdgePos
double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:202
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:522
MSTransportable::Stage_Driving::~Stage_Driving
virtual ~Stage_Driving()
destructor
Definition: MSTransportable.cpp:507
MSTransportable::Stage::myArrived
SUMOTime myArrived
the time at which this stage ended
Definition: MSTransportable.h:216
MSTransportable::Stage_Waiting::getAngle
double getAngle(SUMOTime now) const
returns the angle of the transportable
Definition: MSTransportable.cpp:394
MSTransportable::Stage_Trip::getDistance
double getDistance() const
get travel distance in this stage
Definition: MSTransportable.h:259
MSTransportable::Stage_Waiting::beginEventOutput
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
Definition: MSTransportable.cpp:446
MSTransportable::getBackPositionOnLane
double getBackPositionOnLane(const MSLane *) const
Get the vehicle's back position along the given lane.
Definition: MSTransportable.h:578
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:490
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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:847
MSTransportable::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:722
MSTransportable::Stage_Driving::setArrived
void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
marks arrival time and records driven distance
Definition: MSTransportable.cpp:599
MSTransportable::Stage_Driving::myWaitingPos
double myWaitingPos
Definition: MSTransportable.h:526
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:376
MSTransportable::operator=
MSTransportable & operator=(const MSTransportable &)
Invalidated assignment operator.
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
MSTransportable::Stage_Trip::tripInfoOutput
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Definition: MSTransportable.cpp:332
MSTransportable::Stage::getVehicle
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:148
MSTransportable::getPosition
Position getPosition(const double) const
Return current position (x/y, cartesian)
Definition: MSTransportable.h:582
MSTransportable::getSlope
double getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSTransportable.cpp:912
MSTransportable::Stage::getOriginStop
virtual const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
Definition: MSTransportable.h:91
MSTransportable::Stage::getDeparted
SUMOTime getDeparted() const
get departure time of stage
Definition: MSTransportable.cpp:109
MSTransportable::DRIVING
Definition: MSTransportable.h:65
MSTransportable::Stage::getSpeed
virtual double getSpeed() const
the speed of the transportable
Definition: MSTransportable.cpp:88
MSTransportable::Stage::getStageType
StageType getStageType() const
Definition: MSTransportable.h:111
MSTransportable::Stage_Trip::setArrived
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
Definition: MSTransportable.cpp:208
MSTransportableDevice
Abstract in-person device.
Definition: MSTransportableDevice.h:53
MSTransportable::Stage_Driving::getWaitingTime
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
Definition: MSTransportable.cpp:579
MSTransportable::isVehicle
bool isVehicle() const
Get the vehicle's ID.
Definition: MSTransportable.h:546
MSTransportable::Stage::getArrivalPos
double getArrivalPos() const
Definition: MSTransportable.h:95
MSTransportable::isWaitingFor
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
Definition: MSTransportable.h:717
MSTransportable::Stage_Driving::getEdgePos
double getEdgePos(SUMOTime now) const
Definition: MSTransportable.cpp:528
MSTransportable::getEdgePos
virtual double getEdgePos() const
Return the position on the edge.
Definition: MSTransportable.cpp:709
MSTransportable::getAcceleration
double getAcceleration() const
Returns the vehicle's acceleration.
Definition: MSTransportable.h:570
MSTransportable::Stage_Waiting
Definition: MSTransportable.h:350
MSTransportable::Stage_Trip::getStageSummary
std::string getStageSummary() const
return string summary of the current stage
Definition: MSTransportable.cpp:352
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:520
MSTransportable::Stage::isWaitingFor
virtual bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle.
Definition: MSTransportable.cpp:119
MSTransportable::Stage_Driving::myVehicleVClass
SUMOVehicleClass myVehicleVClass
Definition: MSTransportable.h:523
MSTransportable::Stage_Driving::getIntendedVehicleID
std::string getIntendedVehicleID() const
Definition: MSTransportable.h:505
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:810
MSTransportable::Stage_Trip::getOriginStop
const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
Definition: MSTransportable.h:249
MSTransportable::MSTransportablePlan
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
Definition: MSTransportable.h:588
MSTransportable::getNumRemainingStages
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Definition: MSTransportable.cpp:735
MSTransportable::getPreviousSpeed
double getPreviousSpeed() const
Returns the vehicle's previous speed.
Definition: MSTransportable.h:566
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:453
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:124
MSTransportable::getSpeed
virtual double getSpeed() const
the current speed of the transportable
Definition: MSTransportable.cpp:729
MSTransportable::Stage_Waiting::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:387
MSTransportable::getArrivalPos
double getArrivalPos() const
returns the final arrival pos
Definition: MSTransportable.h:741
MSTransportable::ACCESS
Definition: MSTransportable.h:66
MSTransportable::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
Definition: MSTransportable.h:607
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:683
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:656
MSTransportable::hasArrived
bool hasArrived() const
return whether the person has reached the end of its plan
Definition: MSTransportable.cpp:836
MSTransportable::getVClass
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
Definition: MSTransportable.cpp:930
MSTransportable::Stage_Waiting::myWaitingUntil
SUMOTime myWaitingUntil
the time until the person is waiting
Definition: MSTransportable.h:418
MSTransportable::Stage::getEdgeAngle
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
Definition: MSTransportable.cpp:134
MSTransportable::getDesiredDepart
SUMOTime getDesiredDepart() const
Returns the desired departure time.
Definition: MSTransportable.cpp:699
MSTransportable::setSpeed
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
Definition: MSTransportable.cpp:782
MSTransportable::Stage_Trip
Definition: MSTransportable.h:233
MSTransportable::getID
const std::string & getID() const
returns the id of the transportable
Definition: MSTransportable.cpp:694
MSTransportable::getChosenSpeedFactor
double getChosenSpeedFactor() const
Definition: MSTransportable.h:556
MSTransportable::myDevices
std::vector< MSTransportableDevice * > myDevices
The devices this transportable has.
Definition: MSTransportable.h:814
MSTransportable::getPosition
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Definition: MSTransportable.cpp:714
MSTransportable::Stage_Waiting::~Stage_Waiting
virtual ~Stage_Waiting()
destructor
Definition: MSTransportable.cpp:373
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSTransportable.h:47
MSTransportable::TRIP
Definition: MSTransportable.h:67
MSTransportable::Stage_Driving::myVehicle
SUMOVehicle * myVehicle
The taken vehicle.
Definition: MSTransportable.h:518
MSTransportable::Stage_Waiting::proceed
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
Definition: MSTransportable.cpp:400
MSTransportable::Stage::~Stage
virtual ~Stage()
destructor
Definition: MSTransportable.cpp:55
MSTransportable::Stage_Waiting::abort
void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.cpp:466
config.h
MSTransportable::myStep
MSTransportablePlan::iterator myStep
the iterator over the route
Definition: MSTransportable.h:811
MSTransportable::MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:64
MSTransportable::Stage_Trip::mySpeed
const double mySpeed
The walking speed.
Definition: MSTransportable.h:324
MSTransportable::Stage::getDestinationStop
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
Definition: MSTransportable.h:86
MSTransportable::Stage_Driving::getWaitingDescription
std::string getWaitingDescription() const
Return where the person waits and for what.
Definition: MSTransportable.cpp:640
MSTransportable::removeStage
void removeStage(int next)
removes the nth next stage
Definition: MSTransportable.cpp:761
MSTransportable::Stage_Driving::myVehicleDistance
double myVehicleDistance
Definition: MSTransportable.h:524
MSTransportable::Stage_Driving::getIntendedDepart
SUMOTime getIntendedDepart() const
Definition: MSTransportable.h:509
SUMOTrafficObject.h
MSTransportable::myPlan
MSTransportablePlan * myPlan
the plan of the transportable
Definition: MSTransportable.h:808
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:174
MSTransportable::Stage::myType
StageType myType
The type of this stage.
Definition: MSTransportable.h:219
MSTransportable::getWaitingTime
SUMOTime getWaitingTime() const
Definition: MSTransportable.cpp:920
MSTransportable::Stage_Waiting::getStageSummary
std::string getStageSummary() const
return string summary of the current stage
Definition: MSTransportable.cpp:475
MSTransportable::getFromEdge
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSTransportable.h:633
MSTransportable::Stage_Trip::getStageDescription
std::string getStageDescription() const
return (brief) string representation of the current stage
Definition: MSTransportable.h:264
MSTransportable::Stage_Waiting::myWaitingDuration
SUMOTime myWaitingDuration
the time the person is waiting
Definition: MSTransportable.h:415
MSTransportable::myVType
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Definition: MSTransportable.h:802
MSTransportable::WAITING_FOR_DEPART
Definition: MSTransportable.h:62
MSTransportable::Stage_Driving::getPosition
Position getPosition(SUMOTime now) const
returns the position of the transportable
Definition: MSTransportable.cpp:538
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:347
MSTransportable::getParameter
const SUMOVehicleParameter & getParameter() const
Definition: MSTransportable.h:603
MSTransportable::getAngle
virtual double getAngle() const
return the current angle of the transportable
Definition: MSTransportable.cpp:719
MSTransportable::Stage::getAngle
virtual double getAngle(SUMOTime now) const =0
returns the angle of the transportable
PositionVector.h
MSTransportable::Stage_Driving::myLines
const std::set< std::string > myLines
the lines to choose from
Definition: MSTransportable.h:515
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:318
MSTransportable::ROADSIDE_OFFSET
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
Definition: MSTransportable.h:795
MSTransportable::replaceVehicleType
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSTransportable.cpp:790
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:650
MSTransportable::getSingularType
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
Definition: MSTransportable.cpp:799
MSTransportable::getCurrentStageDescription
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
Definition: MSTransportable.h:673