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);
379 return "waiting (" + myActType +
")";
440 const double arrivalPos,
const std::vector<std::string>& lines,
441 const std::string& intendedVeh =
"",
SUMOTime intendedDepart = -1);
461 return myVehicleDistance;
471 std::string getWaitingDescription()
const;
506 return myIntendedVehicleID;
510 return myIntendedDepart;
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 {
double getAcceleration() const
Returns the vehicle's acceleration.
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
Stage(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
double getDistance() const
get travel distance in this stage
double getPositionOnLane() const
Get the vehicle's position along the lane.
std::string myActType
The type of activity.
virtual const MSEdge * getFromEdge() const
double getArrivalPos() const
returns the final arrival pos
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
virtual double getDistance() const =0
get travel distance in this stage
double getMaxSpeed() const
Returns the vehicle's maximum speed.
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 std::vector< MSTransportableDevice * > & getDevices() const
Returns this vehicle's devices.
const MSEdge * getEdge() const
Returns the current edge.
const SVCPermissions myModeSet
The allowed modes of transportation.
A lane area vehicles can halt at.
double getPreviousSpeed() const
Returns the vehicle's previous speed.
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
const MSEdge * getDestination() const
returns the destination edge
const std::set< std::string > & getLines() const
virtual const MSEdge * getEdge() const
Returns the current edge.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
virtual double getEdgePos(SUMOTime now) const
double getSlope() const
Returns the slope of the road at vehicle's position.
virtual void abort(MSTransportable *)
abort this stage (TraCI)
virtual Stage * clone() const =0
Stage & operator=(const Stage &)
Invalidated assignment operator.
std::string myIntendedVehicleID
virtual void setSpeed(double)
sets the walking speed (ignored in other stages)
double getDistance() const
get travel distance in this stage
bool isVehicle() const
Get the vehicle's ID.
const std::set< std::string > myLines
the lines to choose from
double getDistance() const
get travel distance in this stage
std::vector< const MSEdge * > ConstMSEdgeVector
SUMOTime myDuration
the time the trip should take (applies to only walking)
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
double getChosenSpeedFactor() const
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
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
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.
double myDepartPos
The depart position.
const double myWalkFactor
The factor to apply to walking durations.
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.
std::vector< MSTransportableDevice * > myDevices
The devices this transportable has.
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
bool hasDeparted() const
return whether the transportable has started it's plan
SUMOTime getDeparted() const
get departure time of stage
virtual ~MSTransportable()
destructor
Abstract in-person device.
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
const double mySpeed
The walking speed.
SUMOTime myWaitingUntil
the time until the person is waiting
SUMOVehicle * myVehicle
The taken vehicle.
SUMOVehicleClass myVehicleVClass
std::string getIntendedVehicleID() const
virtual std::string getStageDescription() const =0
return (brief) string representation of the current stage
std::string getStageDescription() const
return (brief) string representation of the current stage
const MSEdge * getNextDestination() const
Returns the destination after the current destination.
SUMOTime myIntendedDepart
virtual const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
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.
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const =0
Called on writing tripinfo output.
Representation of a vehicle or person.
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)
void setOrigin(const MSEdge *origin)
change origin for parking area rerouting
MSTransportableDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
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
const MSEdge * myOrigin
the origin 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.
double getBackPositionOnLane(const MSLane *) const
Get the vehicle's back position along the given lane.
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const =0
Called on writing vehroute output.
virtual std::string getStageSummary() const =0
return string summary of the current stage
const std::string myVTypes
The possible vehicles to use.
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
virtual bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Static storage of an output device and its base (abstract) implementation.
Position getPosition(const double) const
Return current position (x/y, cartesian)
void setDeparted(SUMOTime now)
logs end of the step
const double myDepartPosLat
The lateral depart position.
virtual bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
bool isStopped() const
Returns whether the vehicle is at a stop.
const MSEdge * getDestination() const
Returns the current destination.
MSTransportablePlan * myPlan
the plan of the transportable
const MSEdge * myWaitingEdge
virtual ~Stage()
destructor
const bool myHaveArrivalPos
whether an arrivalPos was in the input
const MSStoppingPlace * myOriginStop
the origin edge
SUMOTime getIntendedDepart() const
Representation of a lane in the micro simulation.
const MSStoppingPlace * getOriginStop() const
returns the origin stop (if any). only needed for Stage_Trip
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
bool isWaitingFor(const SUMOVehicle *vehicle) const
Whether the transportable waits for the given vehicle in the current step.
StageType getCurrentStageType() const
the current stage type of the transportable
void setDestination(const MSEdge *newDestination, MSStoppingPlace *newDestStop)