![]() |
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 | |
int | getNextPhase () 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, int nextPhase) | |
Constructor. More... | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg=-1, SUMOTime maxDurationArg=-1, int nextPhase=-1) | |
Constructor In this phase the duration is constrained between min and max duration. More... | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, int nextPhase, bool transient_notdecisional, bool commit, LaneIdVector &targetLaneSetArg) | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, int nextPhase, bool transient_notdecisional, bool commit) | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, int nextPhase, bool transient_notdecisional, bool commit, LaneIdVector &targetLaneSetArg) | |
MSPhaseDefinition (SUMOTime durationArg, const std::string &stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, int nextPhase, 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... | |
int | nextPhase |
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, int nextPhase) |
void | init (SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg, int nextPhase, 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 134 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] | 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 152 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 170 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 188 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 206 of file MSPhaseDefinition.h.
References COMMIT_BIT, MsgHandler::getErrorInstance(), MsgHandler::inform(), init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inline |
Definition at line 226 of file MSPhaseDefinition.h.
References COMMIT_BIT, init(), TARGET_BIT, TRANSIENT_NOTDECISIONAL_BIT, and UNDEFINED_BIT.
|
inlinevirtual |
Destructor.
Definition at line 239 of file MSPhaseDefinition.h.
|
inline |
Definition at line 257 of file MSPhaseDefinition.h.
References nextPhase.
|
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 283 of file MSPhaseDefinition.h.
|
inline |
Returns the state within this phase.
Definition at line 245 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(), 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 253 of file MSPhaseDefinition.h.
References targetLaneSet.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), and MSPedestrianPushButton::loadPushButtons().
|
inlineprivate |
Definition at line 107 of file MSPhaseDefinition.h.
References OptionsCont::getOptions(), nextPhase, and string2time().
Referenced by init(), and MSPhaseDefinition().
|
inlineprivate |
Definition at line 119 of file MSPhaseDefinition.h.
References init().
|
inline |
Definition at line 330 of file MSPhaseDefinition.h.
References COMMIT_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSSOTLTrafficLightLogic::decideNextPhase(), and MSSwarmTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 323 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 268 of file MSPhaseDefinition.h.
Referenced by MSDelayBasedTrafficLightLogic::trySwitch().
|
inline |
Definition at line 309 of file MSPhaseDefinition.h.
References TARGET_BIT.
Referenced by MSSOTLTrafficLightLogic::countVehicles(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLTrafficLightLogic::setToATargetPhase(), MSSOTLTrafficLightLogic::setupCTS(), and MSSOTLTrafficLightLogic::trySwitch().
|
inline |
Definition at line 316 of file MSPhaseDefinition.h.
References TRANSIENT_NOTDECISIONAL_BIT.
Referenced by MSSOTLCongestionPolicy::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), and MSSOTLTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 302 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 294 of file MSPhaseDefinition.h.
References state.
|
inline |
Definition at line 249 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(), 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(), 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(), 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().
int MSPhaseDefinition::nextPhase |
The index of the phase that suceeds this one (or -1)
Definition at line 86 of file MSPhaseDefinition.h.
Referenced by getNextPhase(), and init().
|
private |
Definition at line 95 of file MSPhaseDefinition.h.
|
private |
The phase definition.
Definition at line 90 of file MSPhaseDefinition.h.
Referenced by getState(), and operator!=().
|
private |
Definition at line 105 of file MSPhaseDefinition.h.
Referenced by getTargetLaneSet().