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

#include <MSContainer.h>

Inheritance diagram for MSContainer:
GUIContainer

Data Structures

class  MSContainerStage
 
class  MSContainerStage_Driving
 
class  MSContainerStage_Tranship
 
class  MSContainerStage_Waiting
 

Public Types

typedef std::vector
< MSContainerStage * > 
MSContainerPlan
 the structure holding the plan of a container More...
 
enum  StageType { DRIVING = 0, WAITING = 1, TRANSHIP = 2 }
 

Public Member Functions

virtual SUMOReal getAngle () const
 return the current angle of the container More...
 
MSContainerStagegetCurrentStage () 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 container More...
 
virtual MSContainerStopgetDepartContainerStop () 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 position on the edge. More...
 
const MSEdgegetFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the container id More...
 
const MSEdgegetNextDestination () const
 Returns the destination after the current destination. More...
 
const SUMOVehicleParametergetParameter () const
 
virtual Position getPosition () const
 Return the Network coordinate of the container. More...
 
virtual SUMOReal getSpeed () const
 the current speed of the container More...
 
const MSVehicleTypegetVehicleType () const
 
virtual SUMOReal getWaitingSeconds () const
 the time this container spent waiting in seconds More...
 
bool isWaiting4Vehicle () const
 Whether the container waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the container waits for a vehicle of the line specified. More...
 
 MSContainer (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSContainerPlan *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 depart time of the current stage More...
 
void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
virtual ~MSContainer ()
 destructor More...
 

Data Fields

const MSEdgelastDestination
 the last destination of the route of the container More...
 

Static Public Attributes

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

Protected Attributes

const SUMOVehicleParametermyParameter
 the plan of the container More...
 
MSContainerPlanmyPlan
 the plan of the container More...
 
MSContainerPlan::iterator myStep
 the iterator over the route More...
 
const MSVehicleTypemyVType
 This container's type. (mainly used for drawing related information Note sure if it is really necessary. More...
 
bool myWriteEvents
 Whether events shall be written. More...
 

Private Member Functions

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

Detailed Description

The class holds a simulated container together with its movement stages

Definition at line 69 of file MSContainer.h.

Member Typedef Documentation

the structure holding the plan of a container

Definition at line 553 of file MSContainer.h.

Member Enumeration Documentation

Enumerator
DRIVING 
WAITING 
TRANSHIP 

Definition at line 71 of file MSContainer.h.

Constructor & Destructor Documentation

MSContainer::MSContainer ( const SUMOVehicleParameter pars,
const MSVehicleType vtype,
MSContainerPlan plan 
)

constructor

Definition at line 470 of file MSContainer.cpp.

References getDestination(), lastDestination, myPlan, and myStep.

MSContainer::~MSContainer ( )
virtual

destructor

Definition at line 476 of file MSContainer.cpp.

References myParameter, and myPlan.

MSContainer::MSContainer ( const MSContainer )
private

Invalidated copy constructor.

Member Function Documentation

SUMOReal MSContainer::getAngle ( ) const
virtual

return the current angle of the container

Reimplemented in GUIContainer.

Definition at line 525 of file MSContainer.cpp.

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

Referenced by GUIContainer::getAngle(), and MSFCDExport::write().

MSContainerStage* MSContainer::getCurrentStage ( ) const
inline

Return the current stage.

Definition at line 641 of file MSContainer.h.

References myStep.

Referenced by MSEdge::container_by_position_sorter::operator()().

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

Returns the current stage description as a string.

Definition at line 636 of file MSContainer.h.

Referenced by GUIContainer::getParameterWindow().

StageType MSContainer::getCurrentStageType ( ) const
inline

the current stage type of the container

Definition at line 631 of file MSContainer.h.

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

MSContainerStop * MSContainer::getDepartContainerStop ( ) const
virtual

Definition at line 540 of file MSContainer.cpp.

SUMOTime MSContainer::getDesiredDepart ( ) const

Returns the desired departure time.

Definition at line 505 of file MSContainer.cpp.

References SUMOVehicleParameter::depart, and myParameter.

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

SUMOReal MSContainer::getEdgePos ( ) const
virtual

Return the position on the edge.

Reimplemented in GUIContainer.

Definition at line 515 of file MSContainer.cpp.

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

Referenced by GUIContainer::getEdgePos(), and MSFCDExport::write().

const MSEdge* MSContainer::getFromEdge ( ) const
inline

Returns the departure edge.

Definition at line 611 of file MSContainer.h.

Referenced by GUIContainer::getParameterWindow(), and MSContainer::MSContainerStage_Driving::routeOutput().

const MSEdge& MSContainer::getNextDestination ( ) const
inline

Returns the destination after the current destination.

Definition at line 601 of file MSContainer.h.

const SUMOVehicleParameter& MSContainer::getParameter ( ) const
inline

Definition at line 677 of file MSContainer.h.

References myParameter.

Referenced by GUIContainer::setFunctionalColor().

Position MSContainer::getPosition ( ) const
virtual

Return the Network coordinate of the container.

Reimplemented in GUIContainer.

Definition at line 520 of file MSContainer.cpp.

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

Referenced by GUIContainer::getPosition(), and MSFCDExport::write().

SUMOReal MSContainer::getSpeed ( ) const
virtual

the current speed of the container

Reimplemented in GUIContainer.

Definition at line 535 of file MSContainer.cpp.

Referenced by GUIContainer::getSpeed(), and MSFCDExport::write().

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

the time this container spent waiting in seconds

Reimplemented in GUIContainer.

Definition at line 530 of file MSContainer.cpp.

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

Referenced by GUIContainer::getWaitingSeconds().

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

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

Definition at line 668 of file MSContainer.h.

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

Invalidated assignment operator.

void MSContainer::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 552 of file MSContainer.cpp.

References getDesiredDepart(), MSContainer::MSContainerStage_Waiting::getUntil(), myPlan, and WAITING.

Referenced by MSContainerControl::erase().

void MSContainer::setDeparted ( SUMOTime  now)

logs depart time of the current stage

Definition at line 510 of file MSContainer.cpp.

void MSContainer::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 545 of file MSContainer.cpp.

References myPlan.

Referenced by MSContainerControl::erase().

Field Documentation

const MSEdge* MSContainer::lastDestination

the last destination of the route of the container

Definition at line 556 of file MSContainer.h.

Referenced by MSContainer().

const SUMOVehicleParameter* MSContainer::myParameter
protected

the plan of the container

Definition at line 560 of file MSContainer.h.

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

MSContainerPlan* MSContainer::myPlan
protected

the plan of the container

Definition at line 567 of file MSContainer.h.

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

MSContainerPlan::iterator MSContainer::myStep
protected

the iterator over the route

Definition at line 570 of file MSContainer.h.

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

const MSVehicleType* MSContainer::myVType
protected

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

Definition at line 564 of file MSContainer.h.

Referenced by getVehicleType().

bool MSContainer::myWriteEvents
protected

Whether events shall be written.

Definition at line 573 of file MSContainer.h.

const SUMOReal MSContainer::ROADSIDE_OFFSET
static

the offset for computing container positions when standing at an edge

Definition at line 78 of file MSContainer.h.

Referenced by MSContainer::MSContainerStage_Driving::getPosition(), and MSContainer::MSContainerStage_Waiting::getPosition().


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