SUMO - Simulation of Urban MObility
MSPersonControl Class Reference

#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, PersonVectormyArrivals
 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

Detailed Description

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.


Member Typedef Documentation

typedef std::vector<MSPerson*> MSPersonControl::PersonVector

Definition at line 59 of file MSPersonControl.h.


Constructor & Destructor Documentation

constructor

Definition at line 51 of file MSPersonControl.cpp.

destructor

Definition at line 54 of file MSPersonControl.cpp.

References myPersons, and myWaiting.


Member Function Documentation

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().

bool MSPersonControl::add ( const std::string &  id,
MSPerson person 
)

adds a single person, returns false iff an id clash occured

Definition at line 64 of file MSPersonControl.cpp.

References myPersons.

void MSPersonControl::addWaiting ( const MSEdge edge,
MSPerson person 
)

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().

bool MSPersonControl::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

Parameters:
[in]theedge on which the boarding should take place
[in]thevehicle which is taking on passengers
Returns:
Whether any persons have been boarded

Definition at line 132 of file MSPersonControl.cpp.

References MSVehicle::addPerson(), MSBaseVehicle::getParameter(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, and myWaiting.

Referenced by MSVehicle::processNextStop().

void MSPersonControl::checkArrivedPersons ( MSNet net,
const SUMOTime  time 
)

checks whether any persons waiting or walking time is over

Definition at line 110 of file MSPersonControl.cpp.

References myArrivals.

Referenced by MSNet::simulationStep().

checks whether any person is still engaged in walking / stopping

Definition at line 158 of file MSPersonControl.cpp.

References myArrivals.

Referenced by MSNet::simulationState().

checks whether any person waits to finish her plan

Definition at line 152 of file MSPersonControl.cpp.

References myPersons.

void MSPersonControl::setArrival ( SUMOTime  time,
MSPerson person 
)

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().


Field Documentation

the lists of walking / stopping persons

Definition at line 104 of file MSPersonControl.h.

Referenced by checkArrivedPersons(), hasPedestrians(), and setArrival().

std::map<std::string, MSPerson*> MSPersonControl::myPersons [private]

all persons by id

Definition at line 101 of file MSPersonControl.h.

Referenced by abortWaiting(), add(), erase(), hasPersons(), and ~MSPersonControl().

std::map<const MSEdge*, PersonVector> MSPersonControl::myWaiting [private]

the lists of waiting persons

Definition at line 107 of file MSPersonControl.h.

Referenced by addWaiting(), boardAnyWaiting(), and ~MSPersonControl().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines