![]() |
Eclipse 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 | |
const std::string & | getName () const |
const std::vector< int > & | getNextPhases () const |
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, const std::vector< int > &nextPhases, const std::string &name="") | |
Constructor. More... | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::vector< int > &nextPhases, const std::string &name, bool transient_notdecisional, bool commit, LaneIdVector *targetLaneSetArg=nullptr) | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg=-1, SUMOTime maxDurationArg=-1, const std::vector< int > &nextPhases=std::vector< int >(), const std::string &name="") | |
Constructor In this phase the duration is constrained between min and max duration. More... | |
bool | operator!= (const MSPhaseDefinition &pd) |
Comparison operator. More... | |
void | setName (const std::string &_name) |
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... | |
std::string | name |
Optional name or description for the current phase. More... | |
std::vector< int > | nextPhases |
The index of the phase that suceeds this one (or -1) More... | |
Private Member Functions | |
void | init (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::vector< int > nextPhasesArg, const std::string &nameArg) |
void | init (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, const std::vector< int > &nextPhasesArg, const std::string &nameArg, 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 51 of file MSPhaseDefinition.h.
typedef std::vector<std::string> MSPhaseDefinition::LaneIdVector |
Definition at line 66 of file MSPhaseDefinition.h.
typedef std::bitset<4> MSPhaseDefinition::PhaseType |
Definition at line 64 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 141 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), name, nextPhases, phaseType, 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] | stateArg | The state in the phase |
[in] | minDurationArg | The minimum duration of the phase |
[in] | maxDurationArg | The maximum duration of the phase |
Definition at line 159 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), name, nextPhases, phaseType, TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 177 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), name, nextPhases, phaseType, TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inlinevirtual |
Destructor.
Definition at line 193 of file MSPhaseDefinition.h.
|
inline |
Definition at line 215 of file MSPhaseDefinition.h.
References name.
Referenced by GUIJunctionWrapper::drawGL(), GUITrafficLightLogicWrapper::getCurrentPhaseName(), libsumo::TrafficLight::getPhaseName(), and GUITrafficLightLogicWrapper::getPopUpMenu().
|
inline |
Definition at line 211 of file MSPhaseDefinition.h.
References nextPhases.
|
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 245 of file MSPhaseDefinition.h.
References state.
|
inline |
Returns the state within this phase.
Definition at line 199 of file MSPhaseDefinition.h.
References state.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSProgram::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), MSSwarmTrafficLightLogic::getLaneLightState(), libsumo::TrafficLight::getRedYellowGreenState(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSPedestrianPushButton::loadPushButtons(), TraCIServerAPI_TrafficLight::processGet(), MSDelayBasedTrafficLightLogic::proposeProlongation(), MSTrafficLightLogic::setTrafficLightSignals(), MSSOTLTrafficLightLogic::trySwitch(), MSRailSignal::updateCurrentPhase(), and MSFullExport::writeTLS().
|
inline |
Definition at line 207 of file MSPhaseDefinition.h.
References targetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), and MSPedestrianPushButton::loadPushButtons().
|
inlineprivate |
Definition at line 109 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), and string2time().
Referenced by init(), and MSPhaseDefinition().
|
inlineprivate |
Definition at line 123 of file MSPhaseDefinition.h.
References init().
|
inline |
Definition at line 292 of file MSPhaseDefinition.h.
References COMMIT_BIT, and phaseType.
Referenced by MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLCongestionPolicy::decideNextPhase(), and MSSOTLPolicy::decideNextPhase().
|
inline |
Definition at line 285 of file MSPhaseDefinition.h.
References phaseType, and TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLTrafficLightLogic::decideNextPhase(), MSSOTLCongestionPolicy::decideNextPhase(), and MSSOTLPolicy::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 230 of file MSPhaseDefinition.h.
References state.
Referenced by MSDelayBasedTrafficLightLogic::trySwitch().
|
inline |
Definition at line 271 of file MSPhaseDefinition.h.
References phaseType, and TARGET_BIT.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::setToATargetPhase(), MSSOTLTrafficLightLogic::setupCTS(), and MSSOTLTrafficLightLogic::trySwitch().
|
inline |
Definition at line 278 of file MSPhaseDefinition.h.
References phaseType, and TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLTrafficLightLogic::decideNextPhase(), MSSOTLCongestionPolicy::decideNextPhase(), and MSSOTLPolicy::decideNextPhase().
|
inline |
Definition at line 264 of file MSPhaseDefinition.h.
References phaseType, and 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 256 of file MSPhaseDefinition.h.
References state.
|
inline |
Definition at line 219 of file MSPhaseDefinition.h.
References name.
|
inline |
Definition at line 203 of file MSPhaseDefinition.h.
References state.
Referenced by MSRailSignal::updateCurrentPhase().
SUMOTime MSPhaseDefinition::duration |
The duration of the phase.
Definition at line 70 of file MSPhaseDefinition.h.
Referenced by MSSOTLMarchingPolicy::canRelease(), MSSOTLTrafficLightLogic::computeReturnTime(), MSPhasedTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSPhasedTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTrafficLightLogic::getSpentDuration(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), GUIViewTraffic::onGamingClick(), PushButtonLogic::pushButtonLogic(), libsumo::TrafficLight::setPhase(), SigmoidLogic::sigmoidLogic(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
SUMOTime MSPhaseDefinition::lastDuration |
The previous duration of the phase.
Definition at line 73 of file MSPhaseDefinition.h.
Referenced by MSSOTLWaveTrafficLightLogic::canRelease().
SUMOTime MSPhaseDefinition::maxDuration |
The maximum duration of the phase.
Definition at line 79 of file MSPhaseDefinition.h.
Referenced by MSSOTLPlatoonPolicy::canRelease(), MSActuatedTrafficLightLogic::decideNextPhase(), MSActuatedTrafficLightLogic::getDetectorPriority(), and MSDelayBasedTrafficLightLogic::trySwitch().
SUMOTime MSPhaseDefinition::minDuration |
The minimum duration of the phase.
Definition at line 76 of file MSPhaseDefinition.h.
Referenced by MSSOTLCongestionPolicy::canRelease(), MSSOTLMarchingPolicy::canRelease(), MSSOTLPhasePolicy::canRelease(), MSSOTLPlatoonPolicy::canRelease(), MSActuatedTrafficLightLogic::duration(), and MSDelayBasedTrafficLightLogic::trySwitch().
SUMOTime MSPhaseDefinition::myLastSwitch |
Stores the timestep of the last on-switched of the phase.
Definition at line 82 of file MSPhaseDefinition.h.
Referenced by MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSPhasedTrafficLightLogic::getPhaseIndexAtTime(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSDelayBasedTrafficLightLogic::trySwitch(), and MSSOTLTrafficLightLogic::trySwitch().
std::string MSPhaseDefinition::name |
Optional name or description for the current phase.
Definition at line 88 of file MSPhaseDefinition.h.
Referenced by getName(), MSPhaseDefinition(), and setName().
std::vector<int> MSPhaseDefinition::nextPhases |
The index of the phase that suceeds this one (or -1)
Definition at line 85 of file MSPhaseDefinition.h.
Referenced by getNextPhases(), and MSPhaseDefinition().
|
private |
Definition at line 97 of file MSPhaseDefinition.h.
Referenced by isCommit(), isDecisional(), isTarget(), isTransient(), isUndefined(), and MSPhaseDefinition().
|
private |
The phase definition.
Definition at line 92 of file MSPhaseDefinition.h.
Referenced by getSignalState(), getState(), isGreenPhase(), operator!=(), and setState().
|
private |
Definition at line 107 of file MSPhaseDefinition.h.
Referenced by getTargetLaneSet().