 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
17 #ifndef MSTransportable_h
18 #define MSTransportable_h
239 const std::string& vTypes,
const double speed,
const double walkFactor,
240 const double departPosLat,
const bool hasArrivalPos,
const double arrivalPos);
354 double pos,
const std::string& actType,
const bool initial);
440 const double arrivalPos,
const std::vector<std::string>& lines,
441 const std::string& intendedVeh =
"",
SUMOTime intendedDepart = -1);
601 const std::string&
getID()
const;
619 return (*myStep)->getDestination();
624 return (*(
myStep + 1))->getDestination();
629 return (*myStep)->getEdge();
634 return (*myStep)->getFromEdge();
659 return (*myStep)->getStageType();
664 assert(
myStep + next < myPlan->end());
674 return (*myStep)->getStageDescription();
685 assert(
myStep + next < myPlan->end());
691 assert(
myStep + next < myPlan->end());
718 return (*myStep)->isWaitingFor(vehicle);
723 return (*myStep)->isWaiting4Vehicle();
728 return (*myStep)->getVehicle();
742 return myPlan->back()->getArrivalPos();
747 return myPlan->back()->getEdges().back();
789 inline const std::vector<MSTransportableDevice*>&
getDevices()
const {
void setDeparted(SUMOTime now)
logs end of the step
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
The car-following model and parameter.
const double myDepartPosLat
The lateral depart position.
virtual const MSEdge * getFromEdge() const
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Stage_Driving & operator=(const Stage_Driving &)
Invalidated assignment operator.
std::string getStageDescription() const
return (brief) string representation of the current stage
Stage_Trip & operator=(const Stage_Trip &)
Invalidated assignment operator.
Representation of a vehicle or person.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the person waits for the given vehicle.
ConstMSEdgeVector getEdges() const
the edges of the current stage
virtual Stage * clone() const =0
Stage & operator=(const Stage &)
Invalidated assignment operator.
A lane area vehicles can halt at.
bool hasDeparted() const
return whether the transportable has started it's plan
double getDistance() const
get travel distance in this stage
const MSEdge * myWaitingEdge
std::string myIntendedVehicleID
const MSEdge * myOrigin
the origin edge
const MSStoppingPlace * myOriginStop
the origin edge
const MSEdge * getDestination() const
Returns the current destination.
double myArrivalPos
the position at which we want to arrive
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
const MSEdge * getEdge() const
Returns the current edge.
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
const std::string myVTypes
The possible vehicles to use.
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Representation of a lane in the micro simulation.
Stage(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
Static storage of an output device and its base (abstract) implementation.
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
const MSEdge * getArrivalEdge() const
returns the final arrival edge
const bool myHaveArrivalPos
whether an arrivalPos was in the input
const MSEdge * myDestination
the next edge to reach by getting transported
double myDepartPos
The depart position.
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
bool isStopped() const
Returns whether the vehicle is at a stop.
std::string myVehicleLine
virtual double getDistance() const =0
get travel distance in this stage
const SUMOVehicleParameter * myParameter
the plan of the transportable
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
void setDestination(const MSEdge *newDestination, MSStoppingPlace *newDestStop)
virtual ~MSTransportable()
destructor
The simulated network and simulation perfomer.
bool myWriteEvents
Whether events shall be written.
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
const MSEdge * getNextDestination() const
Returns the destination after the current destination.
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
Representation of a vehicle.
const std::vector< MSTransportableDevice * > & getDevices() const
Returns this vehicle's devices.
std::vector< const MSEdge * > ConstMSEdgeVector
double getDistance() const
get travel distance in this stage
const double myWalkFactor
The factor to apply to walking durations.
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
virtual double getEdgePos(SUMOTime now) const
Structure representing possible vehicle parameter.
const MSEdge * getEdge() const
Returns the current edge.
virtual bool proceed(MSNet *net, SUMOTime time)=0
SUMOTime myIntendedDepart
StageType getStageType(int next) const
the stage type for the nth next stage
StageType getCurrentStageType() const
the current stage type of the transportable
const MSEdge * getDestination() const
returns the destination edge
virtual const MSEdge * getEdge() const
Returns the current edge.
MSTransportableDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
proceeds to this stage
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
virtual ~Stage_Trip()
destructor
void abort(MSTransportable *)
abort this stage (TraCI)
virtual SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
void setDeparted(SUMOTime now)
logs depart time of the current stage
double getPositionOnLane() const
Get the vehicle's position along the lane.
virtual void abort(MSTransportable *)
abort this stage (TraCI)
SUMOTime getUntil() const
std::string myActType
The type of activity.
double getAngle(SUMOTime now) const
returns the angle of the transportable
const MSEdge * getEdge() const
Returns the current edge.
const std::set< std::string > & getLines() const
double getAngle(SUMOTime now) const
returns the angle of the transportable
SUMOTime myDeparted
the time at which this stage started
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
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
virtual std::string getStageDescription() const =0
return (brief) string representation of the current stage
void setVehicle(SUMOVehicle *v)
MSTransportable(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
SUMOTime myDuration
the time the trip should take (applies to only walking)
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
double getSpeed() const
the speed of the transportable
SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
int getNumStages() const
Return the total number stages in this persons plan.
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
double getMaxSpeed() const
Returns the vehicle's maximum speed.
Stage_Waiting & operator=(const Stage_Waiting &)
Invalidated assignment operator.
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
Stage_Waiting(const MSEdge *destination, MSStoppingPlace *toStop, SUMOTime duration, SUMOTime until, double pos, const std::string &actType, const bool initial)
constructor
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
double getEdgePos(SUMOTime now) const
virtual Position getPosition(SUMOTime now) const =0
returns the position of the transportable
const MSEdge * getFromEdge() const
virtual ~Stage_Driving()
destructor
SUMOTime myArrived
the time at which this stage ended
double getAngle(SUMOTime now) const
returns the angle of the transportable
double getDistance() const
get travel distance in this stage
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
double getBackPositionOnLane(const MSLane *) const
Get the vehicle's back position along the given lane.
Stage_Driving(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines, const std::string &intendedVeh="", SUMOTime intendedDepart=-1)
constructor
A point in 2D or 3D with translation and scaling methods.
void rerouteParkingArea(MSStoppingPlace *orig, MSStoppingPlace *replacement)
adapt plan when the vehicle reroutes and now stops at replacement instead of orig
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
marks arrival time and records driven distance
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const =0
Called on writing tripinfo output.
MSTransportable & operator=(const MSTransportable &)
Invalidated assignment operator.
A road/street connecting two junctions.
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
Position getPosition(const double) const
Return current position (x/y, cartesian)
double getSlope() const
Returns the slope of the road at vehicle's position.
virtual const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
SUMOTime getDeparted() const
get departure time of stage
virtual double getSpeed() const
the speed of the transportable
StageType getStageType() const
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
Abstract in-person device.
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
bool isVehicle() const
Get the vehicle's ID.
double getArrivalPos() const
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
double getEdgePos(SUMOTime now) const
virtual double getEdgePos() const
Return the position on the edge.
double getAcceleration() const
Returns the vehicle's acceleration.
std::string getStageSummary() const
return string summary of the current stage
virtual void tripInfoOutput(OutputDevice &os) const =0
Called on writing tripinfo output.
std::string myVehicleID
cached vehicle data for output after the vehicle has been removed
virtual bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle.
SUMOVehicleClass myVehicleVClass
std::string getIntendedVehicleID() const
virtual void endEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (end of an action)
PositionVector getBoundingBox() const
return the bounding box of the person
const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
double getPreviousSpeed() const
Returns the vehicle's previous speed.
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
Position getEdgePosition(const MSEdge *e, double at, double offset) const
get position on edge e at length at with orthogonal offset
virtual double getSpeed() const
the current speed of the transportable
Position getPosition(SUMOTime now) const
returns the position of the transportable
double getArrivalPos() const
returns the final arrival pos
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const =0
Called on writing vehroute output.
MSTransportable::Stage * getNextStage(int next) const
Return the current stage.
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
bool hasArrived() const
return whether the person has reached the end of its plan
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
SUMOTime myWaitingUntil
the time until the person is waiting
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
SUMOTime getDesiredDepart() const
Returns the desired departure time.
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
const std::string & getID() const
returns the id of the transportable
double getChosenSpeedFactor() const
std::vector< MSTransportableDevice * > myDevices
The devices this transportable has.
virtual Position getPosition() const
Return the Network coordinate of the transportable.
virtual ~Stage_Waiting()
destructor
std::vector< const MSEdge * > ConstMSEdgeVector
SUMOVehicle * myVehicle
The taken vehicle.
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
virtual ~Stage()
destructor
void abort(MSTransportable *)
abort this stage (TraCI)
MSTransportablePlan::iterator myStep
the iterator over the route
const double mySpeed
The walking speed.
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
std::string getWaitingDescription() const
Return where the person waits and for what.
void removeStage(int next)
removes the nth next stage
SUMOTime getIntendedDepart() const
MSTransportablePlan * myPlan
the plan of the transportable
virtual std::string getStageSummary() const =0
return string summary of the current stage
StageType myType
The type of this stage.
SUMOTime getWaitingTime() const
std::string getStageSummary() const
return string summary of the current stage
const MSEdge * getFromEdge() const
Returns the departure edge.
std::string getStageDescription() const
return (brief) string representation of the current stage
SUMOTime myWaitingDuration
the time the person is waiting
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
const SUMOVehicleParameter & getParameter() const
virtual double getAngle() const
return the current angle of the transportable
virtual double getAngle(SUMOTime now) const =0
returns the angle of the transportable
const std::set< std::string > myLines
the lines to choose from
virtual void beginEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (begin of an action)
const SVCPermissions myModeSet
The allowed modes of transportation.
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const =0
Called on writing vehroute output.
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.