SUMO - Simulation of Urban MObility
|
The definition of a single phase of a tls logic. More...
#include <MSPhaseDefinition.h>
Public Member Functions | |
LinkState | getSignalState (unsigned int pos) const |
Returns the state of the tls signal at the given position. More... | |
const std::string & | getState () const |
Returns the state within this phase. More... | |
bool | isGreenPhase () const |
Returns whether this phase is a pure "green" phase. More... | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg) | |
Constructor. More... | |
MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg) | |
Constructor. More... | |
bool | operator!= (const MSPhaseDefinition &pd) |
Comparison operator. More... | |
virtual | ~MSPhaseDefinition () |
Destructor. More... | |
Data Fields | |
SUMOTime | duration |
The duration of the phase. More... | |
SUMOTime | maxDuration |
The maximum duration of the phase. More... | |
SUMOTime | minDuration |
The minimum duration of the phase. More... | |
SUMOTime | myLastSwitch |
Stores the timestep of the last on-switched of the phase. More... | |
Private Attributes | |
std::string | state |
The phase definition. More... | |
The definition of a single phase of a tls logic.
Definition at line 51 of file MSPhaseDefinition.h.
|
inline |
Constructor.
minDuration and maxDuration are set to duration.
[in] | durationArg | The duration of the phase |
[in] | stateArg | The state in the phase |
Definition at line 74 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), and string2time().
|
inline |
Constructor.
[in] | durationArg | The duration of the phase |
[in] | minDurationArg | The minimum duration of the phase |
[in] | maxDurationArg | The maximum duration of the phase |
[in] | stateArg | The state in the phase |
Definition at line 88 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), and string2time().
|
inlinevirtual |
Destructor.
Definition at line 99 of file MSPhaseDefinition.h.
|
inline |
Returns the state of the tls signal at the given position.
[in] | pos | The position of the signal to return the state for |
Definition at line 132 of file MSPhaseDefinition.h.
References state.
|
inline |
Returns the state within this phase.
Definition at line 105 of file MSPhaseDefinition.h.
References state.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSActuatedTrafficLightLogic::gapControl(), TraCIServerAPI_TLS::processGet(), MSTrafficLightLogic::setTrafficLightSignals(), and MSFullExport::writeTLS().
|
inline |
Returns whether this phase is a pure "green" phase.
"pure green" means in this case that at least one stream has green and no stream has yellow. Such phases are meant to be candidates for being stretched by actuated or agentbased traffic light logics.
Definition at line 117 of file MSPhaseDefinition.h.
References state.
|
inline |
Comparison operator.
Note that only the state must differ, not the duration!
[in] | pd | The phase definition to compare against |
Definition at line 143 of file MSPhaseDefinition.h.
References state.
SUMOTime MSPhaseDefinition::duration |
The duration of the phase.
Definition at line 54 of file MSPhaseDefinition.h.
Referenced by MSSimpleTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_TLS::processSet(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
SUMOTime MSPhaseDefinition::maxDuration |
The maximum duration of the phase.
Definition at line 60 of file MSPhaseDefinition.h.
Referenced by TraCIServerAPI_TLS::processGet().
SUMOTime MSPhaseDefinition::minDuration |
The minimum duration of the phase.
Definition at line 57 of file MSPhaseDefinition.h.
Referenced by MSActuatedTrafficLightLogic::duration(), TraCIServerAPI_TLS::processGet(), and MSActuatedTrafficLightLogic::trySwitch().
SUMOTime MSPhaseDefinition::myLastSwitch |
Stores the timestep of the last on-switched of the phase.
Definition at line 63 of file MSPhaseDefinition.h.
Referenced by MSSimpleTrafficLightLogic::getPhaseIndexAtTime().
|
private |
The phase definition.
Definition at line 150 of file MSPhaseDefinition.h.
Referenced by getSignalState(), getState(), isGreenPhase(), and operator!=().