SUMO - Simulation of Urban MObility
|
#include <MSPersonControl.h>
Public Types | |
typedef std::vector< MSPerson * > | PersonVector |
Public Member Functions | |
void | abortWaiting () |
aborts the plan for any person that is still waiting for a ride | |
bool | add (const std::string &id, MSPerson *person) |
adds a single person, returns false iff an id clash occured | |
void | addWaiting (const MSEdge *edge, MSPerson *person) |
adds a person to the list of persons waiting for a vehicle on the specified edge | |
bool | boardAnyWaiting (const MSEdge *edge, MSVehicle *vehicle) |
board any applicable persons Boards any people who wait on that edge for the given vehicle and removes them from myWaiting | |
void | checkArrivedPersons (MSNet *net, const SUMOTime time) |
checks whether any persons waiting or walking time is over | |
void | erase (MSPerson *person) |
removes a single person | |
bool | hasPedestrians () const |
checks whether any person is still engaged in walking / stopping | |
bool | hasPersons () const |
checks whether any person waits to finish her plan | |
MSPersonControl () | |
constructor | |
void | setArrival (SUMOTime time, MSPerson *person) |
sets the arrival time for a waiting or walking person | |
~MSPersonControl () | |
destructor |
Private Attributes | |
std::map< SUMOTime, PersonVector > | myArrivals |
the lists of walking / stopping persons | |
std::map< std::string, MSPerson * > | myPersons |
all persons by id | |
std::map< const MSEdge *, PersonVector > | myWaiting |
the lists of waiting persons |
The class is used to handle persons who are not using a transportation system but are walking or waiting. Both is processed by waiting for the arrival time / the time the waiting is over.
Definition at line 56 of file MSPersonControl.h.
typedef std::vector<MSPerson*> MSPersonControl::PersonVector |
Definition at line 59 of file MSPersonControl.h.
MSPersonControl::MSPersonControl | ( | ) |
constructor
Definition at line 51 of file MSPersonControl.cpp.
MSPersonControl::~MSPersonControl | ( | ) |
void MSPersonControl::abortWaiting | ( | ) |
aborts the plan for any person that is still waiting for a ride
Definition at line 164 of file MSPersonControl.cpp.
References erase(), myPersons, and WRITE_WARNING.
Referenced by MSNet::simulationState().
adds a single person, returns false iff an id clash occured
Definition at line 64 of file MSPersonControl.cpp.
References myPersons.
adds a person to the list of persons waiting for a vehicle on the specified edge
Definition at line 123 of file MSPersonControl.cpp.
References myWaiting.
Referenced by MSPerson::MSPersonStage_Driving::proceed().
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 |
Definition at line 132 of file MSPersonControl.cpp.
References MSVehicle::addPerson(), MSBaseVehicle::getParameter(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, and myWaiting.
Referenced by MSVehicle::processNextStop().
checks whether any persons waiting or walking time is over
Definition at line 110 of file MSPersonControl.cpp.
References myArrivals.
Referenced by MSNet::simulationStep().
void MSPersonControl::erase | ( | MSPerson * | person | ) |
removes a single person
Definition at line 74 of file MSPersonControl.cpp.
References OutputDevice::closeTag(), MSNet::getCurrentTimeStep(), MSPerson::getDesiredDepart(), OutputDevice::getDeviceByOption(), MSPerson::getID(), MSNet::getInstance(), OptionsCont::getOptions(), myPersons, OutputDevice::openTag(), time2string(), and MSPerson::tripInfoOutput().
Referenced by abortWaiting(), and MSPerson::proceed().
bool MSPersonControl::hasPedestrians | ( | ) | const |
checks whether any person is still engaged in walking / stopping
Definition at line 158 of file MSPersonControl.cpp.
References myArrivals.
Referenced by MSNet::simulationState().
bool MSPersonControl::hasPersons | ( | ) | const |
checks whether any person waits to finish her plan
Definition at line 152 of file MSPersonControl.cpp.
References myPersons.
sets the arrival time for a waiting or walking person
Definition at line 100 of file MSPersonControl.cpp.
References DELTA_T, and myArrivals.
Referenced by MSRouteHandler::closePerson(), MSPerson::MSPersonStage_Walking::proceed(), and MSPerson::MSPersonStage_Waiting::proceed().
|
private |
the lists of walking / stopping persons
Definition at line 104 of file MSPersonControl.h.
Referenced by checkArrivedPersons(), hasPedestrians(), and setArrival().
|
private |
all persons by id
Definition at line 101 of file MSPersonControl.h.
Referenced by abortWaiting(), add(), erase(), hasPersons(), and ~MSPersonControl().
|
private |
the lists of waiting persons
Definition at line 107 of file MSPersonControl.h.
Referenced by addWaiting(), boardAnyWaiting(), and ~MSPersonControl().