17 #ifndef MSTransportable_h 18 #define MSTransportable_h 128 virtual bool isWaitingFor(
const std::string& line)
const;
217 double pos,
const std::string& actType,
const bool initial);
235 return "waiting (" + myActType +
")";
296 const double arrivalPos,
const std::vector<std::string>& lines,
297 const std::string& intendedVeh =
"",
SUMOTime intendedDepart = -1);
322 std::string getWaitingDescription()
const;
399 const std::string&
getID()
const;
417 return (*myStep)->getDestination();
422 return (*(
myStep + 1))->getDestination();
427 return (*myStep)->getEdge();
432 return (*myStep)->getFromEdge();
457 return (*myStep)->getStageType();
462 assert(
myStep + next < myPlan->end());
472 return (*myStep)->getStageDescription();
483 assert(
myStep + next < myPlan->end());
489 assert(
myStep + next < myPlan->end());
516 return (*myStep)->isWaitingFor(line);
521 return (*myStep)->isWaiting4Vehicle();
526 return (*myStep)->getVehicle();
540 return myPlan->back()->getArrivalPos();
545 return myPlan->back()->getEdges().back();
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
virtual void setArrived(SUMOTime now)
logs end of the step
Stage(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
std::string myActType
The type of activity.
virtual const MSEdge * getFromEdge() const
double getArrivalPos() const
returns the final arrival pos
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...
const MSEdge * getEdge() const
Returns the current edge.
A lane area vehicles can halt at.
std::vector< const MSEdge * > ConstMSEdgeVector
bool hasArrived() const
return whether the person has reached the end of its plan
PositionVector getBoundingBox() const
return the bounding box of the person
virtual bool isWaitingFor(const std::string &line) const
Whether the transportable waits for a vehicle of the line specified.
const MSEdge * getDestination() const
returns the destination edge
virtual const MSEdge * getEdge() const
Returns the current edge.
virtual double getEdgePos(SUMOTime now) const
virtual void abort(MSTransportable *)
abort this stage (TraCI)
Stage & operator=(const Stage &)
Invalidated assignment operator.
std::string myIntendedVehicleID
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
const std::set< std::string > myLines
the lines to choose from
std::vector< const MSEdge * > ConstMSEdgeVector
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
const MSEdge * myDestination
the next edge to reach by getting transported
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
const SUMOVehicleParameter & getParameter() const
MSTransportablePlan::iterator myStep
the iterator over the route
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
std::string myVehicleLine
The simulated network and simulation perfomer.
The car-following model and parameter.
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 * getFromEdge() const
Returns the departure 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 ConstMSEdgeVector getEdges() const
the edges of the current stage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
virtual Position getPosition(SUMOTime now) const =0
returns the position of the transportable
MSTransportable::Stage * getNextStage(int next) const
Return the current stage.
virtual SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
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
SUMOTime myDeparted
the time at which this stage started
Representation of a vehicle.
A point in 2D or 3D with translation and scaling methods.
SUMOTime getDesiredDepart() const
Returns the desired departure time.
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)=0
proceeds to this stage
virtual ~MSTransportable()
destructor
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
double getArrivalPos() const
std::string myVehicleID
cached vehicle data for output after the vehicle has been removed
const std::string & getID() const
returns the id of the transportable
SUMOTime myWaitingUntil
the time until the person is waiting
SUMOVehicle * myVehicle
The taken vehicle.
SUMOVehicleClass myVehicleVClass
virtual std::string getStageDescription() const =0
return (brief) string representation of the current stage
const MSEdge * getNextDestination() const
Returns the destination after the current destination.
SUMOTime myIntendedDepart
bool isWaitingFor(const std::string &line) const
Whether the transportable waits for a vehicle of the line specified.
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 speed of the transportable
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
void rerouteParkingArea(MSStoppingPlace *orig, MSStoppingPlace *replacement)
adapt plan when the vehicle reroutes and now stops at replacement instead of orig ...
std::string getStageDescription() const
return (brief) string representation of the current stage
StageType myType
The type of this stage.
Structure representing possible vehicle parameter.
MSTransportable(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
virtual void endEventOutput(const MSTransportable &transportable, SUMOTime t, OutputDevice &os) const =0
Called for writing the events output (end of an action)
SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
StageType getStageType() const
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
StageType getStageType(int next) const
the stage type for the nth next stage
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
virtual std::string getStageSummary() const =0
return string summary of the current stage
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
const MSEdge * getArrivalEdge() const
returns the final arrival edge
const MSVehicleType & getVehicleType() const
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Static storage of an output device and its base (abstract) implementation.
void setDeparted(SUMOTime now)
logs end of the step
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
const MSEdge * getDestination() const
Returns the current destination.
MSTransportablePlan * myPlan
the plan of the transportable
const MSEdge * myWaitingEdge
virtual ~Stage()
destructor
virtual void routeOutput(OutputDevice &os) const =0
Called on writing vehroute output.
Representation of a lane in the micro simulation.
virtual void tripInfoOutput(OutputDevice &os, MSTransportable *transportable) const =0
Called on writing tripinfo output.
SUMOTime myWaitingDuration
the time the person is waiting
int getNumStages() const
Return the total number stages in this persons plan.
double myArrivalPos
the position at which we want to arrive
StageType getCurrentStageType() const
the current stage type of the transportable