|
| TrafficLightCycle (Delay greenTime, Delay phase) |
| Construct a new TrafficLightCycle object.
|
|
Delay | greenTime () const |
|
Delay | phase () const |
|
bool | isDefault () const |
| Returns true if the cycle has its default values.
|
|
bool | isGreenTimeIncreased () const |
| Returns true if the current green time is greater than the default one.
|
|
bool | isRedTimeIncreased () const |
| Returns true if the current green time is smaller than the default one.
|
|
bool | isGreen (Delay const cycleTime, Delay const counter) const |
| Returns true if the traffic light is green.
|
|
void | reset () |
| Reset the green and phase values to the default values.
|
|
◆ TrafficLightCycle()
dsm::TrafficLightCycle::TrafficLightCycle |
( |
Delay | greenTime, |
|
|
Delay | phase ) |
|
inline |
Construct a new TrafficLightCycle object.
- Parameters
-
greenTime | Delay, the green time |
phase | Delay, the phase |
◆ isGreen()
bool dsm::TrafficLightCycle::isGreen |
( |
Delay const | cycleTime, |
|
|
Delay const | counter ) const |
Returns true if the traffic light is green.
- Parameters
-
cycleTime | Delay, the total time of a red-green cycle |
counter | Delay, the current counter |
- Returns
- true if counter < m_phase || (counter >= m_phase + m_greenTime && counter < cycleTime)
◆ reset()
void dsm::TrafficLightCycle::reset |
( |
| ) |
|
Reset the green and phase values to the default values.
The default values are the values that the cycle had when it was created
The documentation for this class was generated from the following file: