24 #ifndef MSPhaseDefinition_h 25 #define MSPhaseDefinition_h 75 : duration(durationArg), minDuration(durationArg), maxDuration(durationArg),
76 myLastSwitch(0),
state(stateArg) {
89 const std::string& stateArg)
90 : duration(durationArg),
91 myLastSwitch(0),
state(stateArg) {
93 minDuration = minDurationArg < 0 ? durationArg : minDurationArg;
94 maxDuration = maxDurationArg < 0 ? durationArg : maxDurationArg;
118 if (
state.find_first_of(
"gG") == std::string::npos) {
121 if (
state.find_first_of(
"yY") != std::string::npos) {
const std::string & getState() const
Returns the state within this phase.
MSPhaseDefinition(SUMOTime durationArg, const std::string &stateArg)
Constructor.
static OptionsCont & getOptions()
Retrieves the options.
MSPhaseDefinition(SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string &stateArg)
Constructor.
SUMOTime duration
The duration of the phase.
SUMOTime myLastSwitch
Stores the timestep of the last on-switched of the phase.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
SUMOTime string2time(const std::string &r)
bool isGreenPhase() const
Returns whether this phase is a pure "green" phase.
std::string state
The phase definition.
SUMOTime maxDuration
The maximum duration of the phase.
LinkState getSignalState(unsigned int pos) const
Returns the state of the tls signal at the given position.
bool operator!=(const MSPhaseDefinition &pd)
Comparison operator.
SUMOTime minDuration
The minimum duration of the phase.
virtual ~MSPhaseDefinition()
Destructor.
The definition of a single phase of a tls logic.