|
SUMO - Simulation of Urban MObility
|
This is the abstract base class for switching from one tls program to another. More...
#include <MSTLLogicControl.h>
Public Member Functions | |
| virtual bool | trySwitch (SUMOTime step)=0 |
| Determines whether a switch is possible. | |
| WAUTSwitchProcedure (MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron) | |
| Constructor. | |
| virtual | ~WAUTSwitchProcedure () |
| Destructor. | |
Protected Member Functions | |
| SUMOTime | getDiffToStartOfPhase (MSTrafficLightLogic &logic, SUMOTime toTime) |
| Returns the difference between a given time and the start of the phase. | |
| unsigned int | getGSPValue (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 ("GuenstigerUmschaltPunkt") | |
| 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. | |
Private Member Functions | |
| WAUTSwitchProcedure & | operator= (const WAUTSwitchProcedure &) |
| Invalidated assignment operator. | |
| WAUTSwitchProcedure (const WAUTSwitchProcedure &) | |
| Invalidated copy constructor. | |
This is the abstract base class for switching from one tls program to another.
Definition at line 499 of file MSTLLogicControl.h.
| MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure | ( | MSTLLogicControl & | control, |
| WAUT & | waut, | ||
| MSTrafficLightLogic * | from, | ||
| MSTrafficLightLogic * | to, | ||
| bool | synchron | ||
| ) | [inline] |
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 508 of file MSTLLogicControl.h.
| virtual MSTLLogicControl::WAUTSwitchProcedure::~WAUTSwitchProcedure | ( | ) | [inline, virtual] |
Destructor.
Definition at line 515 of file MSTLLogicControl.h.
| MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure | ( | const WAUTSwitchProcedure & | ) | [private] |
Invalidated copy constructor.
| SUMOTime MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase | ( | MSTrafficLightLogic & | logic, |
| SUMOTime | toTime | ||
| ) | [protected] |
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 234 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getOffsetFromIndex().
| unsigned int MSTLLogicControl::WAUTSwitchProcedure::getGSPValue | ( | const MSTrafficLightLogic & | logic | ) | const [protected] |
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 215 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getParameterValue().
| bool MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP | ( | SUMOTime | currentTime, |
| const MSTrafficLightLogic & | logic | ||
| ) | [protected] |
Checks, whether the position of a signal programm is at the GSP ("GuenstigerUmschaltPunkt")
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 225 of file MSTLLogicControl.cpp.
References MSPhaseDefinition::duration, MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), MSTrafficLightLogic::getNextSwitchTime(), MSTrafficLightLogic::getOffsetFromIndex(), and TIME2STEPS.
| WAUTSwitchProcedure& MSTLLogicControl::WAUTSwitchProcedure::operator= | ( | const WAUTSwitchProcedure & | ) | [private] |
Invalidated assignment operator.
| void MSTLLogicControl::WAUTSwitchProcedure::switchToPos | ( | SUMOTime | simStep, |
| MSTrafficLightLogic & | logic, | ||
| SUMOTime | toTime | ||
| ) | [protected] |
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 243 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getPhase().
Determines whether a switch is possible.
| [in] | step | The current simulation step |
Implemented in MSTLLogicControl::WAUTSwitchProcedure_JustSwitch, MSTLLogicControl::WAUTSwitchProcedure_GSP, and MSTLLogicControl::WAUTSwitchProcedure_Stretch.
Referenced by MSTLLogicControl::check2Switch().
The control the logic belongs to.
Definition at line 579 of file MSTLLogicControl.h.
The current program of the tls to switch.
Definition at line 567 of file MSTLLogicControl.h.
Information whether to switch synchron (?)
Definition at line 573 of file MSTLLogicControl.h.
The program to switch the tls to.
Definition at line 570 of file MSTLLogicControl.h.
WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT [protected] |
The WAUT responsible for switching.
Definition at line 576 of file MSTLLogicControl.h.