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, DRIVING, WAITING }

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.
const MSEdgegetDestination () const
 Returns the current destination.
const MSEdgegetEdge (SUMOTime now) const
 Returns the current edge.
SUMOReal getEdgePos (SUMOTime now) const
const MSEdgegetFromEdge () const
 Returns the departure edge.
const std::string & getID () const
 returns the person id
const SUMOVehicleParametergetParameter () const
virtual Position getPosition (SUMOTime now) const
const MSVehicleTypegetVehicleType () const
bool isWaiting4Vehicle () const
 Whether the person waits for a vehicle of the line specified.
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 setDeparted (SUMOTime now)
 logs end of the step
void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output.
virtual ~MSPerson ()
 destructor

Static Public Attributes

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

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 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 440 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 501 of file MSPerson.cpp.

References myPlan, and myStep.

MSPerson::~MSPerson ( )
virtual

destructor

Definition at line 507 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 517 of file MSPerson.h.

References myStep.

StageType MSPerson::getCurrentStageType ( ) const
inline

Definition at line 508 of file MSPerson.h.

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

Definition at line 513 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow().

SUMOTime MSPerson::getDesiredDepart ( ) const

Returns the desired departure time.

Definition at line 551 of file MSPerson.cpp.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by MSPersonControl::erase().

const MSEdge& MSPerson::getDestination ( ) const
inline

Returns the current destination.

Definition at line 479 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow(), MSDevice_Person::notifyLeave(), and MSDevice_Person::notifyMove().

SUMOReal MSPerson::getEdgePos ( SUMOTime  now) const
inline

Definition at line 493 of file MSPerson.h.

const MSEdge* MSPerson::getFromEdge ( ) const
inline

Returns the departure edge.

Definition at line 489 of file MSPerson.h.

Referenced by GUIPerson::getParameterWindow().

const SUMOVehicleParameter& MSPerson::getParameter ( ) const
inline

Definition at line 538 of file MSPerson.h.

References myParameter.

Referenced by GUIPerson::setFunctionalColor().

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

Reimplemented in GUIPerson.

Definition at line 498 of file MSPerson.h.

const MSVehicleType& MSPerson::getVehicleType ( ) const
inline

Definition at line 543 of file MSPerson.h.

References myVType.

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

bool MSPerson::isWaiting4Vehicle ( ) const
inline

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

Definition at line 534 of file MSPerson.h.

Referenced by GUIPerson::getPosition(), and MSPerson::MSPersonStage_Driving::getStageTypeName().

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

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

Definition at line 529 of file MSPerson.h.

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

Invalidated assignment operator.

void MSPerson::setDeparted ( SUMOTime  now)

logs end of the step

Definition at line 557 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 563 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 444 of file MSPerson.h.

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

MSPersonPlan* MSPerson::myPlan
protected

the plan of the person

Definition at line 450 of file MSPerson.h.

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

MSPersonPlan::iterator MSPerson::myStep
protected

the iterator over the route

Definition at line 453 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 447 of file MSPerson.h.

Referenced by getVehicleType().

bool MSPerson::myWriteEvents
protected

Whether events shall be written.

Definition at line 456 of file MSPerson.h.

const SUMOReal MSPerson::SIDEWALK_OFFSET
static

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