|
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 More... | |
| bool | add (const std::string &id, MSPerson *person) |
| adds a single person, returns false if an id clash occured More... | |
| void | addWaiting (const MSEdge *edge, MSPerson *person) |
| adds a person to the list of persons waiting for a vehicle on the specified edge More... | |
| bool | boardAnyWaiting (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 More... | |
| virtual MSPerson * | buildPerson (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSPerson::MSPersonPlan *plan) const |
| Builds a new person. More... | |
| void | checkWaitingPersons (MSNet *net, const SUMOTime time) |
| checks whether any persons waiting or walking time is over More... | |
| virtual void | erase (MSPerson *person) |
| removes a single person More... | |
| const std::map< std::string, MSPerson * > & | getPersons () const |
| bool | hasNonWaiting () const |
| checks whether any person is still engaged in walking / stopping More... | |
| bool | hasPersons () const |
| checks whether any person waits to finish her plan More... | |
| bool | isWaiting4Vehicle (const MSEdge *const edge, MSPerson *p) const |
| returns whether the the given person is waiting for a vehicle on the given edge More... | |
| MSPersonControl () | |
| constructor More... | |
| void | setDeparture (SUMOTime time, MSPerson *person) |
| sets the arrival time for a waiting or walking person More... | |
| void | setWaitEnd (SUMOTime time, MSPerson *person) |
| sets the arrival time for a waiting or walking person More... | |
| void | setWalking (MSPerson *p) |
| void | unsetWalking (MSPerson *p) |
| virtual | ~MSPersonControl () |
| destructor More... | |
Private Attributes | |
| std::map< std::string, MSPerson * > | myPersons |
| all persons by id More... | |
| std::map< SUMOTime, PersonVector > | myWaiting4Departure |
| Persons waiting for departure. More... | |
| std::map< const MSEdge *, PersonVector > | myWaiting4Vehicle |
| the lists of waiting persons More... | |
| std::map< SUMOTime, PersonVector > | myWaitingUntil |
| the lists of walking / stopping persons More... | |
| std::map< std::string, MSPerson * > | myWalking |
| all persons by id More... | |
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 58 of file MSPersonControl.h.
| typedef std::vector<MSPerson*> MSPersonControl::PersonVector |
Definition at line 61 of file MSPersonControl.h.
| MSPersonControl::MSPersonControl | ( | ) |
constructor
Definition at line 52 of file MSPersonControl.cpp.
|
virtual |
destructor
Definition at line 55 of file MSPersonControl.cpp.
References myPersons, and myWaiting4Vehicle.
| void MSPersonControl::abortWaiting | ( | ) |
aborts the plan for any person that is still waiting for a ride
Definition at line 211 of file MSPersonControl.cpp.
References erase(), MSPerson::getID(), myWaiting4Vehicle, MSEdge::removePerson(), and WRITE_WARNING.
Referenced by MSNet::simulationState().
adds a single person, returns false if an id clash occured
Definition at line 65 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 144 of file MSPersonControl.cpp.
References myWaiting4Vehicle.
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 159 of file MSPersonControl.cpp.
References MSVehicle::addPerson(), MSBaseVehicle::getParameter(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, myWaiting4Vehicle, and MSEdge::removePerson().
Referenced by MSVehicle::processNextStop().
|
virtual |
Builds a new person.
| [in] | pars | The parameter |
| [in] | vtype | The type (reusing vehicle type container here) |
| [in] | plan | This person's plan |
Reimplemented in GUIPersonControl.
Definition at line 226 of file MSPersonControl.cpp.
Referenced by MSRouteHandler::closePerson().
checks whether any persons waiting or walking time is over
Definition at line 119 of file MSPersonControl.cpp.
References erase(), myWaiting4Departure, and myWaitingUntil.
Referenced by MSNet::simulationStep().
|
virtual |
removes a single person
Definition at line 75 of file MSPersonControl.cpp.
References OutputDevice::closeTag(), MSPerson::getDesiredDepart(), OutputDevice::getDeviceByOption(), MSPerson::getID(), MSNet::getInstance(), OptionsCont::getOptions(), myPersons, OutputDevice::openTag(), MSPerson::routeOutput(), time2string(), MSPerson::tripInfoOutput(), and OutputDevice::writeAttr().
Referenced by abortWaiting(), checkWaitingPersons(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSDevice_Person::notifyLeave(), MSDevice_Person::notifyMove(), and MSPerson::MSPersonStage_Walking::proceed().
|
inline |
Definition at line 118 of file MSPersonControl.h.
References myPersons.
| bool MSPersonControl::hasNonWaiting | ( | ) | const |
checks whether any person is still engaged in walking / stopping
Definition at line 190 of file MSPersonControl.cpp.
References myWaiting4Departure, myWaitingUntil, and myWalking.
Referenced by MSNet::simulationState().
| bool MSPersonControl::hasPersons | ( | ) | const |
checks whether any person waits to finish her plan
Definition at line 184 of file MSPersonControl.cpp.
References myPersons.
returns whether the the given person is waiting for a vehicle on the given edge
Definition at line 153 of file MSPersonControl.cpp.
References myWaiting4Vehicle.
sets the arrival time for a waiting or walking person
Definition at line 99 of file MSPersonControl.cpp.
References DELTA_T, and myWaiting4Departure.
Referenced by MSRouteHandler::closePerson().
sets the arrival time for a waiting or walking person
Definition at line 109 of file MSPersonControl.cpp.
References DELTA_T, and myWaitingUntil.
Referenced by MSPerson::MSPersonStage_Waiting::proceed().
| void MSPersonControl::setWalking | ( | MSPerson * | p | ) |
Definition at line 196 of file MSPersonControl.cpp.
References MSPerson::getID(), and myWalking.
Referenced by MSPerson::MSPersonStage_Walking::proceed().
| void MSPersonControl::unsetWalking | ( | MSPerson * | p | ) |
Definition at line 202 of file MSPersonControl.cpp.
References MSPerson::getID(), and myWalking.
Referenced by MSPerson::MSPersonStage_Walking::moveToNextEdge().
|
private |
all persons by id
Definition at line 124 of file MSPersonControl.h.
Referenced by add(), erase(), getPersons(), hasPersons(), and ~MSPersonControl().
|
private |
Persons waiting for departure.
Definition at line 130 of file MSPersonControl.h.
Referenced by checkWaitingPersons(), hasNonWaiting(), and setDeparture().
|
private |
the lists of waiting persons
Definition at line 136 of file MSPersonControl.h.
Referenced by abortWaiting(), addWaiting(), boardAnyWaiting(), isWaiting4Vehicle(), and ~MSPersonControl().
|
private |
the lists of walking / stopping persons
Definition at line 133 of file MSPersonControl.h.
Referenced by checkWaitingPersons(), hasNonWaiting(), and setWaitEnd().
|
private |
all persons by id
Definition at line 127 of file MSPersonControl.h.
Referenced by hasNonWaiting(), setWalking(), and unsetWalking().