![]() |
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 throw () |
bool | isCommit () const throw () |
bool | isDecisional () const throw () |
bool | isGreenPhase () const |
Returns whether this phase is a pure "green" phase. More... | |
bool | isTarget () const throw () |
bool | isTransient () const throw () |
bool | isUndefined () const throw () |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg) | |
Constructor. More... | |
MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg) throw () | |
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) throw () | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, bool transient_notdecisional, bool commit) throw () | |
MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, bool transient_notdecisional, bool commit, LaneIdVector &targetLaneSetArg) throw () | |
MSPhaseDefinition (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, bool transient_notdecisional, bool commit) throw () | |
bool | operator!= (const MSPhaseDefinition &pd) |
Comparison operator. More... | |
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 59 of file MSPhaseDefinition.h.
typedef std::vector<std::string> MSPhaseDefinition::LaneIdVector |
Definition at line 74 of file MSPhaseDefinition.h.
typedef std::bitset<4> MSPhaseDefinition::PhaseType |
Definition at line 72 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 136 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 154 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 172 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 190 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 208 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 228 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inlinevirtual |
Destructor.
Definition at line 241 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 277 of file MSPhaseDefinition.h.
|
inline |
Returns the state within this phase.
Definition at line 247 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(), MSSwarmTrafficLightLogic::getLaneLightState(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSPedestrianPushButton::loadPushButtons(), TraCIServerAPI_TLS::processGet(), MSTrafficLightLogic::setTrafficLightSignals(), MSSOTLTrafficLightLogic::trySwitch(), and MSFullExport::writeTLS().
|
inline |
Definition at line 251 of file MSPhaseDefinition.h.
References targetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), and MSPedestrianPushButton::loadPushButtons().
|
inlineprivate |
Definition at line 111 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), and string2time().
Referenced by init(), and MSPhaseDefinition().
|
inlineprivate |
Definition at line 121 of file MSPhaseDefinition.h.
References init().
|
inline |
Definition at line 324 of file MSPhaseDefinition.h.
References COMMIT_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSSOTLTrafficLightLogic::decideNextPhase(), and MSSwarmTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 317 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 262 of file MSPhaseDefinition.h.
|
inline |
Definition at line 303 of file MSPhaseDefinition.h.
References TARGET_BIT.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::setToATargetPhase(), MSSOTLTrafficLightLogic::setupCTS(), and MSSOTLTrafficLightLogic::trySwitch().
|
inline |
Definition at line 310 of file MSPhaseDefinition.h.
References TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), and MSSOTLTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 296 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 288 of file MSPhaseDefinition.h.
References state.
SUMOTime MSPhaseDefinition::duration |
The duration of the phase.
Definition at line 78 of file MSPhaseDefinition.h.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSSOTLMarchingPolicy::canRelease(), MSSOTLTrafficLightLogic::computeReturnTime(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), MSPhasedTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSPhasedTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_TLS::processSet(), PushButtonLogic::pushButtonLogic(), SigmoidLogic::sigmoidLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
SUMOTime MSPhaseDefinition::lastDuration |
The previous duration of the phase.
Definition at line 81 of file MSPhaseDefinition.h.
Referenced by MSSOTLWaveTrafficLightLogic::canRelease().
SUMOTime MSPhaseDefinition::maxDuration |
The maximum duration of the phase.
Definition at line 87 of file MSPhaseDefinition.h.
Referenced by MSSOTLPlatoonPolicy::canRelease(), and TraCIServerAPI_TLS::processGet().
SUMOTime MSPhaseDefinition::minDuration |
The minimum duration of the phase.
Definition at line 84 of file MSPhaseDefinition.h.
Referenced by MSSOTLPhasePolicy::canRelease(), MSSOTLMarchingPolicy::canRelease(), MSSOTLPlatoonPolicy::canRelease(), MSSOTLCongestionPolicy::canRelease(), 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 90 of file MSPhaseDefinition.h.
Referenced by MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSPhasedTrafficLightLogic::getPhaseIndexAtTime(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), and MSSOTLTrafficLightLogic::trySwitch().
|
private |
Definition at line 99 of file MSPhaseDefinition.h.
|
private |
The phase definition.
Definition at line 94 of file MSPhaseDefinition.h.
Referenced by getState(), and operator!=().
|
private |
Definition at line 109 of file MSPhaseDefinition.h.
Referenced by getTargetLaneSet().