19 #ifndef MSTransportable_h 20 #define MSTransportable_h 130 virtual bool isWaitingFor(
const std::string& line)
const;
146 virtual double getSpeed()
const = 0;
219 double pos,
const std::string& actType,
const bool initial);
245 return "waiting (" + myActType +
")";
304 const double arrivalPos,
const std::vector<std::string>& lines);
329 std::string getWaitingDescription()
const;
400 const std::string&
getID()
const;
418 return (*myStep)->getDestination();
423 return (*(
myStep + 1))->getDestination();
428 return (*myStep)->getEdge();
433 return (*myStep)->getFromEdge();
458 return (*myStep)->getStageType();
463 assert(
myStep + next < myPlan->end());
470 return (*myStep)->getStageDescription();
480 assert(
myStep + next < myPlan->end());
507 return (*myStep)->isWaitingFor(line);
512 return (*myStep)->isWaiting4Vehicle();
517 return (*myStep)->getVehicle();
531 return myPlan->back()->getArrivalPos();
536 return myPlan->back()->getEdges().back();
virtual void setArrived(SUMOTime now)
logs end of the step
std::string myActType
The type of activity.
virtual void beginEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (begin of an action)
virtual double getAngle(SUMOTime now) const =0
returns the angle of the transportable
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StageType getStageType() const
A lane area vehicles can halt at.
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
std::vector< const MSEdge * > ConstMSEdgeVector
const SUMOVehicleParameter & getParameter() const
virtual const MSEdge * getEdge() const =0
Returns the current edge.
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual void abort(MSTransportable *)
abort this stage (TraCI)
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Stage & operator=(const Stage &)
Invalidated assignment operator.
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
Position getEdgePosition(const MSEdge *e, double at, double offset) const
get position on edge e at length at with orthogonal offset
double getArrivalPos() const
const std::set< std::string > myLines
the lines to choose from
const std::string & getID() const
returns the id of the transportable
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
std::vector< const MSEdge * > ConstMSEdgeVector
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
MSTransportablePlan::iterator myStep
the iterator over the route
SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
std::string myVehicleLine
The simulated network and simulation perfomer.
The car-following model and parameter.
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
SUMOTime getDesiredDepart() const
Returns the desired departure time.
const SUMOVehicleParameter * myParameter
the plan of the transportable
void removeStage(int next)
removes the nth next stage
bool myWriteEvents
Whether events shall be written.
const MSEdge & getDestination() const
returns the destination edge
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual Position getPosition(SUMOTime now) const =0
returns the position of the transportable
PositionVector getBoundingBox() const
return the bounding box of the person
const MSVehicleType & getVehicleType() const
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
SUMOTime myArrived
the time at which this stage ended
const MSEdge * getEdge() const
Returns the current edge.
SUMOTime myDeparted
the time at which this stage started
Representation of a vehicle.
virtual bool isWaitingFor(const std::string &line) const
Whether the transportable waits for a vehicle of the line specified.
MSStoppingPlace *const myDestinationStop
the stop to reach by getting transported (if any)
virtual double getEdgePos(SUMOTime now) const =0
A point in 2D or 3D with translation and scaling methods.
StageType getCurrentStageType() const
the current stage type of the transportable
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
proceeds to this stage
virtual ~MSTransportable()
destructor
std::string myVehicleID
cached vehicle data for output after the vehicle has been removed
SUMOTime myWaitingUntil
the time until the person is waiting
SUMOVehicle * myVehicle
The taken vehicle.
SUMOVehicleClass myVehicleVClass
virtual std::string getStageDescription() const =0
return string representation of the current stage
std::string getStageDescription() const
return string representation of the current stage
const MSEdge & getDestination() const
Returns the current destination.
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
const MSEdge * getFromEdge() const
Returns the departure edge.
StageType myType
The type of this stage.
Structure representing possible vehicle parameter.
MSTransportable(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
virtual SUMOTime getWaitingTime(SUMOTime now) const =0
the time this transportable spent waiting
virtual void endEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (end of an action)
bool isWaitingFor(const std::string &line) const
Whether the transportable waits for a vehicle of the line specified.
StageType getStageType(int next) const
the stage type for the nth next stage
virtual double getSpeed() const =0
the speed of the transportable
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
const MSEdge & getNextDestination() const
Returns the destination after the current destination.
double getArrivalPos() const
returns the final arrival pos
Static storage of an output device and its base (abstract) implementation.
void setDeparted(SUMOTime now)
logs end of the step
int getNumStages() const
Return the total number stages in this persons plan.
MSTransportablePlan * myPlan
the plan of the transportable
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
const MSEdge * myWaitingEdge
virtual ConstMSEdgeVector getEdges() const =0
the edges of the current stage
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
virtual ~Stage()
destructor
Stage(const MSEdge &destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
virtual void routeOutput(OutputDevice &os) const =0
Called on writing vehroute output.
const MSEdge & myDestination
the next edge to reach by getting transported
Representation of a lane in the micro simulation.
const MSEdge * getArrivalEdge() const
returns the final arrival edge
virtual void tripInfoOutput(OutputDevice &os, MSTransportable *transportable) const =0
Called on writing tripinfo output.
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
SUMOTime myWaitingDuration
the time the person is waiting
double myArrivalPos
the position at which we want to arrive
virtual const MSEdge * getFromEdge() const =0