![]() |
Eclipse SUMO - Simulation of Urban MObility
|
This class switches using the GSP algorithm. More...
#include <MSTLLogicControl.h>
Public Member Functions | |
| virtual bool | trySwitch (SUMOTime step) |
| Determines whether a switch is possible. | |
| WAUTSwitchProcedure_GSP (MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron) | |
| Constructor. | |
| ~WAUTSwitchProcedure_GSP () | |
| Destructor. | |
Protected Member Functions | |
| void | adaptLogic (SUMOTime step) |
| Stretches the destination program's phase to which the tls was switched. | |
| SUMOTime | getDiffToStartOfPhase (MSTrafficLightLogic &logic, SUMOTime toTime) |
| Returns the difference between a given time and the start of the phase. | |
| SUMOTime | getGSPTime (const MSTrafficLightLogic &logic) const |
| Returns the GSP-value. | |
| bool | isPosAtGSP (SUMOTime currentTime, const MSTrafficLightLogic &logic) |
| Checks, whether the position of a signal programm is at the GSP ("Good Switching Point"). | |
| void | switchToPos (SUMOTime simStep, MSTrafficLightLogic &logic, SUMOTime toTime) |
| switches the given logic directly to the given position | |
Protected Attributes | |
| MSTLLogicControl & | myControl |
| The control the logic belongs to. | |
| MSTrafficLightLogic * | myFrom |
| The current program of the tls to switch. | |
| bool | mySwitchSynchron |
| Information whether to switch synchron (?). | |
| MSTrafficLightLogic * | myTo |
| The program to switch the tls to. | |
| WAUT & | myWAUT |
| The WAUT responsible for switching. | |
This class switches using the GSP algorithm.
Definition at line 643 of file MSTLLogicControl.h.
| MSTLLogicControl::WAUTSwitchProcedure_GSP::WAUTSwitchProcedure_GSP | ( | MSTLLogicControl & | control, |
| WAUT & | waut, | ||
| MSTrafficLightLogic * | from, | ||
| MSTrafficLightLogic * | to, | ||
| bool | synchron ) |
Constructor.
| [in] | control | The responsible tls control |
| [in] | waut | The WAUT to switch |
| [in] | from | The original tls program |
| [in] | to | The destination tls program |
| [in] | synchron | Whether the switch shall be done in synchronuous mode |
Definition at line 346 of file MSTLLogicControl.cpp.
References MSTLLogicControl::MSTLLogicControl(), and MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure().
| MSTLLogicControl::WAUTSwitchProcedure_GSP::~WAUTSwitchProcedure_GSP | ( | ) |
Destructor.
Definition at line 352 of file MSTLLogicControl.cpp.
|
protectedvirtual |
Stretches the destination program's phase to which the tls was switched.
Reimplemented from MSTLLogicControl::WAUTSwitchProcedure.
Definition at line 356 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase(), MSTLLogicControl::WAUTSwitchProcedure::getGSPTime(), MSTLLogicControl::WAUTSwitchProcedure::myControl, and MSTLLogicControl::WAUTSwitchProcedure::myTo.
|
protectedinherited |
Returns the difference between a given time and the start of the phase.
| [in] | logic | The logic to consider |
| [in] | toTime | The time to ask for |
Definition at line 305 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getOffsetFromIndex().
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and switchToPos().
|
protectedinherited |
Returns the GSP-value.
The GSP must be given as a logic's parameter ("GSP").
| [in] | logic | The logic to retrieve the GSP from |
Definition at line 291 of file MSTLLogicControl.cpp.
References Parameterised::getParameter(), and string2time().
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), isPosAtGSP(), and trySwitch().
|
protectedinherited |
Checks, whether the position of a signal programm is at the GSP ("Good Switching Point").
The GSP must be given as a logic's parameter ("GSP"). Not the simulation second, but the phase the GSP lies within is used. If the phase the GSP lies within is the same as the logic's current phase, the result is true.
| [in] | currentTime | The current time step |
| [in] | logic | The logic for which this should be examined |
Definition at line 297 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), getGSPTime(), MSTrafficLightLogic::getOffsetFromIndex(), and MSTrafficLightLogic::getSpentDuration().
Referenced by trySwitch().
|
protectedinherited |
switches the given logic directly to the given position
| [in] | simStep | The current simulation time |
| [in] | logic | The logic to switch |
| [in] | toTime | The time offset within the logic's phases to switch to |
Definition at line 314 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, getDiffToStartOfPhase(), MSTrafficLightLogic::getIndexFromOffset(), MSTrafficLightLogic::getPhase(), and myControl.
Referenced by trySwitch().
|
virtualinherited |
Determines whether a switch is possible.
| [in] | step | The current simulation step |
Reimplemented in MSTLLogicControl::WAUTSwitchProcedure_JustSwitch.
Definition at line 273 of file MSTLLogicControl.cpp.
References adaptLogic(), getGSPTime(), isPosAtGSP(), myFrom, mySwitchSynchron, myTo, and switchToPos().
Referenced by MSTLLogicControl::check2Switch().
|
protectedinherited |
The control the logic belongs to.
Definition at line 596 of file MSTLLogicControl.h.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), switchToPos(), and WAUTSwitchProcedure().
|
protectedinherited |
The current program of the tls to switch.
Definition at line 584 of file MSTLLogicControl.h.
Referenced by trySwitch(), and WAUTSwitchProcedure().
|
protectedinherited |
Information whether to switch synchron (?).
Definition at line 590 of file MSTLLogicControl.h.
Referenced by trySwitch(), and WAUTSwitchProcedure().
|
protectedinherited |
The program to switch the tls to.
Definition at line 587 of file MSTLLogicControl.h.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), trySwitch(), WAUTSwitchProcedure(), and MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch().
|
protectedinherited |
The WAUT responsible for switching.
Definition at line 593 of file MSTLLogicControl.h.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and WAUTSwitchProcedure().