![]() |
SUMO - Simulation of Urban MObility
|
The definition of a single phase of a tls logic. More...
#include <MSPhaseDefinition.h>

Public Types | |
| typedef std::vector< std::string > | LaneIdVector |
| typedef std::bitset< 4 > | PhaseType |
Public Member Functions | |
| LinkState | getSignalState (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... | |
| const LaneIdVector & | getTargetLaneSet () const |
| bool | isCommit () const |
| bool | isDecisional () const |
| bool | isGreenPhase () const |
| Returns whether this phase is a pure "green" phase. More... | |
| bool | isTarget () const |
| bool | isTransient () const |
| bool | isUndefined () const |
| MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg) | |
| Constructor. More... | |
| MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg) | |
| Constructor In this phase the duration is constrained between min and max duration. More... | |
| MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, bool transient_notdecisional, bool commit, LaneIdVector &targetLaneSetArg) | |
| MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, bool transient_notdecisional, bool commit) | |
| MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, bool transient_notdecisional, bool commit, LaneIdVector &targetLaneSetArg) | |
| MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, bool transient_notdecisional, bool commit) | |
| bool | operator!= (const MSPhaseDefinition &pd) |
| Comparison operator. More... | |
| void | setState (const std::string &_state) |
| virtual | ~MSPhaseDefinition () |
| Destructor. More... | |
Data Fields | |
| SUMOTime | duration |
| The duration of the phase. More... | |
| SUMOTime | lastDuration |
| The previous 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 Member Functions | |
| void | init (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg) |
| void | init (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, LaneIdVector &targetLaneSetArg) |
Private Attributes | |
| PhaseType | phaseType |
| std::string | state |
| The phase definition. More... | |
| LaneIdVector | targetLaneSet |
The definition of a single phase of a tls logic.
Definition at line 52 of file MSPhaseDefinition.h.
| typedef std::vector<std::string> MSPhaseDefinition::LaneIdVector |
Definition at line 67 of file MSPhaseDefinition.h.
| typedef std::bitset<4> MSPhaseDefinition::PhaseType |
Definition at line 65 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 130 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Constructor In this phase the duration is constrained between min and max duration.
| [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 148 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 166 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 184 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 202 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 222 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inlinevirtual |
Destructor.
Definition at line 235 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 275 of file MSPhaseDefinition.h.
|
inline |
Returns the state within this phase.
Definition at line 241 of file MSPhaseDefinition.h.
References state.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSActuatedTrafficLightLogic::gapControl(), libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(), MSSwarmTrafficLightLogic::getLaneLightState(), libsumo::TrafficLight::getRedYellowGreenState(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSPedestrianPushButton::loadPushButtons(), TraCIServerAPI_TrafficLight::processGet(), MSDelayBasedTrafficLightLogic::proposeProlongation(), MSTrafficLightLogic::setTrafficLightSignals(), MSSOTLTrafficLightLogic::trySwitch(), and MSFullExport::writeTLS().
|
inline |
Definition at line 249 of file MSPhaseDefinition.h.
References targetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), and MSPedestrianPushButton::loadPushButtons().
|
inlineprivate |
Definition at line 104 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), and string2time().
Referenced by init(), and MSPhaseDefinition().
|
inlineprivate |
Definition at line 115 of file MSPhaseDefinition.h.
References init().
|
inline |
Definition at line 322 of file MSPhaseDefinition.h.
References COMMIT_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSSOTLTrafficLightLogic::decideNextPhase(), and MSSwarmTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 315 of file MSPhaseDefinition.h.
References TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), and MSSOTLTrafficLightLogic::decideNextPhase().
|
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 260 of file MSPhaseDefinition.h.
Referenced by MSDelayBasedTrafficLightLogic::trySwitch().
|
inline |
Definition at line 301 of file MSPhaseDefinition.h.
References TARGET_BIT.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::setToATargetPhase(), MSSOTLTrafficLightLogic::setupCTS(), and MSSOTLTrafficLightLogic::trySwitch().
|
inline |
Definition at line 308 of file MSPhaseDefinition.h.
References TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), and MSSOTLTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 294 of file MSPhaseDefinition.h.
References UNDEFINED_BIT.
Referenced by MSSOTLTrafficLightLogic::checkPhases().
|
inline |
Comparison operator.
Note that only the state must differ, not the duration!
| [in] | pd | The phase definition to compare against |
Definition at line 286 of file MSPhaseDefinition.h.
References state.
|
inline |
Definition at line 245 of file MSPhaseDefinition.h.
Referenced by MSRailSignal::updateCurrentPhase().
| SUMOTime MSPhaseDefinition::duration |
The duration of the phase.
Definition at line 71 of file MSPhaseDefinition.h.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSSOTLMarchingPolicy::canRelease(), MSSOTLTrafficLightLogic::computeReturnTime(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(), MSPhasedTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSPhasedTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTrafficLightLogic::getSpentDuration(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), GUIViewTraffic::onGamingClick(), PushButtonLogic::pushButtonLogic(), libsumo::TrafficLight::setPhase(), SigmoidLogic::sigmoidLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
| SUMOTime MSPhaseDefinition::lastDuration |
The previous duration of the phase.
Definition at line 74 of file MSPhaseDefinition.h.
Referenced by MSSOTLWaveTrafficLightLogic::canRelease().
| SUMOTime MSPhaseDefinition::maxDuration |
The maximum duration of the phase.
Definition at line 80 of file MSPhaseDefinition.h.
Referenced by MSSOTLPlatoonPolicy::canRelease(), libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(), MSDelayBasedTrafficLightLogic::proposeProlongation(), and MSDelayBasedTrafficLightLogic::trySwitch().
| SUMOTime MSPhaseDefinition::minDuration |
The minimum duration of the phase.
Definition at line 77 of file MSPhaseDefinition.h.
Referenced by MSSOTLPhasePolicy::canRelease(), MSSOTLMarchingPolicy::canRelease(), MSSOTLPlatoonPolicy::canRelease(), MSSOTLCongestionPolicy::canRelease(), MSActuatedTrafficLightLogic::duration(), libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(), MSDelayBasedTrafficLightLogic::trySwitch(), and MSActuatedTrafficLightLogic::trySwitch().
| SUMOTime MSPhaseDefinition::myLastSwitch |
Stores the timestep of the last on-switched of the phase.
Definition at line 83 of file MSPhaseDefinition.h.
Referenced by MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSPhasedTrafficLightLogic::getPhaseIndexAtTime(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSDelayBasedTrafficLightLogic::trySwitch(), and MSSOTLTrafficLightLogic::trySwitch().
|
private |
Definition at line 92 of file MSPhaseDefinition.h.
|
private |
The phase definition.
Definition at line 87 of file MSPhaseDefinition.h.
Referenced by getState(), and operator!=().
|
private |
Definition at line 102 of file MSPhaseDefinition.h.
Referenced by getTargetLaneSet().