44 #ifdef CHECK_MEMORY_LEAKS 46 #endif // CHECK_MEMORY_LEAKS 53 myLoadedPersonNumber(0),
54 myRunningPersonNumber(0),
55 myJammedPersonNumber(0)
60 for (std::map<std::string, MSTransportable*>::iterator i =
myPersons.begin(); i !=
myPersons.end(); ++i) {
82 std::map<std::string, MSTransportable*>::const_iterator i =
myPersons.find(
id);
92 const std::string&
id = person->
getID();
106 const std::map<std::string, MSTransportable*>::iterator i =
myPersons.find(
id);
140 for (
size_t i = 0; i < persons.size(); ++i) {
141 if (!persons[i]->proceed(net, time)) {
150 for (
size_t i = 0; i < persons.size(); ++i) {
151 if (!persons[i]->proceed(net, time)) {
182 for (PersonVector::iterator i = waitPersons.begin(); i != waitPersons.end();) {
189 if (boardingDuration >= stop->
duration) {
200 i = waitPersons.erase(i);
206 if (waitPersons.size() == 0) {
233 std::map<std::string, MSTransportable*>::iterator i =
myWalking.find(p->
getID());
243 const MSEdge* edge = (*i).first;
245 for (PersonVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
248 WRITE_WARNING(
"Person '" + p->
getID() +
"' aborted waiting for a ride that will never come.");
257 return new MSPerson(pars, vtype, plan);
SUMOTime getBoardingDuration() const
Get this vehicle type's boarding duration.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Representation of a vehicle in the micro simulation.
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
virtual void erase(MSTransportable *person)
removes a single person
void tripInfoOutput(OutputDevice &os) const
Called on writing tripinfo output.
virtual MSPerson * buildPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
Builds a new person.
std::map< SUMOTime, PersonVector > myWaiting4Departure
Persons waiting for departure.
unsigned int myRunningPersonNumber
The number of persons within the network (build and inserted but not removed)
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.
const std::string & getID() const
returns the id of the transportable
Definition of vehicle stop (position and duration)
void setWalking(MSTransportable *p)
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.
void setWaitEnd(SUMOTime time, MSTransportable *person)
sets the arrival time for a waiting or walking person
bool hasPersons() const
checks whether any person waits to finish her plan
SUMOTime getDesiredDepart() const
Returns the desired departure time.
A road/street connecting two junctions.
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
virtual void removePerson(MSTransportable *p) const
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 checkWaitingPersons(MSNet *net, const SUMOTime time)
checks whether any persons waiting or walking time is over
virtual void routeOutput(OutputDevice &os) const =0
Called on writing vehroute output.
std::map< std::string, MSTransportable * > myWalking
all persons by id
SUMOTime duration
The stopping duration.
unsigned int getPersonCapacity() const
Get this vehicle type's person capacity.
MSTransportable * get(const std::string &id) const
Returns the named person, if existing.
std::string line
The vehicle's line (mainly for public transport)
std::map< const MSEdge *, PersonVector > myWaiting4Vehicle
the lists of waiting persons
std::map< std::string, MSTransportable * > myPersons
all persons by id
void unsetWalking(MSTransportable *p)
bool hasNonWaiting() const
checks whether any person is still engaged in walking / stopping
void addWaiting(const MSEdge *edge, MSTransportable *person)
adds a person to the list of persons waiting for a vehicle on the specified edge
unsigned int myLoadedPersonNumber
The number of build persons.
Structure representing possible vehicle parameter.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
std::map< SUMOTime, PersonVector > myWaitingUntil
the lists of walking / stopping persons
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
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.
void addPerson(MSTransportable *person)
Adds a passenger.
SUMOReal startPos
The stopping position start.
std::vector< MSTransportable * > PersonVector
Definition of a list of persons.
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.