48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
72 myWaitingEdge = previous->
getEdge();
78 myVehicle = availableVehicle;
79 myWaitingEdge->removeContainer(container);
86 myWaitingEdge->addContainer(container);
120 mySpeed(speed), myContainerState(0), myCurrentInternalEdge(0) {
131 myRouteStep = myRoute.end() - 1;
134 (*myRouteStep)->addContainer(container);
139 if (myCurrentInternalEdge != 0) {
140 return myCurrentInternalEdge;
148 return myRoute.front();
153 return myRoute.back();
158 return myContainerState->getEdgePos(*
this, now);
163 return myContainerState->getPosition(*
this, now);
168 return myContainerState->getAngle(*
this, now);
178 return myContainerState->getSpeed(*
this);
199 .
writeAttr(
"agent", c.
getID()).writeAttr(
"link", myRoute.front()->getID()).closeTag();
206 .
writeAttr(
"agent", c.
getID()).writeAttr(
"link", myRoute.back()->getID()).closeTag();
212 if (myRouteStep == myRoute.end() - 1) {
213 if (myDestinationStop != 0) {
214 myDestinationStop->addTransportable(container);
221 if (nextInternal == 0) {
223 myCurrentInternalEdge = 0;
225 myCurrentInternalEdge = nextInternal;
250 (*myStep)->proceed(net,
this, time, prior);
262 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
263 (*i)->tripInfoOutput(os);
275 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
276 (*i)->routeOutput(os);
virtual ~MSContainer()
destructor
void addWaiting(const MSEdge *edge, MSTransportable *person)
adds a transportable to the list of transportables waiting for a vehicle on the specified edge ...
SUMOReal getEdgePos(SUMOTime now) const
Returns the offset from the start of the current edge measured in its natural direction.
SUMOReal myDepartPos
the depart position
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 void beginEventOutput(const MSTransportable &c, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
A lane area vehicles can halt at.
virtual void proceed(MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous)
proceeds to the next step
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
The departure is container triggered.
MSContainerStage_Tranship(const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos)
constructor
virtual const MSEdge * getEdge() const =0
Returns the current edge.
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
~MSContainerStage_Tranship()
destructor
virtual SUMOReal getEdgePos(SUMOTime now) const =0
std::string time2string(SUMOTime t)
const MSEdge * getEdge() const
Returns the current edge.
MSContainerStage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const SUMOReal arrivalPos, const std::vector< std::string > &lines)
constructor
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
returns the id of the transportable
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines, const SUMOReal position, const std::string ridingID)
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles to a given edge.
virtual bool proceed(MSNet *net, SUMOTime time)=0
MSTransportablePlan::iterator myStep
the iterator over the route
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
The simulated network and simulation perfomer.
~MSContainerStage_Driving()
destructor
The car-following model and parameter.
virtual void erase(MSTransportable *transportable)
removes a single transportable
SUMOTime getDesiredDepart() const
Returns the desired departure time.
CState * add(MSTransportable *container, MSContainer::MSContainerStage_Tranship *stage, SUMOTime now)
register the given container as a transhiped container
virtual MSTransportableControl & getContainerControl()
Returns the container control.
void unregisterOneWaitingForContainer()
decreases the count of vehicles waiting for a container to allow recogniztion of container related de...
static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
std::vector< const MSEdge * > myRoute
The route of the container.
virtual void addContainer(MSTransportable *container)=0
Adds a container to this vehicle.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
const MSLane & getLane() const
Returns the lane this stop is located at.
const MSEdge * getEdge() const
Returns the current edge.
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Representation of a vehicle.
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
A point in 2D or 3D with translation and scaling methods.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Position getPosition(SUMOTime now) const
Returns the position of the container.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOReal getSpeed() const
Returns the speed of the container.
virtual void endEventOutput(const MSTransportable &c, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
const MSEdge * getFromEdge() const
Returns first edge of the containers route.
bool moveToNextEdge(MSTransportable *container, SUMOTime currentTime, MSEdge *nextInternal=0)
move forward and return whether the container arrived
const MSEdge & getDestination() const
Returns the current destination.
virtual void proceed(MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous)
proceeds to the next step
std::string getStageDescription() const
returns the stage description as a string
const MSEdge * getFromEdge() const
Returns the departure edge.
Structure representing possible vehicle parameter.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
virtual bool proceed(MSNet *net, SUMOTime time)
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Static storage of an output device and its base (abstract) implementation.
SUMOTime getWaitingTime(SUMOTime now) const
Returns the time the container spent waiting.
bool closeTag()
Closes the most recently opened tag.
MSTransportablePlan * myPlan
the plan of the transportable
MSContainer(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
const MSEdge * getToEdge() const
Returns last edge of the containers route.
SUMOReal getAngle(SUMOTime now) const
Returns the angle of the container.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
static MSCModel_NonInteracting * getModel()
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.