![]() |
SUMO - Simulation of Urban MObility
|
#include <MSTransportableControl.h>
Public Types | |
typedef std::map< std::string, MSTransportable * >::const_iterator | constVehIt |
Definition of the internal transportables map iterator. More... | |
typedef std::vector< MSTransportable * > | TransportableVector |
Definition of a list of transportables. More... | |
Public Member Functions | |
void | abortWaiting (MSTransportable *t) |
aborts waiting stage of transportable More... | |
void | abortWaitingForVehicle () |
aborts the plan for any transportable that is still waiting for a ride More... | |
bool | add (MSTransportable *transportable) |
Adds a single transportable, returns false if an id clash occurred. More... | |
void | addWaiting (const MSEdge *edge, MSTransportable *person) |
adds a transportable to the list of transportables waiting for a vehicle on the specified edge More... | |
bool | boardAnyWaiting (MSEdge *edge, SUMOVehicle *vehicle, const SUMOVehicleParameter::Stop &stop, SUMOTime &timeToBoardNextPerson, SUMOTime &stopDuration) |
board any applicable persons Boards any people who wait on that edge for the given vehicle and removes them from myWaiting More... | |
virtual MSTransportable * | buildContainer (const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const |
Builds a new container. More... | |
virtual MSTransportable * | buildPerson (const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, std::mt19937 *rng) const |
Builds a new person. More... | |
void | checkWaiting (MSNet *net, const SUMOTime time) |
checks whether any transportables waiting time is over More... | |
virtual void | erase (MSTransportable *transportable) |
removes a single transportable More... | |
MSTransportable * | get (const std::string &id) const |
Returns the named transportable, if existing. More... | |
int | getActiveCount () |
return the number of active transportable objects More... | |
bool | hasNonWaiting () const |
checks whether any transportable is still engaged in walking / stopping More... | |
bool | hasTransportables () const |
checks whether any transportable waits to finish her plan More... | |
bool | loadAnyWaiting (MSEdge *edge, SUMOVehicle *vehicle, const SUMOVehicleParameter::Stop &stop, SUMOTime &timeToLoadNextContainer, SUMOTime &stopDuration) |
load any applicable containers Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting More... | |
constVehIt | loadedBegin () const |
Returns the begin of the internal transportables map. More... | |
constVehIt | loadedEnd () const |
Returns the end of the internal transportables map. More... | |
MSTransportableControl () | |
Constructor. More... | |
void | registerJammed () |
register a jammed transportable More... | |
void | setWaitEnd (SUMOTime time, MSTransportable *transportable) |
sets the arrival time for a waiting transportable More... | |
int | size () const |
Returns the number of known transportables. More... | |
virtual | ~MSTransportableControl () |
Destructor. More... | |
Retrieval of transportable statistics (always accessable) | |
int | getLoadedNumber () const |
Returns the number of build transportables. More... | |
int | getRunningNumber () const |
Returns the number of build and inserted, but not yet deleted transportables. More... | |
int | getJammedNumber () const |
Returns the number of times a transportables was jammed. More... | |
Protected Attributes | |
bool | myHaveNewWaiting |
whether a new transportable waiting for a vehicle has been added in the last step More... | |
int | myJammedNumber |
The number of jammed transportables. More... | |
int | myLoadedNumber |
The number of build transportables. More... | |
int | myRunningNumber |
The number of transportables within the network (build and inserted but not removed) More... | |
std::map< std::string, MSTransportable * > | myTransportables |
all currently created transportables by id More... | |
std::map< SUMOTime, TransportableVector > | myWaiting4Departure |
Transportables waiting for departure. More... | |
std::map< const MSEdge *, TransportableVector > | myWaiting4Vehicle |
the lists of waiting transportables More... | |
int | myWaitingForVehicleNumber |
The number of transportables waiting for vehicles. More... | |
std::map< SUMOTime, TransportableVector > | myWaitingUntil |
the lists of walking / stopping transportables More... | |
The class is used to handle transportables (persons and containers) who are not using a transportation system but are walking or waiting. This includes waiting for the arrival or departure time / the time the waiting is over.
Definition at line 52 of file MSTransportableControl.h.
typedef std::map<std::string, MSTransportable*>::const_iterator MSTransportableControl::constVehIt |
Definition of the internal transportables map iterator.
Definition at line 58 of file MSTransportableControl.h.
typedef std::vector<MSTransportable*> MSTransportableControl::TransportableVector |
Definition of a list of transportables.
Definition at line 55 of file MSTransportableControl.h.
MSTransportableControl::MSTransportableControl | ( | ) |
Constructor.
Definition at line 43 of file MSTransportableControl.cpp.
|
virtual |
Destructor.
Definition at line 52 of file MSTransportableControl.cpp.
References myTransportables, and myWaiting4Vehicle.
void MSTransportableControl::abortWaiting | ( | MSTransportable * | t | ) |
aborts waiting stage of transportable
Definition at line 275 of file MSTransportableControl.cpp.
References myWaiting4Departure.
Referenced by MSTransportable::Stage_Waiting::abort().
void MSTransportableControl::abortWaitingForVehicle | ( | ) |
aborts the plan for any transportable that is still waiting for a ride
Definition at line 250 of file MSTransportableControl.cpp.
References erase(), MSTransportable::getCurrentStage(), MSTransportable::getID(), MSNet::getInstance(), MSTransportable::Stage_Driving::getWaitingDescription(), myWaiting4Vehicle, MSEdge::removeContainer(), MSEdge::removePerson(), MSTransportable::setDeparted(), and WRITE_WARNING.
Referenced by MSNet::simulationState().
bool MSTransportableControl::add | ( | MSTransportable * | transportable | ) |
Adds a single transportable, returns false if an id clash occurred.
[in] | transportable | The transportable to add |
Definition at line 62 of file MSTransportableControl.cpp.
References DELTA_T, SUMOVehicleParameter::depart, MSTransportable::getParameter(), SUMOVehicleParameter::id, myLoadedNumber, myTransportables, and myWaiting4Departure.
Referenced by libsumo::Person::add().
void MSTransportableControl::addWaiting | ( | const MSEdge * | edge, |
MSTransportable * | person | ||
) |
adds a transportable to the list of transportables waiting for a vehicle on the specified edge
Definition at line 146 of file MSTransportableControl.cpp.
References myHaveNewWaiting, myWaiting4Vehicle, and myWaitingForVehicleNumber.
Referenced by MSContainer::MSContainerStage_Driving::proceed(), and MSPerson::MSPersonStage_Driving::proceed().
bool MSTransportableControl::boardAnyWaiting | ( | MSEdge * | edge, |
SUMOVehicle * | vehicle, | ||
const SUMOVehicleParameter::Stop & | stop, | ||
SUMOTime & | timeToBoardNextPerson, | ||
SUMOTime & | stopDuration | ||
) |
board any applicable persons Boards any people who wait on that edge for the given vehicle and removes them from myWaiting
[in] | the | edge on which the boarding should take place |
[in] | the | vehicle which is taking on passengers / goods |
[in] | the | stop at which the vehicle is stopping |
Definition at line 154 of file MSTransportableControl.cpp.
References SUMOVehicle::addPerson(), DELTA_T, SUMOVehicleParameter::Stop::endPos, MSVehicleType::getBoardingDuration(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), SUMOVehicle::getParameter(), MSVehicleType::getPersonCapacity(), SUMOVehicle::getPersonNumber(), SUMOVehicle::getVehicleType(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, myWaiting4Vehicle, myWaitingForVehicleNumber, MSEdge::removePerson(), and SUMOVehicleParameter::Stop::startPos.
Referenced by MSVehicle::processNextStop(), and MEVehicle::processStop().
|
virtual |
Builds a new container.
[in] | pars | The parameter |
[in] | vtype | The type (reusing vehicle type container here) |
[in] | plan | This container's plan |
Reimplemented in GUITransportableControl.
Definition at line 302 of file MSTransportableControl.cpp.
Referenced by MSRouteHandler::closeContainer().
|
virtual |
Builds a new person.
[in] | pars | The parameter |
[in] | vtype | The type (reusing vehicle type container here) |
[in] | plan | This person's plan |
[in] | rng | The RNG to compute the optional speed deviation |
Reimplemented in GUITransportableControl.
Definition at line 294 of file MSTransportableControl.cpp.
References MSVehicleType::computeChosenSpeedDeviation().
Referenced by libsumo::Person::add(), and MSRouteHandler::closePerson().
checks whether any transportables waiting time is over
Definition at line 118 of file MSTransportableControl.cpp.
References erase(), myHaveNewWaiting, myRunningNumber, myWaiting4Departure, and myWaitingUntil.
Referenced by MSNet::simulationStep().
|
virtual |
removes a single transportable
Definition at line 86 of file MSTransportableControl.cpp.
References OutputDevice::getDeviceByOption(), MSTransportable::getID(), OptionsCont::getOptions(), myRunningNumber, myTransportables, MSTransportable::routeOutput(), and MSTransportable::tripInfoOutput().
Referenced by abortWaitingForVehicle(), checkWaiting(), MSPerson::MSPersonStage_Access::ProceedCmd::execute(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSContainer::MSContainerStage_Tranship::moveToNextEdge(), MSDevice_Transportable::notifyLeave(), MSDevice_Transportable::notifyMove(), and MSPerson::MSPersonStage_Walking::proceed().
MSTransportable * MSTransportableControl::get | ( | const std::string & | id | ) | const |
Returns the named transportable, if existing.
[in] | id | The id of the transportable |
Definition at line 76 of file MSTransportableControl.cpp.
References myTransportables.
Referenced by libsumo::Person::getPerson(), TraCIServer::postProcessSimulationStep(), and TraCIServerAPI_Person::processSet().
int MSTransportableControl::getActiveCount | ( | ) |
return the number of active transportable objects
Definition at line 244 of file MSTransportableControl.cpp.
References myRunningNumber, myWaiting4Departure, and myWaitingForVehicleNumber.
Referenced by libsumo::Simulation::getMinExpectedNumber().
|
inline |
Returns the number of times a transportables was jammed.
Definition at line 193 of file MSTransportableControl.h.
References myJammedNumber.
Referenced by MSNet::generateStatistics(), and GUINet::getParameterWindow().
|
inline |
Returns the number of build transportables.
Definition at line 178 of file MSTransportableControl.h.
References myLoadedNumber.
Referenced by MSNet::generateStatistics(), and GUINet::getParameterWindow().
|
inline |
Returns the number of build and inserted, but not yet deleted transportables.
Definition at line 186 of file MSTransportableControl.h.
References myRunningNumber.
Referenced by MSNet::generateStatistics(), GUINet::getParameterWindow(), and GUIApplicationWindow::handleEvent_SimulationStep().
bool MSTransportableControl::hasNonWaiting | ( | ) | const |
checks whether any transportable is still engaged in walking / stopping
Definition at line 238 of file MSTransportableControl.cpp.
References myHaveNewWaiting, myRunningNumber, myWaiting4Departure, and myWaitingForVehicleNumber.
Referenced by MSNet::simulationState().
bool MSTransportableControl::hasTransportables | ( | ) | const |
checks whether any transportable waits to finish her plan
Definition at line 232 of file MSTransportableControl.cpp.
References myTransportables.
Referenced by MSNet::simulationStep().
bool MSTransportableControl::loadAnyWaiting | ( | MSEdge * | edge, |
SUMOVehicle * | vehicle, | ||
const SUMOVehicleParameter::Stop & | stop, | ||
SUMOTime & | timeToLoadNextContainer, | ||
SUMOTime & | stopDuration | ||
) |
load any applicable containers Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting
[in] | the | edge on which the loading should take place |
[in] | the | vehicle which is taking on containers |
Definition at line 194 of file MSTransportableControl.cpp.
References SUMOVehicle::addContainer(), SUMOVehicleParameter::Stop::endPos, MSVehicleType::getContainerCapacity(), SUMOVehicle::getContainerNumber(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSVehicleType::getLoadingDuration(), SUMOVehicle::getParameter(), SUMOVehicle::getVehicleType(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, myWaiting4Vehicle, myWaitingForVehicleNumber, MSEdge::removeContainer(), and SUMOVehicleParameter::Stop::startPos.
Referenced by MSVehicle::processNextStop(), and MEVehicle::processStop().
|
inline |
Returns the begin of the internal transportables map.
Definition at line 147 of file MSTransportableControl.h.
References myTransportables.
Referenced by libsumo::Person::getIDList().
|
inline |
Returns the end of the internal transportables map.
Definition at line 155 of file MSTransportableControl.h.
References myTransportables.
Referenced by libsumo::Person::getIDList().
|
inline |
register a jammed transportable
Definition at line 168 of file MSTransportableControl.h.
References myJammedNumber.
Referenced by MSPModel_Striping::PState::walk().
void MSTransportableControl::setWaitEnd | ( | SUMOTime | time, |
MSTransportable * | transportable | ||
) |
sets the arrival time for a waiting transportable
Definition at line 107 of file MSTransportableControl.cpp.
References DELTA_T, myWaiting4Departure, and myWaitingUntil.
Referenced by MSTransportable::Stage_Waiting::proceed().
|
inline |
Returns the number of known transportables.
Definition at line 163 of file MSTransportableControl.h.
References myTransportables.
Referenced by libsumo::Person::getIDCount().
|
protected |
whether a new transportable waiting for a vehicle has been added in the last step
Definition at line 225 of file MSTransportableControl.h.
Referenced by addWaiting(), checkWaiting(), and hasNonWaiting().
|
protected |
The number of jammed transportables.
Definition at line 219 of file MSTransportableControl.h.
Referenced by getJammedNumber(), and registerJammed().
|
protected |
The number of build transportables.
Definition at line 213 of file MSTransportableControl.h.
Referenced by add(), and getLoadedNumber().
|
protected |
The number of transportables within the network (build and inserted but not removed)
Definition at line 216 of file MSTransportableControl.h.
Referenced by checkWaiting(), erase(), getActiveCount(), getRunningNumber(), and hasNonWaiting().
|
protected |
all currently created transportables by id
Definition at line 201 of file MSTransportableControl.h.
Referenced by add(), erase(), get(), hasTransportables(), GUITransportableControl::insertPersonIDs(), loadedBegin(), loadedEnd(), size(), and ~MSTransportableControl().
|
protected |
Transportables waiting for departure.
Definition at line 204 of file MSTransportableControl.h.
Referenced by abortWaiting(), add(), checkWaiting(), getActiveCount(), hasNonWaiting(), and setWaitEnd().
|
protected |
the lists of waiting transportables
Definition at line 210 of file MSTransportableControl.h.
Referenced by abortWaitingForVehicle(), addWaiting(), boardAnyWaiting(), loadAnyWaiting(), and ~MSTransportableControl().
|
protected |
The number of transportables waiting for vehicles.
Definition at line 222 of file MSTransportableControl.h.
Referenced by addWaiting(), boardAnyWaiting(), getActiveCount(), hasNonWaiting(), and loadAnyWaiting().
|
protected |
the lists of walking / stopping transportables
Definition at line 207 of file MSTransportableControl.h.
Referenced by checkWaiting(), and setWaitEnd().