SUMO - Simulation of Urban MObility
MSPerson Class Reference

#include <MSPerson.h>

Inheritance diagram for MSPerson:
Inheritance graph
Collaboration diagram for MSPerson:
Collaboration graph

Data Structures

class  MSPersonStage_Driving
 
class  MSPersonStage_Walking
 

Public Types

typedef std::vector< MSTransportable::Stage * > MSTransportablePlan
 the structure holding the plan of a transportable More...
 
enum  StageType { WAITING_FOR_DEPART = 0, WAITING = 1, MOVING_WITHOUT_VEHICLE = 2, DRIVING = 3 }
 

Public Member Functions

void appendStage (Stage *stage, int next=-1)
 Appends the given stage to the current plan. More...
 
virtual double getAngle () const
 return the current angle of the transportable More...
 
const MSEdge * getArrivalEdge () const
 returns the final arrival edge More...
 
double getArrivalPos () const
 returns the final arrival pos More...
 
PositionVector getBoundingBox () const
 return the bounding box of the person More...
 
MSTransportable::Stage * getCurrentStage () const
 Return the current stage. More...
 
std::string getCurrentStageDescription () const
 Returns the current stage description as a string. More...
 
StageType getCurrentStageType () const
 the current stage type of the transportable More...
 
SUMOTime getDesiredDepart () const
 Returns the desired departure time. More...
 
const MSEdge & getDestination () const
 Returns the current destination. More...
 
const MSEdge * getEdge () const
 Returns the current edge. More...
 
virtual double getEdgePos () const
 Return the position on the edge. More...
 
ConstMSEdgeVector getEdges (int next) const
 Return the edges of the nth next stage. More...
 
const MSEdge * getFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the id of the transportable More...
 
const MSEdge & getNextDestination () const
 Returns the destination after the current destination. More...
 
const std::string & getNextEdge () const
 return the list of internal edges if this person is walking and the pedestrian model allows it More...
 
const MSEdge * getNextEdgePtr () const
 returns the next edge ptr if this person is walking and the pedestrian model allows it More...
 
int getNumRemainingStages () const
 Return the number of remaining stages (including the current) More...
 
int getNumStages () const
 Return the total number stages in this persons plan. More...
 
const SUMOVehicleParameter & getParameter () const
 
virtual Position getPosition () const
 Return the Network coordinate of the transportable. More...
 
MSVehicleType & getSingularType ()
 Replaces the current vehicle type with a new one used by this vehicle only. More...
 
virtual double getSpeed () const
 the current speed of the transportable More...
 
double getSpeedFactor () const
 the current speed factor of the transportable (where applicable) More...
 
StageType getStageType (int next) const
 the stage type for the nth next stage More...
 
SUMOVehicle * getVehicle () const
 The vehicle associated with this transportable. More...
 
const MSVehicleType & getVehicleType () const
 
virtual double getWaitingSeconds () const
 the time this transportable spent waiting in seconds More...
 
virtual bool isSelected () const
 whether this person is selected in the GUI More...
 
bool isWaiting4Vehicle () const
 Whether the transportable waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the transportable waits for a vehicle of the line specified. More...
 
 MSPerson (const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
 constructor More...
 
bool proceed (MSNet *net, SUMOTime time)
 
void removeStage (int next)
 removes the nth next stage More...
 
void replaceVehicleType (MSVehicleType *type)
 Replaces the current vehicle type by the one given. More...
 
virtual void routeOutput (OutputDevice &os) const
 Called on writing vehroute output. More...
 
void setDeparted (SUMOTime now)
 logs depart time of the current stage More...
 
void setSpeed (double speed)
 sets the walking speed (ignored in other stages) More...
 
virtual void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
virtual ~MSPerson ()
 destructor More...
 

Protected Attributes

const SUMOVehicleParameter * myParameter
 the plan of the transportable More...
 
MSTransportablePlan * myPlan
 the plan of the transportable More...
 
MSTransportablePlan::iterator myStep
 the iterator over the route More...
 
MSVehicleType * myVType
 This transportable's type. (mainly used for drawing related information Note sure if it is really necessary. More...
 
bool myWriteEvents
 Whether events shall be written. More...
 

Static Protected Attributes

static const double ROADSIDE_OFFSET
 the offset for computing positions when standing at an edge More...
 

Private Member Functions

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

Detailed Description

The class holds a simulated person together with her movement stages

Definition at line 70 of file MSPerson.h.

Member Typedef Documentation

the structure holding the plan of a transportable

Definition at line 378 of file MSTransportable.h.

Member Enumeration Documentation

Enumerator
WAITING_FOR_DEPART 
WAITING 
MOVING_WITHOUT_VEHICLE 
DRIVING 

Definition at line 64 of file MSTransportable.h.

Constructor & Destructor Documentation

MSPerson::MSPerson ( const SUMOVehicleParameter *  pars,
MSVehicleType *  vtype,
MSTransportable::MSTransportablePlan *  plan 
)

constructor

Definition at line 341 of file MSPerson.cpp.

Referenced by isSelected().

MSPerson::~MSPerson ( )
virtual

destructor

Definition at line 346 of file MSPerson.cpp.

MSPerson::MSPerson ( const MSPerson &  )
private

Invalidated copy constructor.

Member Function Documentation

void MSTransportable::appendStage ( Stage *  stage,
int  next = -1 
)
inherited
const MSEdge* MSTransportable::getArrivalEdge ( ) const
inlineinherited
double MSTransportable::getArrivalPos ( ) const
inlineinherited

returns the final arrival pos

Definition at line 521 of file MSTransportable.h.

References MSTransportable::myPlan.

Referenced by TraCIServerAPI_Person::processSet().

MSTransportable::Stage* MSTransportable::getCurrentStage ( ) const
inlineinherited
std::string MSTransportable::getCurrentStageDescription ( ) const
inlineinherited

Returns the current stage description as a string.

Definition at line 460 of file MSTransportable.h.

Referenced by GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), and MSXMLRawOut::writeTransportable().

SUMOTime MSTransportable::getDesiredDepart ( ) const
inherited
const MSEdge& MSTransportable::getDestination ( ) const
inlineinherited
const std::string & MSTransportable::getID ( ) const
inherited

returns the id of the transportable

Definition at line 390 of file MSTransportable.cpp.

References SUMOVehicleParameter::id, and MSTransportable::myParameter.

Referenced by MSTransportableControl::abortWaitingForVehicle(), MSPModel_Remote::add(), MSPModel_Striping::add(), MSBaseVehicle::addContainer(), MSVehicle::addContainer(), MSBaseVehicle::addPerson(), MSVehicle::addPerson(), MSTransportable::appendStage(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSTransportableControl::erase(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), MSTransportable::getSingularType(), MSPedestrianPushButton::isActiveForEdge(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), MSDevice_Transportable::notifyLeave(), MSPModel_Striping::by_xpos_sorter::operator()(), MSEdge::transportable_by_position_sorter::operator()(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPModel_Striping::PState::PState(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::routeOutput(), MSTransportable::Stage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), routeOutput(), MSContainer::tripInfoOutput(), tripInfoOutput(), MSPModel_Striping::PState::walk(), MSFCDExport::writeTransportable(), and MSXMLRawOut::writeTransportable().

const MSEdge& MSTransportable::getNextDestination ( ) const
inlineinherited

Returns the destination after the current destination.

Definition at line 413 of file MSTransportable.h.

References MSTransportable::myStep.

const std::string & MSPerson::getNextEdge ( ) const

return the list of internal edges if this person is walking and the pedestrian model allows it

Definition at line 379 of file MSPerson.cpp.

References StringUtils::emptyString, Named::getID(), and getNextEdgePtr().

const MSEdge * MSPerson::getNextEdgePtr ( ) const

returns the next edge ptr if this person is walking and the pedestrian model allows it

Definition at line 398 of file MSPerson.cpp.

References MSTransportable::getCurrentStageType(), PedestrianState::getNextEdge(), MSPerson::MSPersonStage_Walking::getPedestrianState(), and MSTransportable::MOVING_WITHOUT_VEHICLE.

Referenced by getNextEdge(), and MSPedestrianPushButton::isActiveForEdge().

int MSTransportable::getNumRemainingStages ( ) const
inherited

Return the number of remaining stages (including the current)

Definition at line 431 of file MSTransportable.cpp.

References MSTransportable::myPlan, and MSTransportable::myStep.

Referenced by MSTransportable::getEdges(), TraCIServerAPI_Person::processGet(), and TraCIServerAPI_Person::processSet().

int MSTransportable::getNumStages ( ) const
inherited

Return the total number stages in this persons plan.

Definition at line 436 of file MSTransportable.cpp.

References MSTransportable::myPlan.

Referenced by MSTransportable::getEdges(), and TraCIServerAPI_Person::processGet().

Position MSTransportable::getPosition ( ) const
virtualinherited
MSVehicleType & MSTransportable::getSingularType ( )
inherited

Replaces the current vehicle type with a new one used by this vehicle only.

If the currently used vehicle type is already marked as being used by this vehicle only, no new type is created.

Returns
The new modifiable vehicle type
See also
MSTransportable::myVType

Definition at line 495 of file MSTransportable.cpp.

References MSVehicleType::buildSingularType(), MSVehicleType::getID(), MSTransportable::getID(), MSVehicleType::isVehicleSpecific(), MSTransportable::myVType, and MSTransportable::replaceVehicleType().

Referenced by MSTransportable::getArrivalEdge(), and TraCIServerAPI_Person::processSet().

double MSTransportable::getSpeed ( ) const
virtualinherited

the current speed of the transportable

Reimplemented in GUIPerson, and GUIContainer.

Definition at line 425 of file MSTransportable.cpp.

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

double MSPerson::getSpeedFactor ( ) const
virtual
StageType MSTransportable::getStageType ( int  next) const
inlineinherited

the stage type for the nth next stage

Definition at line 453 of file MSTransportable.h.

References MSTransportable::Stage::getStageType(), MSTransportable::myPlan, and MSTransportable::myStep.

Referenced by TraCIServerAPI_Person::processGet().

SUMOVehicle* MSTransportable::getVehicle ( ) const
inlineinherited

The vehicle associated with this transportable.

Definition at line 507 of file MSTransportable.h.

References MSTransportable::appendStage(), MSTransportable::removeStage(), and MSTransportable::Stage::setSpeed().

Referenced by TraCIServerAPI_Person::processGet().

double MSTransportable::getWaitingSeconds ( ) const
virtualinherited
virtual bool MSPerson::isSelected ( ) const
inlinevirtual

whether this person is selected in the GUI

Reimplemented in GUIPerson.

Definition at line 300 of file MSPerson.h.

References getSpeedFactor(), MSPerson(), and MSPerson::MSPersonStage_Walking::operator=().

bool MSTransportable::isWaiting4Vehicle ( ) const
inlineinherited

Whether the transportable waits for a vehicle.

Definition at line 502 of file MSTransportable.h.

Referenced by GUIContainer::drawGL(), GUIPerson::drawGL(), GUIContainer::getColorValue(), and GUIPerson::getColorValue().

bool MSTransportable::isWaitingFor ( const std::string &  line) const
inlineinherited

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

Definition at line 497 of file MSTransportable.h.

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

Invalidated assignment operator.

void MSTransportable::replaceVehicleType ( MSVehicleType *  type)
inherited

Replaces the current vehicle type by the one given.

If the currently used vehicle type is marked as being used by this vehicle only, it is deleted, first. The new, given type is then assigned to "myVType".

Parameters
[in]typeThe new vehicle type
See also
MSTransportable::myVType

Definition at line 486 of file MSTransportable.cpp.

References MSNet::getInstance(), MSNet::getVehicleControl(), MSVehicleType::isVehicleSpecific(), MSTransportable::myVType, and MSVehicleControl::removeVType().

Referenced by MSTransportable::getArrivalEdge(), MSTransportable::getSingularType(), and TraCIServerAPI_Person::processSet().

void MSPerson::routeOutput ( OutputDevice &  os) const
virtual

Called on writing vehroute output.

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

Implements MSTransportable.

Definition at line 420 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::getDesiredDepart(), MSTransportable::getID(), MSNet::getInstance(), OutputDevice::lf(), MSTransportable::myPlan, MSTransportable::myStep, OutputDevice::openTag(), SUMO_ATTR_DEPART, SUMO_ATTR_ID, SUMO_TAG_PERSON, time2string(), and OutputDevice::writeAttr().

void MSTransportable::setDeparted ( SUMOTime  now)
inherited

logs depart time of the current stage

Definition at line 400 of file MSTransportable.cpp.

void MSTransportable::setSpeed ( double  speed)
inherited

sets the walking speed (ignored in other stages)

Definition at line 478 of file MSTransportable.cpp.

References MSTransportable::myPlan.

Referenced by TraCIServerAPI_Person::processSet().

void MSPerson::tripInfoOutput ( OutputDevice &  os) const
virtual

Called on writing tripinfo output.

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

Implements MSTransportable.

Definition at line 410 of file MSPerson.cpp.

References OutputDevice::closeTag(), MSTransportable::getDesiredDepart(), MSTransportable::getID(), MSTransportable::myPlan, OutputDevice::openTag(), time2string(), and OutputDevice::writeAttr().

Field Documentation

const SUMOVehicleParameter* MSTransportable::myParameter
protectedinherited
MSVehicleType* MSTransportable::myVType
protectedinherited

This transportable's type. (mainly used for drawing related information Note sure if it is really necessary.

Definition at line 563 of file MSTransportable.h.

Referenced by MSTransportable::getSingularType(), getSpeedFactor(), GUIPerson::getTypeParameterWindow(), MSTransportable::getVehicleType(), MSTransportable::replaceVehicleType(), and MSTransportable::~MSTransportable().

bool MSTransportable::myWriteEvents
protectedinherited

Whether events shall be written.

Definition at line 566 of file MSTransportable.h.

const double MSTransportable::ROADSIDE_OFFSET
staticprotectedinherited

the offset for computing positions when standing at an edge

Definition at line 556 of file MSTransportable.h.

Referenced by MSTransportable::Stage_Waiting::getPosition(), and MSTransportable::Stage_Driving::getPosition().


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