@@ -33,6 +33,12 @@ namespace dsm {
3333 inline bool isDefault () const {
3434 return m_greenTime == m_defaultValues.first && m_phase == m_defaultValues.second ;
3535 }
36+ // / @brief Returns true if the current green time is greater than the default one
37+ inline bool isGreenTimeIncreased () const {
38+ return m_greenTime > m_defaultValues.first ;
39+ }
40+ // / @brief Returns true if the current green time is smaller than the default one
41+ inline bool isRedTimeIncreased () const { return m_greenTime < m_defaultValues.first ; }
3642 // / @brief Returns true if the traffic light is green
3743 // / @param cycleTime Delay, the total time of a red-green cycle
3844 // / @param counter Delay, the current counter
@@ -131,6 +137,10 @@ namespace dsm {
131137 // / @param direction Direction, the direction
132138 // / @return true if the traffic light is green for the street and direction
133139 bool isGreen (Id const streetId, Direction direction) const ;
140+ // / @brief Returns true if the traffic light has green increased for all the cycles with priority
141+ // / @param priority bool, if true, only the priority streets are considered; else, only the non-priority streets are considered
142+ // / @return true if the traffic light has green increased for all the cycles with priority
143+ bool isFavouringDirection (bool const priority) const ;
134144 // / @brief Resets all traffic light cycles
135145 // / @details For more info, see @ref TrafficLightCycle::reset()
136146 void resetCycles ();
0 commit comments