Eclipse SUMO - Simulation of Urban MObility
|
The definition of a single phase of a tls logic. More...
#include <MSPhaseDefinition.h>
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. | |
const std::string & | getState () const |
Returns the state within this phase. | |
const std::vector< std::string > & | getTargetLaneSet () const |
bool | isActuated () const |
bool | isAllRedPhase () const |
Returns whether this phase is an "all red" phase. | |
bool | isCommit () const |
bool | isDecisional () const |
bool | isGreenPhase () const |
Returns whether this phase is a pure "green" phase. | |
bool | isTarget () const |
bool | isTransient () const |
bool | isUndefined () const |
MSPhaseDefinition (SUMOTime _duration, const std::string &state, const std::string &_name="") | |
Constructor. | |
bool | operator!= (const MSPhaseDefinition &pd) |
Comparison operator. | |
void | setName (const std::string &_name) |
void | setState (const std::string &_state) |
virtual | ~MSPhaseDefinition () |
Destructor. | |
Data Fields | |
SUMOTime | duration |
The duration of the phase. | |
SUMOTime | earliestEnd |
The minimum time within the cycle for switching (for coordinated actuation) | |
std::string | earlyTarget |
The condition expression for an early switch into this phase. | |
std::string | finalTarget |
The condition expression for switching into this phase when the active phase must end. | |
SUMOTime | lastDuration |
The previous duration of the phase. | |
SUMOTime | latestEnd |
The maximum time within the cycle for switching (for coordinated actuation) | |
SUMOTime | maxDuration |
The maximum duration of the phase. | |
SUMOTime | minDuration |
The minimum duration of the phase. | |
bool | myCommit |
the phase is a commit, compulsory directive for SOTL policies | |
SUMOTime | myLastEnd |
Stores the timestep when the previous instance of this phase was switched off. | |
SUMOTime | myLastSwitch |
Stores the timestep of the last on-switched of the phase. | |
std::vector< std::string > | myTargetLaneSet |
bool | myTransientNotDecisional |
the phase is a transient one or a decisional one, compulsory directive for SOTL policies | |
bool | myUndefined |
Leaving the phase type as "undefined" lets SOTL policies malfunction. | |
std::string | name |
Optional name or description for the current phase. | |
std::vector< int > | nextPhases |
The index of the phase that suceeds this one (or -1) | |
SUMOTime | red |
for NEMA phase | |
SUMOTime | vehext |
for NEMA phase | |
SUMOTime | yellow |
for NEMA phase | |
Static Public Attributes | |
static const SUMOTime | OVERRIDE_DURATION = TIME2STEPS(-1) |
static const SUMOTime | UNSPECIFIED_DURATION = -1 |
Private Attributes | |
std::string | myState |
The phase definition. | |
The definition of a single phase of a tls logic.
Definition at line 51 of file MSPhaseDefinition.h.
|
inline |
Constructor.
Definition at line 128 of file MSPhaseDefinition.h.
|
inlinevirtual |
Destructor.
Definition at line 149 of file MSPhaseDefinition.h.
|
inline |
Definition at line 171 of file MSPhaseDefinition.h.
References name.
Referenced by GUIJunctionWrapper::drawGL(), Command_SaveTLSProgram::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), GUITrafficLightLogicWrapper::getCurrentPhaseName(), LIBSUMO_NAMESPACE::TrafficLight::getPhaseName(), and GUITrafficLightLogicWrapper::getPopUpMenu().
|
inline |
Definition at line 167 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 212 of file MSPhaseDefinition.h.
References myState.
Referenced by MSActuatedTrafficLightLogic::evalAtomicExpression().
|
inline |
Returns the state within this phase.
Definition at line 155 of file MSPhaseDefinition.h.
References myState.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), NEMALogic::constructTimingAndPhaseDefs(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSProgram::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), MSSwarmTrafficLightLogic::getLaneLightState(), MSActuatedTrafficLightLogic::getMinimumMinDuration(), LIBSUMO_NAMESPACE::TrafficLight::getRedYellowGreenState(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSPedestrianPushButton::loadPushButtons(), TraCIServerAPI_TrafficLight::processGet(), MSDelayBasedTrafficLightLogic::proposeProlongation(), NEMAPhase::setMyNEMAStates(), MSTrafficLightLogic::setTrafficLightSignals(), MSSOTLTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), NEMALogic::trySwitch(), MSRailSignal::updateCurrentPhase(), and MSFullExport::writeTLS().
|
inline |
Definition at line 163 of file MSPhaseDefinition.h.
References myTargetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), and MSPedestrianPushButton::loadPushButtons().
|
inline |
Definition at line 216 of file MSPhaseDefinition.h.
References maxDuration, minDuration, and OVERRIDE_DURATION.
Referenced by MSActuatedTrafficLightLogic::getMinimumMinDuration().
|
inline |
Returns whether this phase is an "all red" phase.
"all red " means in this case that at all streams have red and no stream has yellow.
Definition at line 203 of file MSPhaseDefinition.h.
References myState.
Referenced by GUIViewTraffic::onGamingClick().
|
inline |
Definition at line 262 of file MSPhaseDefinition.h.
References myCommit.
Referenced by MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLCongestionPolicy::decideNextPhase(), and MSSOTLPolicy::decideNextPhase().
|
inline |
Definition at line 255 of file MSPhaseDefinition.h.
References myTransientNotDecisional.
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 186 of file MSPhaseDefinition.h.
References myState.
Referenced by MSActuatedTrafficLightLogic::gapControl(), GUIViewTraffic::onGamingClick(), and MSDelayBasedTrafficLightLogic::trySwitch().
|
inline |
Definition at line 241 of file MSPhaseDefinition.h.
References myTargetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSOTLTrafficLightLogic::setToATargetPhase(), MSSOTLTrafficLightLogic::setupCTS(), and MSSOTLTrafficLightLogic::trySwitch().
|
inline |
Definition at line 248 of file MSPhaseDefinition.h.
References myTransientNotDecisional.
Referenced by MSSOTLTrafficLightLogic::decideNextPhase(), MSSOTLCongestionPolicy::decideNextPhase(), and MSSOTLPolicy::decideNextPhase().
|
inline |
Definition at line 234 of file MSPhaseDefinition.h.
References myUndefined.
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 226 of file MSPhaseDefinition.h.
|
inline |
Definition at line 175 of file MSPhaseDefinition.h.
References name.
Referenced by NEMALogic::constructTimingAndPhaseDefs(), and NEMALogic::trySwitch().
|
inline |
Definition at line 159 of file MSPhaseDefinition.h.
References myState.
Referenced by NEMALogic::constructTimingAndPhaseDefs(), NEMALogic::trySwitch(), and MSRailSignal::updateCurrentPhase().
SUMOTime MSPhaseDefinition::duration |
The duration of the phase.
Definition at line 58 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), NLJunctionControlBuilder::addPhase(), MSSOTLMarchingPolicy::canRelease(), MSSOTLTrafficLightLogic::computeReturnTime(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getOffsetFromIndex(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTrafficLightLogic::loadState(), GUIViewTraffic::onGamingClick(), PushButtonLogic::pushButtonLogic(), LIBSUMO_NAMESPACE::TrafficLight::setPhase(), SigmoidLogic::sigmoidLogic(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
SUMOTime MSPhaseDefinition::earliestEnd |
The minimum time within the cycle for switching (for coordinated actuation)
Definition at line 70 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSTrafficLightLogic::getEarliestEnd(), MSActuatedTrafficLightLogic::getEarliestEnd(), and MSActuatedTrafficLightLogic::initAttributeOverride().
std::string MSPhaseDefinition::earlyTarget |
The condition expression for an early switch into this phase.
Definition at line 76 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSActuatedTrafficLightLogic::decideNextPhaseCustom(), and MSActuatedTrafficLightLogic::initSwitchingRules().
std::string MSPhaseDefinition::finalTarget |
The condition expression for switching into this phase when the active phase must end.
Definition at line 79 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSActuatedTrafficLightLogic::decideNextPhaseCustom(), and MSActuatedTrafficLightLogic::initSwitchingRules().
SUMOTime MSPhaseDefinition::lastDuration |
The previous duration of the phase.
Definition at line 61 of file MSPhaseDefinition.h.
Referenced by MSSOTLWaveTrafficLightLogic::canRelease().
SUMOTime MSPhaseDefinition::latestEnd |
The maximum time within the cycle for switching (for coordinated actuation)
Definition at line 73 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSTrafficLightLogic::getLatestEnd(), MSActuatedTrafficLightLogic::getLatestEnd(), and MSActuatedTrafficLightLogic::initAttributeOverride().
SUMOTime MSPhaseDefinition::maxDuration |
The maximum duration of the phase.
Definition at line 67 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSSOTLPlatoonPolicy::canRelease(), MSActuatedTrafficLightLogic::decideNextPhase(), MSActuatedTrafficLightLogic::getDetectorPriority(), MSTrafficLightLogic::getMaxDur(), MSActuatedTrafficLightLogic::getMaxDur(), MSActuatedTrafficLightLogic::initAttributeOverride(), isActuated(), NEMAPhase::NEMAPhase(), NEMAPhase::recalculateTiming(), LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic(), and MSDelayBasedTrafficLightLogic::trySwitch().
SUMOTime MSPhaseDefinition::minDuration |
The minimum duration of the phase.
Definition at line 64 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSSOTLCongestionPolicy::canRelease(), MSSOTLMarchingPolicy::canRelease(), MSSOTLPhasePolicy::canRelease(), MSSOTLPlatoonPolicy::canRelease(), MSTrafficLightLogic::getMinDur(), MSActuatedTrafficLightLogic::getMinDur(), MSActuatedTrafficLightLogic::initAttributeOverride(), isActuated(), MSActuatedTrafficLightLogic::loadState(), NEMAPhase::NEMAPhase(), NEMAPhase::recalculateTiming(), LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic(), and MSDelayBasedTrafficLightLogic::trySwitch().
bool MSPhaseDefinition::myCommit |
the phase is a commit, compulsory directive for SOTL policies
Definition at line 106 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), and isCommit().
SUMOTime MSPhaseDefinition::myLastEnd |
Stores the timestep when the previous instance of this phase was switched off.
Definition at line 85 of file MSPhaseDefinition.h.
SUMOTime MSPhaseDefinition::myLastSwitch |
Stores the timestep of the last on-switched of the phase.
Definition at line 82 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSSimpleTrafficLightLogic::getEarliest(), MSSimpleTrafficLightLogic::getLatest(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSTrafficLightLogic::getSpentDuration(), MSSOTLTrafficLightLogic::trySwitch(), and MSDelayBasedTrafficLightLogic::trySwitch().
|
private |
The phase definition.
Definition at line 123 of file MSPhaseDefinition.h.
Referenced by getSignalState(), getState(), isAllRedPhase(), isGreenPhase(), operator!=(), and setState().
std::vector<std::string> MSPhaseDefinition::myTargetLaneSet |
Definition at line 119 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), getTargetLaneSet(), and isTarget().
bool MSPhaseDefinition::myTransientNotDecisional |
the phase is a transient one or a decisional one, compulsory directive for SOTL policies
Definition at line 103 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), isDecisional(), and isTransient().
bool MSPhaseDefinition::myUndefined |
Leaving the phase type as "undefined" lets SOTL policies malfunction.
Definition at line 109 of file MSPhaseDefinition.h.
Referenced by isUndefined().
std::string MSPhaseDefinition::name |
Optional name or description for the current phase.
Definition at line 91 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), getName(), operator!=(), and setName().
std::vector<int> MSPhaseDefinition::nextPhases |
The index of the phase that suceeds this one (or -1)
Definition at line 88 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), MSActuatedTrafficLightLogic::decideNextPhaseCustom(), getNextPhases(), MSActuatedTrafficLightLogic::initSwitchingRules(), and LIBSUMO_NAMESPACE::TrafficLight::setProgramLogic().
|
static |
Definition at line 55 of file MSPhaseDefinition.h.
Referenced by MSActuatedTrafficLightLogic::getEarliestEnd(), MSActuatedTrafficLightLogic::getLatestEnd(), MSActuatedTrafficLightLogic::getMaxDur(), MSActuatedTrafficLightLogic::getMinDur(), MSActuatedTrafficLightLogic::initAttributeOverride(), and isActuated().
SUMOTime MSPhaseDefinition::red |
for NEMA phase
Definition at line 97 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), and NEMAPhase::recalculateTiming().
|
static |
SUMOTime MSPhaseDefinition::vehext |
for NEMA phase
Definition at line 100 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), and NEMAPhase::recalculateTiming().
SUMOTime MSPhaseDefinition::yellow |
for NEMA phase
Definition at line 94 of file MSPhaseDefinition.h.
Referenced by NLHandler::addPhase(), and NEMAPhase::recalculateTiming().