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 std::map<std::string, MSPerson*>::const_iterator i =
myPersons.find(
id);
86 const std::string&
id = person->
getID();
100 const std::map<std::string, MSPerson*>::iterator i =
myPersons.find(
id);
133 for (
size_t i = 0; i < persons.size(); ++i) {
134 if (!persons[i]->proceed(net, time)) {
143 for (
size_t i = 0; i < persons.size(); ++i) {
144 if (!persons[i]->proceed(net, time)) {
175 for (PersonVector::iterator i = waitPersons.begin(); i != waitPersons.end();) {
182 if (boardingDuration >= stop->
duration) {
189 i = waitPersons.erase(i);
195 if (waitPersons.size() == 0) {
222 std::map<std::string, MSPerson*>::iterator i =
myWalking.find(p->
getID());
232 const MSEdge* edge = (*i).first;
234 for (PersonVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
237 WRITE_WARNING(
"Person " + p->
getID() +
" aborted waiting for a ride that will never come.");
246 return new MSPerson(pars, vtype, plan);
SUMOTime getBoardingDuration() const
Get this vehicle type's boarding duration.
const std::string & getID() const
returns the person id
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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.
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
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).
unsigned int getPersonNumber() const
Returns the number of persons.
Definition of vehicle stop (position and duration)
MSPersonControl()
Constructor.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
#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
SUMOTime duration
The stopping duration.
virtual void removePerson(MSPerson *p) const
void setWaitEnd(SUMOTime time, MSPerson *person)
sets the arrival time for a waiting or walking person
unsigned int getPersonCapacity() const
Get this vehicle type's person capacity.
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
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
MSPerson * get(const std::string &id) const
Returns the named person, if existing.
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)
SUMOReal endPos
The stopping position end.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
std::vector< MSPerson * > PersonVector
Definition of a list of persons.
virtual void erase(MSPerson *person)
removes a single person
void addPerson(MSPerson *person)
Adds a passenger.
SUMOReal startPos
The stopping position start.
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 boardAnyWaiting(MSEdge *edge, MSVehicle *vehicle, MSVehicle::Stop *stop)
board any applicable persons Boards any people who wait on that edge for the given vehicle and remove...
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.