SUMO - Simulation of Urban MObility
GUITransportableControl Class Reference

GUI-version of the transportable control for building gui persons and containers. More...

#include <GUITransportableControl.h>

Inheritance diagram for GUITransportableControl:
Inheritance graph
Collaboration diagram for GUITransportableControl:
Collaboration graph

Public Types

typedef std::map< std::string, MSTransportable * >::const_iterator constVehIt
 Definition of the internal transportables map iterator. More...
 
typedef std::vector< MSTransportable * > TransportableVector
 Definition of a list of transportables. More...
 

Public Member Functions

void abortWaiting ()
 aborts the plan for any transportable that is still waiting for a ride More...
 
bool add (MSTransportable *transportable)
 Adds a single transportable, returns false if an id clash occured. More...
 
void addWaiting (const MSEdge *edge, MSTransportable *person)
 adds a transportable to the list of transportables waiting for a vehicle on the specified edge More...
 
bool boardAnyWaiting (MSEdge *edge, MSVehicle *vehicle, MSVehicle::Stop *stop)
 board any applicable persons Boards any people who wait on that edge for the given vehicle and removes them from myWaiting More...
 
virtual MSTransportablebuildContainer (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
 Builds a new container. More...
 
virtual MSTransportablebuildPerson (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
 Builds a new person. More...
 
void checkWaiting (MSNet *net, const SUMOTime time)
 checks whether any transportables waiting time is over More...
 
virtual void erase (MSTransportable *transportable)
 removes a single transportable More...
 
MSTransportableget (const std::string &id) const
 Returns the named transportable, if existing. More...
 
 GUITransportableControl ()
 constructor More...
 
bool hasNonWaiting () const
 checks whether any transportable is still engaged in walking / stopping More...
 
bool hasTransportables () const
 checks whether any transportable waits to finish her plan More...
 
void insertPersonIDs (std::vector< GUIGlID > &into)
 Returns the list of all known persons by gl-id. More...
 
bool loadAnyWaiting (MSEdge *edge, MSVehicle *vehicle, MSVehicle::Stop *stop)
 load any applicable containers Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting More...
 
constVehIt loadedBegin () const
 Returns the begin of the internal transportables map. More...
 
constVehIt loadedEnd () const
 Returns the end of the internal transportables map. More...
 
void registerJammed ()
 register a jammed transportable More...
 
void setWaitEnd (SUMOTime time, MSTransportable *transportable)
 sets the arrival time for a waiting transportable More...
 
int size () const
 Returns the number of known transportables. More...
 
virtual ~GUITransportableControl ()
 destructor More...
 
Retrieval of transportable statistics (always accessable)
int getLoadedNumber () const
 Returns the number of build transportables. More...
 
int getRunningNumber () const
 Returns the number of build and inserted, but not yet deleted transportables. More...
 
int getJammedNumber () const
 Returns the number of times a transportables was jammed. More...
 

Protected Attributes

bool myHaveNewWaiting
 whether a new transportable waiting for a vehicle has been added in the last step More...
 
int myJammedNumber
 The number of jammed transportables. More...
 
int myLoadedNumber
 The number of build transportables. More...
 
int myRunningNumber
 The number of transportables within the network (build and inserted but not removed) More...
 
std::map< std::string, MSTransportable * > myTransportables
 all currently created transportables by id More...
 
std::map< SUMOTime, TransportableVectormyWaiting4Departure
 Transportables waiting for departure. More...
 
std::map< const MSEdge *, TransportableVectormyWaiting4Vehicle
 the lists of waiting transportables More...
 
int myWaitingForVehicleNumber
 The number of transportables waiting for vehicles. More...
 
std::map< SUMOTime, TransportableVectormyWaitingUntil
 the lists of walking / stopping transportables More...
 

Detailed Description

GUI-version of the transportable control for building gui persons and containers.

Definition at line 45 of file GUITransportableControl.h.

Member Typedef Documentation

◆ constVehIt

typedef std::map<std::string, MSTransportable*>::const_iterator MSTransportableControl::constVehIt
inherited

Definition of the internal transportables map iterator.

Definition at line 65 of file MSTransportableControl.h.

◆ TransportableVector

Definition of a list of transportables.

Definition at line 62 of file MSTransportableControl.h.

Constructor & Destructor Documentation

◆ GUITransportableControl()

GUITransportableControl::GUITransportableControl ( )

constructor

Definition at line 44 of file GUITransportableControl.cpp.

◆ ~GUITransportableControl()

GUITransportableControl::~GUITransportableControl ( )
virtual

destructor

Definition at line 47 of file GUITransportableControl.cpp.

Member Function Documentation

◆ abortWaiting()

void MSTransportableControl::abortWaiting ( )
inherited

aborts the plan for any transportable that is still waiting for a ride

Definition at line 246 of file MSTransportableControl.cpp.

References MSTransportableControl::erase(), MSTransportable::getID(), MSTransportableControl::myWaiting4Vehicle, MSEdge::removeContainer(), MSEdge::removePerson(), and WRITE_WARNING.

Referenced by MSNet::simulationState().

◆ add()

bool MSTransportableControl::add ( MSTransportable transportable)
inherited

Adds a single transportable, returns false if an id clash occured.

Parameters
[in]transportableThe transportable to add
Returns
Whether the transportable could be added (none with the same id existed before)

Definition at line 68 of file MSTransportableControl.cpp.

References DELTA_T, SUMOVehicleParameter::depart, MSTransportable::getParameter(), SUMOVehicleParameter::id, MSTransportableControl::myLoadedNumber, MSTransportableControl::myTransportables, and MSTransportableControl::myWaiting4Departure.

Referenced by TraCIServerAPI_Person::processSet().

◆ addWaiting()

void MSTransportableControl::addWaiting ( const MSEdge edge,
MSTransportable person 
)
inherited

adds a transportable to the list of transportables waiting for a vehicle on the specified edge

Definition at line 148 of file MSTransportableControl.cpp.

References MSTransportableControl::myHaveNewWaiting, MSTransportableControl::myWaiting4Vehicle, and MSTransportableControl::myWaitingForVehicleNumber.

Referenced by MSContainer::MSContainerStage_Driving::proceed(), and MSPerson::MSPersonStage_Driving::proceed().

◆ boardAnyWaiting()

bool MSTransportableControl::boardAnyWaiting ( MSEdge edge,
MSVehicle vehicle,
MSVehicle::Stop stop 
)
inherited

board any applicable persons Boards any people who wait on that edge for the given vehicle and removes them from myWaiting

Parameters
[in]theedge on which the boarding should take place
[in]thevehicle which is taking on passengers / goods
[in]thestop at which the vehicle is stopping
Returns
Whether any transportables have been boarded

Definition at line 156 of file MSTransportableControl.cpp.

References MSVehicle::addPerson(), DELTA_T, MSVehicle::Stop::duration, MSVehicle::Stop::endPos, MSVehicleType::getBoardingDuration(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSBaseVehicle::getParameter(), MSVehicleType::getPersonCapacity(), MSVehicle::getPersonNumber(), MSBaseVehicle::getVehicleType(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, MSTransportableControl::myWaiting4Vehicle, MSTransportableControl::myWaitingForVehicleNumber, MSEdge::removePerson(), MSVehicle::Stop::startPos, and MSVehicle::Stop::timeToBoardNextPerson.

Referenced by MSVehicle::processNextStop().

◆ buildContainer()

MSTransportable * GUITransportableControl::buildContainer ( const SUMOVehicleParameter pars,
const MSVehicleType vtype,
MSTransportable::MSTransportablePlan plan 
) const
virtual

Builds a new container.

Parameters
[in]parsThe parameter
[in]vtypeThe type (reusing vehicle type container here)
[in]planThis container's plan

Reimplemented from MSTransportableControl.

Definition at line 58 of file GUITransportableControl.cpp.

◆ buildPerson()

MSTransportable * GUITransportableControl::buildPerson ( const SUMOVehicleParameter pars,
const MSVehicleType vtype,
MSTransportable::MSTransportablePlan plan 
) const
virtual

Builds a new person.

Parameters
[in]parsThe parameter
[in]vtypeThe type (reusing vehicle type container here)
[in]planThis person's plan

Reimplemented from MSTransportableControl.

Definition at line 52 of file GUITransportableControl.cpp.

◆ checkWaiting()

void MSTransportableControl::checkWaiting ( MSNet net,
const SUMOTime  time 
)
inherited

◆ erase()

◆ get()

MSTransportable * MSTransportableControl::get ( const std::string &  id) const
inherited

Returns the named transportable, if existing.

Parameters
[in]idThe id of the transportable
Returns
The named transportable, if existing, otherwise 0

Definition at line 82 of file MSTransportableControl.cpp.

References MSTransportableControl::myTransportables.

Referenced by TraCIServerAPI_Person::getPosition(), TraCIServerAPI_Person::processGet(), and TraCIServerAPI_Person::processSet().

◆ getJammedNumber()

int MSTransportableControl::getJammedNumber ( ) const
inlineinherited

Returns the number of times a transportables was jammed.

Returns
The number of times transportables were jammed

Definition at line 193 of file MSTransportableControl.h.

References MSTransportableControl::myJammedNumber.

Referenced by MSNet::closeSimulation(), and GUINet::getParameterWindow().

◆ getLoadedNumber()

int MSTransportableControl::getLoadedNumber ( ) const
inlineinherited

Returns the number of build transportables.

Returns
The number of loaded (build) transportables

Definition at line 178 of file MSTransportableControl.h.

References MSTransportableControl::myLoadedNumber.

Referenced by MSNet::closeSimulation(), and GUINet::getParameterWindow().

◆ getRunningNumber()

int MSTransportableControl::getRunningNumber ( ) const
inlineinherited

Returns the number of build and inserted, but not yet deleted transportables.

Returns
The number of simulated transportables

Definition at line 186 of file MSTransportableControl.h.

References MSTransportableControl::myRunningNumber.

Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), and GUIApplicationWindow::handleEvent_SimulationStep().

◆ hasNonWaiting()

bool MSTransportableControl::hasNonWaiting ( ) const
inherited

◆ hasTransportables()

bool MSTransportableControl::hasTransportables ( ) const
inherited

checks whether any transportable waits to finish her plan

Definition at line 234 of file MSTransportableControl.cpp.

References MSTransportableControl::myTransportables.

Referenced by MSNet::simulationStep(), and MSFCDExport::write().

◆ insertPersonIDs()

void GUITransportableControl::insertPersonIDs ( std::vector< GUIGlID > &  into)

Returns the list of all known persons by gl-id.

Parameters

Definition at line 64 of file GUITransportableControl.cpp.

References MSTransportableControl::myTransportables, and MSTransportable::WAITING_FOR_DEPART.

◆ loadAnyWaiting()

bool MSTransportableControl::loadAnyWaiting ( MSEdge edge,
MSVehicle vehicle,
MSVehicle::Stop stop 
)
inherited

load any applicable containers Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting

Parameters
[in]theedge on which the loading should take place
[in]thevehicle which is taking on containers
Returns
Whether any containers have been loaded

Definition at line 196 of file MSTransportableControl.cpp.

References MSVehicle::addContainer(), MSVehicle::Stop::duration, MSVehicle::Stop::endPos, MSVehicleType::getContainerCapacity(), MSVehicle::getContainerNumber(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSVehicleType::getLoadingDuration(), MSBaseVehicle::getParameter(), MSBaseVehicle::getVehicleType(), SUMOVehicleParameter::id, SUMOVehicleParameter::line, MSTransportableControl::myWaiting4Vehicle, MSTransportableControl::myWaitingForVehicleNumber, MSEdge::removeContainer(), MSVehicle::Stop::startPos, and MSVehicle::Stop::timeToLoadNextContainer.

Referenced by MSVehicle::processNextStop().

◆ loadedBegin()

constVehIt MSTransportableControl::loadedBegin ( ) const
inlineinherited

Returns the begin of the internal transportables map.

Returns
The begin of the internal transportables map

Definition at line 147 of file MSTransportableControl.h.

References MSTransportableControl::myTransportables.

Referenced by TraCIServerAPI_Person::processGet().

◆ loadedEnd()

constVehIt MSTransportableControl::loadedEnd ( ) const
inlineinherited

Returns the end of the internal transportables map.

Returns
The end of the internal transportables map

Definition at line 155 of file MSTransportableControl.h.

References MSTransportableControl::myTransportables.

Referenced by TraCIServerAPI_Person::processGet().

◆ registerJammed()

void MSTransportableControl::registerJammed ( )
inlineinherited

register a jammed transportable

Definition at line 168 of file MSTransportableControl.h.

References MSTransportableControl::myJammedNumber.

Referenced by MSPModel_Striping::PState::walk().

◆ setWaitEnd()

void MSTransportableControl::setWaitEnd ( SUMOTime  time,
MSTransportable transportable 
)
inherited

sets the arrival time for a waiting transportable

Definition at line 109 of file MSTransportableControl.cpp.

References DELTA_T, MSTransportableControl::myWaiting4Departure, and MSTransportableControl::myWaitingUntil.

Referenced by MSTransportable::Stage_Waiting::proceed().

◆ size()

int MSTransportableControl::size ( ) const
inlineinherited

Returns the number of known transportables.

Returns
The number of stored transportables

Definition at line 163 of file MSTransportableControl.h.

References MSTransportableControl::myTransportables.

Referenced by TraCIServerAPI_Person::processGet().

Field Documentation

◆ myHaveNewWaiting

bool MSTransportableControl::myHaveNewWaiting
protectedinherited

whether a new transportable waiting for a vehicle has been added in the last step

Definition at line 225 of file MSTransportableControl.h.

Referenced by MSTransportableControl::addWaiting(), MSTransportableControl::checkWaiting(), and MSTransportableControl::hasNonWaiting().

◆ myJammedNumber

int MSTransportableControl::myJammedNumber
protectedinherited

The number of jammed transportables.

Definition at line 219 of file MSTransportableControl.h.

Referenced by MSTransportableControl::getJammedNumber(), and MSTransportableControl::registerJammed().

◆ myLoadedNumber

int MSTransportableControl::myLoadedNumber
protectedinherited

The number of build transportables.

Definition at line 213 of file MSTransportableControl.h.

Referenced by MSTransportableControl::add(), and MSTransportableControl::getLoadedNumber().

◆ myRunningNumber

int MSTransportableControl::myRunningNumber
protectedinherited

The number of transportables within the network (build and inserted but not removed)

Definition at line 216 of file MSTransportableControl.h.

Referenced by MSTransportableControl::checkWaiting(), MSTransportableControl::erase(), MSTransportableControl::getRunningNumber(), and MSTransportableControl::hasNonWaiting().

◆ myTransportables

◆ myWaiting4Departure

std::map<SUMOTime, TransportableVector> MSTransportableControl::myWaiting4Departure
protectedinherited

◆ myWaiting4Vehicle

std::map<const MSEdge*, TransportableVector> MSTransportableControl::myWaiting4Vehicle
protectedinherited

◆ myWaitingForVehicleNumber

int MSTransportableControl::myWaitingForVehicleNumber
protectedinherited

◆ myWaitingUntil

std::map<SUMOTime, TransportableVector> MSTransportableControl::myWaitingUntil
protectedinherited

the lists of walking / stopping transportables

Definition at line 207 of file MSTransportableControl.h.

Referenced by MSTransportableControl::checkWaiting(), and MSTransportableControl::setWaitEnd().


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