42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
58 : myDestination(destination), myDestinationStop(toStop), myArrivalPos(arrivalPos), myDeparted(-1), myArrived(-1), myType(type) {}
87 return getLanePosition(e->
getLanes()[0], at, offset);
97 return e->
getLanes()[0]->getShape().rotationAtOffset(at);
106 const bool initial) :
110 myWaitingDuration(duration),
111 myWaitingUntil(until),
121 return &myDestination;
127 return &myDestination;
139 return myWaitingUntil;
151 return getEdgeAngle(&myDestination, myArrivalPos) +
M_PI / 2;
157 myWaitingStart = now;
158 const SUMOTime until =
MAX3(now, now + myWaitingDuration, myWaitingUntil);
159 if (dynamic_cast<MSPerson*>(transportable) != 0) {
181 if (myWaitingDuration >= 0) {
184 if (myWaitingUntil >= 0) {
208 return now - myWaitingStart;
225 myVehicle(0), myStopWaitPos(
Position::INVALID) {}
233 if (myVehicle != 0) {
234 return myVehicle->getEdge();
236 return myWaitingEdge;
242 return myWaitingEdge;
260 return myStopWaitPos;
264 return myVehicle->getPosition();
278 return getEdgeAngle(myWaitingEdge, myWaitingPos) +
M_PI / 2.;
284 return myLines.count(line) > 0;
290 return myVehicle == 0;
329 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
350 (*myStep)->setDeparted(now);
375 return (*myStep)->getSpeed();
virtual void proceed(MSNet *net, MSTransportable *transportable, SUMOTime now, Stage *previous)
proceeds to the next step
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
Representation of a vehicle in the micro simulation.
SUMOReal getSpeed() const
the speed of the transportable
A lane area vehicles can halt at.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Stage(const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, StageType type)
constructor
virtual SUMOReal getWaitingSeconds() const
the time this transportable spent waiting in seconds
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
virtual const MSEdge * getEdge() const =0
Returns the current edge.
SUMOTime getUntil() const
SUMOReal getAngle(SUMOTime now) const
returns the angle 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
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
returns the id of the transportable
virtual SUMOReal getEdgePos() const
Return the position on the edge.
SUMOReal getAngle(SUMOTime now) const
returns the angle of the transportable
MSTransportablePlan::iterator myStep
the iterator over the route
virtual SUMOReal getAngle() const
return the current angle of the transportable
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSTransportable(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
SUMOReal getEdgeAngle(const MSEdge *e, SUMOReal at) const
get angle of the edge at a certain position
The simulated network and simulation perfomer.
The car-following model and parameter.
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
const MSEdge & getDestination() const
returns the destination edge
Stage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, const std::vector< std::string > &lines)
constructor
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
Position getLanePosition(const MSLane *lane, SUMOReal at, SUMOReal offset) const
get position on lane at length at with orthogonal offset
SUMOReal getLength() const
return the length of the edge
Position getEdgePosition(const MSEdge *e, SUMOReal at, SUMOReal offset) const
get position on edge e at length at with orthogonal offset
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.
static const SUMOReal ROADSIDE_OFFSET
the offset for computing positions when standing at an edge
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.
SUMOReal getEdgePos(SUMOTime now) const
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.
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.
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
virtual ~MSTransportable()
destructor
SUMOTime depart
The vehicle's departure time.
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
Stage_Waiting(const MSEdge &destination, SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string &actType, const bool initial)
constructor
Position getPosition(SUMOTime now) const
returns the position of the transportable
virtual ~Stage_Driving()
destructor
virtual void endEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
const MSEdge & getDestination() const
Returns the current destination.
SUMOTime getWaitingTime(SUMOTime now) const
time spent waiting for a ride
SUMOReal getEdgePos(SUMOTime now) const
virtual SUMOReal getSpeed() const
the current speed of the transportable
Structure representing possible vehicle parameter.
SUMOReal getSpeed() const
the speed of the transportable
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
virtual void beginEventOutput(const MSTransportable &p, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
const MSEdge * getFromEdge() const
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
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
virtual ~Stage()
destructor
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.
std::string id
The vehicle's id.
static const Position INVALID
SUMOReal getAngle() const
Returns the vehicle's direction in radians.