49 MSStoppingPlace* toStop,
const double arrivalPos,
const std::vector<std::string>& lines) :
52 arrivalPos, destination->getLength(),
SUMO_ATTR_ARRIVALPOS,
"container getting transported to " + destination->getID()),
101 "transported to " + dest;
127 if (withRouteLength) {
140 double departPos,
double arrivalPos) :
143 "container getting transhipped to " + route.back()->
getID()),
145 mySpeed(speed), myContainerState(nullptr), myCurrentInternalEdge(nullptr) {
148 "container getting transhipped from " +
myRoute.front()->getID());
168 (*myRouteStep)->addContainer(container);
249 if (withRouteLength) {
281 if (nextInternal ==
nullptr) {
297 return "transhipped to " + dest;
320 (*myStep)->proceed(net,
this, time, prior);
335 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
336 (*i)->tripInfoOutput(os,
this);
348 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
349 (*i)->routeOutput(os, withRouteLength);
Position getPosition(SUMOTime now) const
Returns the position of the container.
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 ...
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
MSEdge & getEdge() const
Returns the lane's edge.
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
virtual void setArrived(MSNet *net, MSTransportable *transportable, SUMOTime now)
logs end of the step
MSContainerStage_Tranship(const std::vector< const MSEdge *> &route, MSStoppingPlace *toStop, double speed, double departPos, double arrivalPos)
constructor
A lane area vehicles can halt at.
std::vector< const MSEdge * >::iterator myRouteStep
current step
ConstMSEdgeVector getEdges() const
the edges of the current stage
virtual void proceed(MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous)
proceeds to the next step
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
The departure is container triggered.
const MSEdge * getDestination() const
returns the destination edge
const MSEdge * getToEdge() const
Returns last edge of the containers route.
virtual const MSEdge * getEdge() const
Returns the current edge.
~MSContainerStage_Tranship()
destructor
virtual double getEdgePos(SUMOTime now) const
std::string time2string(SUMOTime t)
MSContainer(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const MSEdge * getFromEdge() const
Returns first edge of the containers route.
const std::set< std::string > myLines
the lines to choose from
std::vector< const MSEdge * > ConstMSEdgeVector
virtual bool proceed(MSNet *net, SUMOTime time)=0
double myDepartPos
the depart position
double getEdgePos(SUMOTime now) const
Returns the offset from the start of the current edge measured in its natural direction.
const std::string & getID() const
Returns the id.
const MSEdge * myDestination
the next edge to reach by getting transported
MSStoppingPlace * myDestinationStop
the stop to reach by getting transported (if any)
MSTransportablePlan::iterator myStep
the iterator over the route
const MSEdge * getFromEdge() const
virtual void endEventOutput(const MSTransportable &c, SUMOTime t, OutputDevice &os) const
Called for writing the events output (end of an action)
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
The simulated network and simulation perfomer.
~MSContainerStage_Driving()
destructor
The car-following model and parameter.
virtual void erase(MSTransportable *transportable)
removes a single transportable
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
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.
std::vector< const MSEdge * > myRoute
The route of the container.
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
virtual void addContainer(MSTransportable *container)=0
Adds a container to this vehicle.
SUMOTime myWaitingSince
The time since which this person is waiting for a ride.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
SUMOTime myArrived
the time at which this stage ended
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
void setVehicle(SUMOVehicle *v)
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
double mySpeed
the speed of the container
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
std::string myVehicleID
cached vehicle data for output after the vehicle has been removed
virtual void routeOutput(OutputDevice &os, const bool withRouteLength) const
Called on writing vehroute output.
const std::string & getID() const
returns the id of the transportable
SUMOVehicle * myVehicle
The taken vehicle.
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
CState * myContainerState
state that is to be manipulated by MSCModel
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
double getAngle(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the direction in which the container heading to
bool moveToNextEdge(MSTransportable *container, SUMOTime currentTime, MSEdge *nextInternal=0)
move forward and return whether the container arrived
bool addTransportable(MSTransportable *p)
adds a transportable to this stop
virtual void proceed(MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous)
proceeds to the next step
virtual void beginEventOutput(const MSTransportable &c, SUMOTime t, OutputDevice &os) const
Called for writing the events output.
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
MSContainerStage_Driving(const MSEdge *destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines)
constructor
Structure representing possible vehicle parameter.
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const MSEdge *const edge, const double position)
std::string getStageSummary() const
return string summary of the current stage
std::string getStageDescription() const
returns the stage description as a string
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
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)
SUMOTime getWaitingTime(SUMOTime now) const
Returns the time the container spent waiting.
double getDistance() const
get travel distance in this stage
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
virtual void tripInfoOutput(OutputDevice &os, const MSTransportable *const transportable) const
Called on writing tripinfo output.
MSTransportablePlan * myPlan
the plan of the transportable
const MSEdge * getEdge() const
Returns the current edge.
const MSEdge * myWaitingEdge
double getSpeed(const MSContainer::MSContainerStage_Tranship &stage) const
return the current speed of the container
const MSLane & getLane() const
Returns the lane this stop is located at.
Position getPosition(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the network coordinate of the container
double getEdgePos(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the offset from the start of the current edge measured in its natural direction ...
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
double getSpeed() const
Returns the speed of the container.
void unregisterOneWaiting(const bool isPerson)
decreases the count of vehicles waiting for a transport to allow recognition of person / container re...
static MSCModel_NonInteracting * getModel()
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string getStageSummary() const
return string summary of the current stage
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
void removeWaiting(const MSEdge *const edge, const SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles for the given edge.
double getAngle(SUMOTime now) const
Returns the angle of the container.
double myArrivalPos
the position at which we want to arrive
MSEdge * myCurrentInternalEdge
The current internal edge this container is on or 0.