42 #ifdef CHECK_MEMORY_LEAKS 44 #endif // CHECK_MEMORY_LEAKS 74 const std::string&
id = container->
getID();
88 const std::map<std::string, MSTransportable*>::iterator i =
myContainers.find(
id);
121 for (
size_t i = 0; i < containers.size(); ++i) {
122 if (!containers[i]->proceed(net, time)) {
123 erase(containers[i]);
131 for (
size_t i = 0; i < containers.size(); ++i) {
132 if (!containers[i]->proceed(net, time)) {
133 erase(containers[i]);
161 for (ContainerVector::iterator i = waitContainers.begin(); i != waitContainers.end();) {
166 && stop->
startPos <= (*i)->getEdgePos() && (*i)->getEdgePos() <= stop->
endPos) {
172 if (loadingDuration >= stop->
duration) {
179 i = waitContainers.erase(i);
185 if (waitContainers.size() == 0) {
212 std::map<std::string, MSTransportable*>::iterator i =
myTranship.find(c->
getID());
222 const MSEdge* edge = (*i).first;
224 for (ContainerVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
227 WRITE_WARNING(
"Container '" + p->
getID() +
"' aborted waiting for a transport that will never come.");
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
std::map< SUMOTime, ContainerVector > myWaiting4Departure
Containers waiting for departure.
Representation of a vehicle in the micro simulation.
void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
virtual MSContainer * buildContainer(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
Builds a new container.
SUMOTime getLoadingDuration() const
Get this vehicle type's loading duration.
void addContainer(MSTransportable *container)
Adds a container.
std::map< std::string, MSTransportable * > myTranship
all containers being transhiped
void abortWaiting()
aborts the plan for any container that is still waiting for a ride
std::string time2string(SUMOTime t)
void addWaiting(const MSEdge *edge, MSTransportable *container)
adds a container to the list of containers waiting for a vehicle on the specified edge ...
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getID() const
returns the id of the transportable
void setDeparture(SUMOTime time, MSTransportable *container)
sets the arrival time for a waiting container
Definition of vehicle stop (position and duration)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
#define WRITE_WARNING(msg)
The simulated network and simulation perfomer.
The car-following model and parameter.
static OptionsCont & getOptions()
Retrieves the options.
SUMOTime getDesiredDepart() const
Returns the desired departure time.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
std::vector< MSTransportable * > ContainerVector
void setWaitEnd(SUMOTime time, MSTransportable *container)
sets the arrival time for a waiting container
unsigned int getContainerNumber() const
Returns the number of containers.
bool loadAnyWaiting(MSEdge *edge, MSVehicle *vehicle, MSVehicle::Stop *stop)
load any applicable containers Loads any container that is waiting on that edge for the given vehicle...
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
virtual void routeOutput(OutputDevice &os) const =0
Called on writing vehroute output.
void setTranship(MSTransportable *c)
adds a container to myTranship
SUMOTime duration
The stopping duration.
std::string line
The vehicle's line (mainly for public transport)
MSContainerControl()
constructor
Structure representing possible vehicle parameter.
bool add(const std::string &id, MSTransportable *container)
adds a single container, returns false if an id clash occured
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
void unsetTranship(MSTransportable *c)
removes a container from myTranship
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
std::map< std::string, MSTransportable * > myContainers
all containers by id
std::map< SUMOTime, ContainerVector > myWaitingUntil
the lists of walking / stopping containers
SUMOReal endPos
The stopping position end.
std::map< const MSEdge *, ContainerVector > myWaiting4Vehicle
the lists of waiting containers
unsigned int getContainerCapacity() const
Get this vehicle type's container capacity.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
bool hasNonWaiting() const
checks whether any container is still engaged in walking / stopping
SUMOReal startPos
The stopping position start.
virtual void erase(MSTransportable *container)
removes a single container
bool hasContainers() const
checks whether any container waits to finish her plan
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void checkWaitingContainers(MSNet *net, const SUMOTime time)
checks whether any containers waiting time is over
std::string id
The vehicle's id.
virtual ~MSContainerControl()
destructor