54 : myDestination(destination), myDestinationStop(toStop), myArrivalPos(arrivalPos), myDeparted(-1), myArrived(-1), myType(type) {}
93 return e->
getLanes()[0]->getShape().rotationAtOffset(at);
102 const bool initial) :
106 myWaitingDuration(duration),
107 myWaitingUntil(until),
155 if (dynamic_cast<MSPerson*>(transportable) != 0) {
227 MSStoppingPlace* toStop,
const double arrivalPos,
const std::vector<std::string>& lines)
288 return myLines.count(line) > 0;
351 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
372 (*myStep)->setDeparted(now);
397 return (*myStep)->getSpeed();
408 return (
int)
myPlan->size();
422 assert(
myStep + next < myPlan->end());
435 (*myStep)->abort(
this);
443 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
444 (*i)->setSpeed(speed);
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
double getLength() const
return the length of the edge
bool isWaitingFor(const std::string &line) const
Whether the person waits for a vehicle of the line specified.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void setArrived(SUMOTime now)
logs end of the step
MSEdge & getEdge() const
Returns the lane's edge.
virtual double getAngle() const
return the current angle of the transportable
virtual double getEdgePos() const
Return the position on the edge.
Representation of a vehicle in the micro simulation.
std::string myActType
The type of activity.
double getEdgePos(SUMOTime now) const
double getSpeed() const
the speed of the transportable
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
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
void abort(MSTransportable *)
abort this stage (TraCI)
SUMOTime getUntil() const
double getSpeed() const
the speed of the transportable
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
std::string time2string(SUMOTime t)
void setWaitEnd(SUMOTime time, MSTransportable *transportable)
sets the arrival time for a waiting transportable
double interpolateLanePosToGeometryPos(double lanePos) const
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Stage_Waiting(const MSEdge &destination, SUMOTime duration, SUMOTime until, double pos, const std::string &actType, const bool initial)
constructor
Position getEdgePosition(const MSEdge *e, double at, double offset) const
get position on edge e at length at with orthogonal offset
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
const std::set< std::string > myLines
the lines to choose from
ConstMSEdgeVector getEdges() const
the edges of the current stage
const std::string & getID() const
returns the id of the transportable
double getAngle() const
Returns the vehicle's direction in radians.
std::vector< const MSEdge * > ConstMSEdgeVector
virtual bool proceed(MSNet *net, SUMOTime time)=0
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
MSTransportablePlan::iterator myStep
the iterator over the route
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
double getAngle(SUMOTime now) const
returns the angle of the transportable
MSTransportable(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
The simulated network and simulation perfomer.
The car-following model and parameter.
virtual double getSpeed() const
the current speed of the transportable
SUMOTime getDesiredDepart() const
Returns the desired departure time.
virtual MSTransportableControl & getContainerControl()
Returns the container control.
const SUMOVehicleParameter * myParameter
the plan of the transportable
SUMOTime getWaitingTime(SUMOTime now) const
the time this transportable spent waiting
void removeStage(int next)
removes the nth next stage
const MSEdge & getDestination() const
returns the destination edge
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
const MSEdge * getFromEdge() const
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual double getSpeed() const =0
Returns the vehicle's current speed.
SUMOTime myArrived
the time at which this stage ended
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
const MSEdge * getEdge() const
Returns the current edge.
SUMOTime myDeparted
the time at which this stage started
void setDeparted(SUMOTime now)
logs depart time of the current stage
virtual void addPerson(MSTransportable *p) const
virtual bool isWaitingFor(const std::string &line) const
Whether the transportable waits for a vehicle of the line specified.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
A point in 2D or 3D with translation and scaling methods.
void appendStage(Stage *stage)
Appends the given stage to the current plan.
const MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
const MSEdge * getEdge() const
Returns the current edge.
ConstMSEdgeVector getEdges() const
the edges of the current stage
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
virtual ~MSTransportable()
destructor
SUMOTime depart
The vehicle's departure time.
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual ~Stage_Driving()
destructor
SUMOTime myWaitingUntil
the time until the person is waiting
SUMOVehicle * myVehicle
The taken vehicle.
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
double getEdgePos(SUMOTime now) const
Stage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines)
constructor
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
StageType myType
The type of this stage.
Structure representing possible vehicle parameter.
virtual const MSEdge * getEdge() const =0
Returns the current edge.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
const MSEdge * getFromEdge() const
double getAngle(SUMOTime now) const
returns the angle of the transportable
static const double ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
void replaceVehicleType(MSVehicleType *type)
replace myVType
virtual Position getPosition() const
Return the Network coordinate of the transportable.
const PositionVector & getShape() const
Returns this lane's shape.
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.
bool closeTag()
Closes the most recently opened tag.
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
MSTransportablePlan * myPlan
the plan of the transportable
virtual ~Stage_Waiting()
destructor
Position getPosition(SUMOTime now) const
returns the position of the transportable
const MSEdge * myWaitingEdge
virtual ~Stage()
destructor
Stage(const MSEdge &destination, MSStoppingPlace *toStop, const double arrivalPos, StageType type)
constructor
const MSEdge & myDestination
the next edge to reach by getting transported
const MSEdge * getEdge() const
Returns the current edge.
Representation of a lane in the micro simulation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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
std::string id
The vehicle's id.
static const Position INVALID
used to indicate that a position is valid
double myArrivalPos
the position at which we want to arrive
SUMOTime myWaitingStart
the time the person is waiting