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
enum  StageType { WALKING = 0, DRIVING = 1, WAITING = 2 }

Public Member Functions

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

Protected Attributes

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

Private Member Functions

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

Detailed Description

The class holds a simulated person together with her movement stages

Definition at line 70 of file MSPerson.h.

Member Typedef Documentation

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

the structure holding the plan of a person

Definition at line 515 of file MSPerson.h.

Member Enumeration Documentation

Enumerator:
WALKING 
DRIVING 
WAITING 

Definition at line 72 of file MSPerson.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 535 of file MSPerson.cpp.

References myPlan, and myStep.

MSPerson::~MSPerson ( )
virtual

destructor

Definition at line 541 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 626 of file MSPerson.cpp.

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

Referenced by MSFCDExport::write().

MSPersonStage* MSPerson::getCurrentStage ( ) const
inline

Definition at line 593 of file MSPerson.h.

References myStep.

Referenced by GUIPerson::drawGL(), and MSEdge::person_by_offset_sorter::operator()().

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

Definition at line 589 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 584 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 615 of file MSPerson.cpp.

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

Referenced by MSFCDExport::write().

const MSEdge* MSPerson::getFromEdge ( ) const
inline

Returns the departure edge.

Definition at line 564 of file MSPerson.h.

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

const SUMOVehicleParameter& MSPerson::getParameter ( ) const
inline

Definition at line 622 of file MSPerson.h.

References myParameter.

Referenced by GUIPerson::setFunctionalColor().

Position MSPerson::getPosition ( ) const
virtual

return the Network coordinate of the person

Reimplemented in GUIPerson.

Definition at line 620 of file MSPerson.cpp.

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

Referenced by MSFCDExport::write().

SUMOReal MSPerson::getSpeed ( ) const
virtual

the current speed of the person

Reimplemented in GUIPerson.

Definition at line 636 of file MSPerson.cpp.

Referenced by MSFCDExport::write().

const MSVehicleType& MSPerson::getVehicleType ( ) const
inline
SUMOReal MSPerson::getWaitingSeconds ( ) const
virtual

the time this person spent waiting in seconds

Reimplemented in GUIPerson.

Definition at line 631 of file MSPerson.cpp.

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

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 612 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 604 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 590 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 596 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 519 of file MSPerson.h.

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

MSPersonPlan* MSPerson::myPlan
protected

the plan of the person

Definition at line 525 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 528 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 522 of file MSPerson.h.

Referenced by getVehicleType().

bool MSPerson::myWriteEvents
protected

Whether events shall be written.

Definition at line 531 of file MSPerson.h.


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