SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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

virtual SUMOReal getAngle () const
 return the current angle of the person More...
 
MSPersonStagegetCurrentStage () const
 
std::string getCurrentStageDescription () const
 
StageType getCurrentStageType () 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...
 
virtual SUMOReal getEdgePos () const
 return the offset from the start of the current edge More...
 
const MSEdgegetFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the person id More...
 
const SUMOVehicleParametergetParameter () const
 
virtual Position getPosition () const
 return the Network coordinate of the person More...
 
virtual SUMOReal getSpeed () const
 the current speed of the person More...
 
const MSVehicleTypegetVehicleType () const
 
virtual SUMOReal getWaitingSeconds () const
 the time this person spent waiting in seconds More...
 
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...
 
void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
virtual ~MSPerson ()
 destructor 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 69 of file MSPerson.h.

Member Typedef Documentation

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

the structure holding the plan of a person

Definition at line 514 of file MSPerson.h.

Member Enumeration Documentation

Enumerator
WALKING 
DRIVING 
WAITING 

Definition at line 71 of file MSPerson.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 536 of file MSPerson.cpp.

References myPlan, and myStep.

MSPerson::~MSPerson ( )
virtual

destructor

Definition at line 542 of file MSPerson.cpp.

References myParameter, and myPlan.

MSPerson::MSPerson ( const MSPerson )
private

Invalidated copy constructor.

Member Function Documentation

SUMOReal MSPerson::getAngle ( ) const
virtual

return the current angle of the person

Reimplemented in GUIPerson.

Definition at line 627 of file MSPerson.cpp.

References MSNet::getCurrentTimeStep(), and MSNet::getInstance().

Referenced by GUIPerson::getAngle(), TraCIServerAPI_Person::processGet(), and MSFCDExport::write().

MSPersonStage* MSPerson::getCurrentStage ( ) const
inline
std::string MSPerson::getCurrentStageDescription ( ) const
inline

Definition at line 572 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow().

StageType MSPerson::getCurrentStageType ( ) const
inline
SUMOTime MSPerson::getDesiredDepart ( ) const

Returns the desired departure time.

Definition at line 585 of file MSPerson.cpp.

References SUMOVehicleParameter::depart, and myParameter.

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

const MSEdge& MSPerson::getDestination ( ) const
inline
SUMOReal MSPerson::getEdgePos ( ) const
virtual

return the offset from the start of the current edge

Reimplemented in GUIPerson.

Definition at line 616 of file MSPerson.cpp.

References MSNet::getCurrentTimeStep(), and MSNet::getInstance().

Referenced by GUIPerson::getEdgePos(), TraCIServerAPI_Person::processGet(), and MSFCDExport::write().

const MSEdge* MSPerson::getFromEdge ( ) const
inline

Returns the departure edge.

Definition at line 547 of file MSPerson.h.

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

const SUMOVehicleParameter& MSPerson::getParameter ( ) const
inline
Position MSPerson::getPosition ( ) const
virtual

return the Network coordinate of the person

Reimplemented in GUIPerson.

Definition at line 621 of file MSPerson.cpp.

References MSNet::getCurrentTimeStep(), and MSNet::getInstance().

Referenced by TraCIServerAPI_Person::getPosition(), GUIPerson::getPosition(), TraCIServerAPI_Person::processGet(), and MSFCDExport::write().

SUMOReal MSPerson::getSpeed ( ) const
virtual

the current speed of the person

Reimplemented in GUIPerson.

Definition at line 637 of file MSPerson.cpp.

Referenced by GUIPerson::getSpeed(), TraCIServerAPI_Person::processGet(), and MSFCDExport::write().

SUMOReal MSPerson::getWaitingSeconds ( ) const
virtual

the time this person spent waiting in seconds

Reimplemented in GUIPerson.

Definition at line 632 of file MSPerson.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and STEPS2TIME.

Referenced by GUIPerson::getWaitingSeconds(), and TraCIServerAPI_Person::processGet().

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 595 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 605 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 591 of file MSPerson.cpp.

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 597 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 617 of file MSPerson.h.

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

MSPersonPlan* MSPerson::myPlan
protected

the plan of the person

Definition at line 623 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 626 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 620 of file MSPerson.h.

Referenced by getVehicleType().

bool MSPerson::myWriteEvents
protected

Whether events shall be written.

Definition at line 629 of file MSPerson.h.


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