44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
56 for (std::map<std::string, MSPerson*>::iterator i =
myPersons.begin(); i !=
myPersons.end(); ++i) {
76 const std::string&
id = person->
getID();
79 od.
openTag(
"personinfo") <<
" id=\"" <<
id <<
"\" ";
86 od.
openTag(
"person") <<
" id=\"" <<
id
94 const std::map<std::string, MSPerson*>::iterator i =
myPersons.find(
id);
127 for (
size_t i = 0; i < persons.size(); ++i) {
128 if (!persons[i]->proceed(net, time)) {
137 for (
size_t i = 0; i < persons.size(); ++i) {
138 if (!persons[i]->proceed(net, time)) {
167 for (PersonVector::iterator i = waitPersons.begin(); i != waitPersons.end();) {
169 if ((*i)->isWaitingFor(line)) {
173 i = waitPersons.erase(i);
179 if (waitPersons.size() == 0) {
207 std::map<std::string, MSPerson*>::iterator i =
myWalking.find(p->
getID());
217 const MSEdge* edge = (*i).first;
219 for (PersonVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
222 WRITE_WARNING(
"Person " + p->
getID() +
" aborted waiting for a ride that will never come.");
231 return new MSPerson(pars, vtype, plan);
const std::string & getID() const
returns the person id
virtual MSPerson * buildPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSPerson::MSPersonPlan *plan) const
Builds a new person.
Representation of a vehicle in the micro simulation.
SUMOTime getDesiredDepart() const
Returns the desired departure time.
bool boardAnyWaiting(MSEdge *edge, MSVehicle *vehicle)
board any applicable persons Boards any people who wait on that edge for the given vehicle and remove...
std::map< std::string, MSPerson * > myWalking
all persons by id
std::map< SUMOTime, PersonVector > myWaiting4Departure
Persons waiting for departure.
std::string time2string(SUMOTime t)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSPersonControl()
constructor
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
#define WRITE_WARNING(msg)
The simulated network and simulation perfomer.
The car-following model and parameter.
static OptionsCont & getOptions()
Retrieves the options.
bool hasPersons() const
checks whether any person waits to finish her plan
std::map< std::string, MSPerson * > myPersons
all persons by id
A road/street connecting two junctions.
void routeOutput(OutputDevice &os) const
Called on writing vehroute output.
bool add(const std::string &id, MSPerson *person)
adds a single person, returns false if an id clash occured
void abortWaiting()
aborts the plan for any person that is still waiting for a ride
void addWaiting(const MSEdge *edge, MSPerson *person)
adds a person to the list of persons waiting for a vehicle on the specified edge
void checkWaitingPersons(MSNet *net, const SUMOTime time)
checks whether any persons waiting or walking time is over
virtual void removePerson(MSPerson *p) const
void setWaitEnd(SUMOTime time, MSPerson *person)
sets the arrival time for a waiting or walking person
void unsetWalking(MSPerson *p)
std::string line
The vehicle's line (mainly for public transport)
std::map< const MSEdge *, PersonVector > myWaiting4Vehicle
the lists of waiting persons
bool hasNonWaiting() const
checks whether any person is still engaged in walking / stopping
Structure representing possible vehicle parameter.
void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
void setWalking(MSPerson *p)
std::map< SUMOTime, PersonVector > myWaitingUntil
the lists of walking / stopping persons
void setDeparture(SUMOTime time, MSPerson *person)
sets the arrival time for a waiting or walking person
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
std::vector< MSPerson * > PersonVector
virtual void erase(MSPerson *person)
removes a single person
void addPerson(MSPerson *person)
Adds a passenger.
std::vector< MSPersonStage * > MSPersonPlan
the structure holding the plan of a person
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual ~MSPersonControl()
destructor
bool isWaiting4Vehicle(const MSEdge *const edge, MSPerson *p) const
returns whether the the given person is waiting for a vehicle on the given edge
std::string id
The vehicle's id.