56 MSStoppingPlace* toStop,
const double arrivalPos,
const std::vector<std::string>& lines) :
59 arrivalPos, destination.getLength(),
SUMO_ATTR_ARRIVALPOS,
"container getting transported to " + destination.getID()),
124 double departPos,
double arrivalPos) :
127 mySpeed(speed), myContainerState(0), myCurrentInternalEdge(0) {
142 (*myRouteStep)->addContainer(container);
239 if (nextInternal == 0) {
268 (*myStep)->proceed(net,
this, time, prior);
280 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
281 (*i)->tripInfoOutput(os);
293 for (MSTransportablePlan::const_iterator i =
myPlan->begin(); i !=
myPlan->end(); ++i) {
294 (*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 ...
double getSpeed() const
Returns the speed of the container.
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.
A lane area vehicles can halt at.
std::vector< const MSEdge * >::iterator myRouteStep
current step
virtual void proceed(MSNet *net, MSTransportable *container, SUMOTime now, Stage *previous)
proceeds to the next step
The departure is container triggered.
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
const MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
~MSContainerStage_Tranship()
destructor
bool isWaiting4Vehicle() const
Whether the person waits for a vehicle.
std::string time2string(SUMOTime t)
const MSEdge * getEdge() const
Returns the current edge.
MSContainer(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan)
constructor
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::set< std::string > myLines
the lines to choose from
const std::string & getID() const
returns the id of the transportable
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles to a given edge.
std::vector< const MSEdge * > ConstMSEdgeVector
virtual bool proceed(MSNet *net, SUMOTime time)=0
double myDepartPos
the depart position
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
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
void addTransportable(MSTransportable *p)
adds a transportable to this stop
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...
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 ...
const MSEdge & getDestination() const
returns the destination edge
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.
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.
const MSEdge * getFromEdge() const
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.
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
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
Representation of a vehicle.
MSStoppingPlace *const myDestinationStop
the stop to reach by getting transported (if any)
virtual void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
A point in 2D or 3D with translation and scaling methods.
void setVehicle(SUMOVehicle *v)
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
double getEdgePos(SUMOTime now) const
Returns the offset from the start of the current edge measured in its natural direction.
Position getPosition(SUMOTime now) const
Returns the position of the container.
double mySpeed
the speed of the container
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines, const double position, const std::string ridingID)
double getAngle(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the direction in which the container heading to
SUMOVehicle * myVehicle
The taken vehicle.
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.
CState * myContainerState
state that is to be manipulated by MSCModel
bool moveToNextEdge(MSTransportable *container, SUMOTime currentTime, MSEdge *nextInternal=0)
move forward and return whether the container arrived
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
Structure representing possible vehicle parameter.
virtual const MSEdge * getEdge() const =0
Returns the current edge.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Position getPosition(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the network coordinate of the container
virtual bool proceed(MSNet *net, SUMOTime time)
MSContainerStage_Tranship(const std::vector< const MSEdge * > &route, MSStoppingPlace *toStop, double speed, double departPos, double arrivalPos)
constructor
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
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.
MSContainerStage_Driving(const MSEdge &destination, MSStoppingPlace *toStop, const double arrivalPos, const std::vector< std::string > &lines)
constructor
MSTransportablePlan * myPlan
the plan of the transportable
const MSEdge * myWaitingEdge
const MSEdge * getToEdge() const
Returns last edge of the containers route.
virtual void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
double getAngle(SUMOTime now) const
Returns the angle of the container.
static MSCModel_NonInteracting * getModel()
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
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.
virtual double getEdgePos(SUMOTime now) const =0
ConstMSEdgeVector getEdges() const
the edges of the current stage
double myArrivalPos
the position at which we want to arrive
double getSpeed(const MSContainer::MSContainerStage_Tranship &stage) const
return the current speed of the container
MSEdge * myCurrentInternalEdge
The current internal edge this container is on or 0.