42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
74 const std::string&
id = container->
getID();
88 const std::map<std::string, MSContainer*>::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, MSContainer*>::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 setWaitEnd(SUMOTime time, MSContainer *container)
sets the arrival time for a waiting container
SUMOTime getLoadingDuration() const
Get this vehicle type's loading duration.
void abortWaiting()
aborts the plan for any container that is still waiting for a ride
void addWaiting(const MSEdge *edge, MSContainer *container)
adds a container to the list of containers waiting for a vehicle on the specified edge ...
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition of vehicle stop (position and duration)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
void setTranship(MSContainer *c)
adds a container to myTranship
virtual void removeContainer(MSContainer *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.
virtual void erase(MSContainer *container)
removes a single container
std::vector< MSContainer * > ContainerVector
A road/street connecting two junctions.
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.
SUMOTime duration
The stopping duration.
SUMOTime getDesiredDepart() const
Returns the desired departure time.
std::string line
The vehicle's line (mainly for public transport)
std::vector< MSContainerStage * > MSContainerPlan
the structure holding the plan of a container
MSContainerControl()
constructor
virtual MSContainer * buildContainer(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSContainer::MSContainerPlan *plan) const
Builds a new container.
Structure representing possible vehicle parameter.
bool add(const std::string &id, MSContainer *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.
std::map< std::string, MSContainer * > myTranship
all containers being transhiped
void setDeparture(SUMOTime time, MSContainer *container)
sets the arrival time for a waiting container
void addContainer(MSContainer *container)
Adds a container.
void unsetTranship(MSContainer *c)
removes a container from myTranship
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
const std::string & getID() const
returns the container id
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
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.
void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
bool hasNonWaiting() const
checks whether any container is still engaged in walking / stopping
SUMOReal startPos
The stopping position start.
bool hasContainers() const
checks whether any container waits to finish her plan
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
void checkWaitingContainers(MSNet *net, const SUMOTime time)
checks whether any containers waiting time is over
std::map< std::string, MSContainer * > myContainers
all containers by id
std::string id
The vehicle's id.
virtual ~MSContainerControl()
destructor