SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSPerson Class Reference

#include <MSPerson.h>

Inheritance diagram for MSPerson:
GUIPerson

Data Structures

class  MSPersonStage
 
class  MSPersonStage_Driving
 
class  MSPersonStage_Waiting
 
class  MSPersonStage_Walking
 

Public Types

typedef std::vector
< MSPersonStage * > 
MSPersonPlan
 the structure holding the plan of a person More...
 
enum  StageType { WALKING = 0, DRIVING = 1, WAITING = 2 }
 

Public Member Functions

SUMOReal getAngle (SUMOTime now) const
 
MSPersonStagegetCurrentStage () const
 
StageType getCurrentStageType () const
 
std::string getCurrentStageTypeName () const
 
SUMOTime getDesiredDepart () const
 Returns the desired departure time. More...
 
const MSEdgegetDestination () const
 Returns the current destination. More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
SUMOReal getEdgePos (SUMOTime now) const
 
const MSEdgegetFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the person id More...
 
const SUMOVehicleParametergetParameter () const
 
virtual Position getPosition (SUMOTime now) const
 
const MSVehicleTypegetVehicleType () const
 
bool isWaiting4Vehicle () const
 Whether the person waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the person waits for a vehicle of the line specified. More...
 
 MSPerson (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSPersonPlan *plan)
 constructor More...
 
bool proceed (MSNet *net, SUMOTime time)
 
void routeOutput (OutputDevice &os) const
 Called on writing vehroute output. More...
 
void setDeparted (SUMOTime now)
 logs end of the step More...
 
SUMOTime timeWaiting4Vehicle (SUMOTime now) const
 the time this person spent waiting for a vehicle More...
 
void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
virtual ~MSPerson ()
 destructor More...
 

Static Public Attributes

static const SUMOReal SIDEWALK_OFFSET
 the offset for computing person positions when walking More...
 

Protected Attributes

const SUMOVehicleParametermyParameter
 the plan of the person More...
 
MSPersonPlanmyPlan
 the plan of the person More...
 
MSPersonPlan::iterator myStep
 the iterator over the route More...
 
const MSVehicleTypemyVType
 This Persons's type. (mainly used for drawing related information. More...
 
bool myWriteEvents
 Whether events shall be written. More...
 

Private Member Functions

 MSPerson (const MSPerson &)
 Invalidated copy constructor. More...
 
MSPersonoperator= (const MSPerson &)
 Invalidated assignment operator. More...
 

Detailed Description

The class holds a simulated person together with her movement stages

Definition at line 66 of file MSPerson.h.

Member Typedef Documentation

typedef std::vector<MSPersonStage*> MSPerson::MSPersonPlan

the structure holding the plan of a person

Definition at line 475 of file MSPerson.h.

Member Enumeration Documentation

Enumerator
WALKING 
DRIVING 
WAITING 

Definition at line 68 of file MSPerson.h.

Constructor & Destructor Documentation

MSPerson::MSPerson ( const SUMOVehicleParameter pars,
const MSVehicleType vtype,
MSPersonPlan plan 
)

constructor

Definition at line 508 of file MSPerson.cpp.

References myPlan, and myStep.

MSPerson::~MSPerson ( )
virtual

destructor

Definition at line 514 of file MSPerson.cpp.

References myParameter, and myPlan.

MSPerson::MSPerson ( const MSPerson )
private

Invalidated copy constructor.

Member Function Documentation

SUMOReal MSPerson::getAngle ( SUMOTime  now) const
inline
MSPersonStage* MSPerson::getCurrentStage ( ) const
inline

Definition at line 552 of file MSPerson.h.

References myStep.

StageType MSPerson::getCurrentStageType ( ) const
inline

Definition at line 543 of file MSPerson.h.

Referenced by GUIPerson::getColorValue(), and GUIPerson::getPosition().

std::string MSPerson::getCurrentStageTypeName ( ) const
inline

Definition at line 548 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow().

SUMOTime MSPerson::getDesiredDepart ( ) const

Returns the desired departure time.

Definition at line 558 of file MSPerson.cpp.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by MSPersonControl::erase(), and routeOutput().

const MSEdge& MSPerson::getDestination ( ) const
inline
SUMOReal MSPerson::getEdgePos ( SUMOTime  now) const
inline

Definition at line 528 of file MSPerson.h.

const MSEdge* MSPerson::getFromEdge ( ) const
inline

Returns the departure edge.

Definition at line 524 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow(), and MSPerson::MSPersonStage_Driving::routeOutput().

const SUMOVehicleParameter& MSPerson::getParameter ( ) const
inline

Definition at line 586 of file MSPerson.h.

References myParameter.

Referenced by GUIPerson::setFunctionalColor().

virtual Position MSPerson::getPosition ( SUMOTime  now) const
inlinevirtual

Reimplemented in GUIPerson.

Definition at line 533 of file MSPerson.h.

Referenced by GUIPerson::getPosition().

const MSVehicleType& MSPerson::getVehicleType ( ) const
inline

Definition at line 591 of file MSPerson.h.

References myVType.

Referenced by GUIPerson::drawAction_drawAsImage(), and GUIPerson::setFunctionalColor().

bool MSPerson::isWaiting4Vehicle ( ) const
inline
bool MSPerson::isWaitingFor ( const std::string &  line) const
inline

Whether the person waits for a vehicle of the line specified.

Definition at line 571 of file MSPerson.h.

MSPerson& MSPerson::operator= ( const MSPerson )
private

Invalidated assignment operator.

void MSPerson::routeOutput ( OutputDevice os) const

Called on writing vehroute output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Definition at line 578 of file MSPerson.cpp.

References getDesiredDepart(), MSPerson::MSPersonStage_Waiting::getUntil(), myPlan, and WAITING.

Referenced by MSPersonControl::erase().

void MSPerson::setDeparted ( SUMOTime  now)

logs end of the step

Definition at line 564 of file MSPerson.cpp.

SUMOTime MSPerson::timeWaiting4Vehicle ( SUMOTime  now) const
inline

the time this person spent waiting for a vehicle

Definition at line 582 of file MSPerson.h.

Referenced by GUIPerson::getColorValue().

void MSPerson::tripInfoOutput ( OutputDevice os) const

Called on writing tripinfo output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Definition at line 570 of file MSPerson.cpp.

References myPlan.

Referenced by MSPersonControl::erase().

Field Documentation

const SUMOVehicleParameter* MSPerson::myParameter
protected

the plan of the person

Definition at line 479 of file MSPerson.h.

Referenced by getDesiredDepart(), getID(), getParameter(), and ~MSPerson().

MSPersonPlan* MSPerson::myPlan
protected

the plan of the person

Definition at line 485 of file MSPerson.h.

Referenced by MSPerson(), proceed(), routeOutput(), tripInfoOutput(), and ~MSPerson().

MSPersonPlan::iterator MSPerson::myStep
protected

the iterator over the route

Definition at line 488 of file MSPerson.h.

Referenced by getCurrentStage(), MSPerson(), and proceed().

const MSVehicleType* MSPerson::myVType
protected

This Persons's type. (mainly used for drawing related information.

Definition at line 482 of file MSPerson.h.

Referenced by getVehicleType().

bool MSPerson::myWriteEvents
protected

Whether events shall be written.

Definition at line 491 of file MSPerson.h.

const SUMOReal MSPerson::SIDEWALK_OFFSET
static

The documentation for this class was generated from the following files: