Eclipse SUMO - Simulation of Urban MObility
|
This class switches using the Stretch algorithm. More...
#include <MSTLLogicControl.h>
Data Structures | |
struct | StretchRange |
A definition of a stretch - Bereich. More... | |
Public Member Functions | |
virtual bool | trySwitch (SUMOTime step) |
Determines whether a switch is possible. More... | |
WAUTSwitchProcedure_Stretch (MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron) | |
Constructor. More... | |
~WAUTSwitchProcedure_Stretch () | |
Destructor. More... | |
Protected Member Functions | |
void | adaptLogic (SUMOTime step) |
Determines the destination program's changes and applies them. More... | |
void | cutLogic (SUMOTime step, SUMOTime startPos, SUMOTime allCutTime) |
Cuts the logic to synchronize. More... | |
SUMOTime | getDiffToStartOfPhase (MSTrafficLightLogic &logic, SUMOTime toTime) |
Returns the difference between a given time and the start of the phase. More... | |
SUMOTime | getGSPTime (const MSTrafficLightLogic &logic) const |
Returns the GSP-value. More... | |
bool | isPosAtGSP (SUMOTime currentTime, const MSTrafficLightLogic &logic) |
Checks, whether the position of a signal programm is at the GSP ("Good Switching Point") More... | |
void | stretchLogic (SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime) |
Stretches the logic to synchronize. More... | |
void | switchToPos (SUMOTime simStep, MSTrafficLightLogic &logic, SUMOTime toTime) |
switches the given logic directly to the given position More... | |
Protected Attributes | |
MSTLLogicControl & | myControl |
The control the logic belongs to. More... | |
MSTrafficLightLogic * | myFrom |
The current program of the tls to switch. More... | |
std::vector< StretchRange > | myStretchRanges |
the given Stretch-areas for the "to" program, this is 0-based indexed, while the input is 1-based More... | |
bool | mySwitchSynchron |
Information whether to switch synchron (?) More... | |
MSTrafficLightLogic * | myTo |
The program to switch the tls to. More... | |
WAUT & | myWAUT |
The WAUT responsible for switching. More... | |
This class switches using the Stretch algorithm.
Definition at line 671 of file MSTLLogicControl.h.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch | ( | 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 372 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchRange::begin, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchRange::end, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchRange::fac, Parameterised::getParameter(), Parameterised::hasParameter(), myStretchRanges, MSTLLogicControl::WAUTSwitchProcedure::myTo, string2time(), StringUtils::toDouble(), and toString().
MSTLLogicControl::WAUTSwitchProcedure_Stretch::~WAUTSwitchProcedure_Stretch | ( | ) |
Destructor.
Definition at line 388 of file MSTLLogicControl.cpp.
|
protectedvirtual |
Determines the destination program's changes and applies them.
[in] | step | The current simulation step |
Reimplemented from MSTLLogicControl::WAUTSwitchProcedure.
Definition at line 392 of file MSTLLogicControl.cpp.
References StringUtils::toDouble().
|
protected |
Cuts the logic to synchronize.
[in] | step | The current simulation step |
[in] | startPos | The position in the destination program to switch to |
[in] | allCutTime | The amount by which the logic shall be cut |
Definition at line 422 of file MSTLLogicControl.cpp.
References MIN2().
|
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 304 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getOffsetFromIndex().
|
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 290 of file MSTLLogicControl.cpp.
References Parameterised::getParameter(), and string2time().
|
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 296 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), MSTrafficLightLogic::getOffsetFromIndex(), and MSTrafficLightLogic::getSpentDuration().
|
protected |
Stretches the logic to synchronize.
[in] | step | The current simulation step |
[in] | startPos | The position in the destination program to switch to |
[in] | allStretchTime | The amount by which the logic shall be streched |
Definition at line 463 of file MSTLLogicControl.cpp.
References STEPS2TIME, TIME2STEPS, TL, StringUtils::toDouble(), toString(), and WRITE_WARNINGF.
|
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 313 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getPhase().
|
virtualinherited |
Determines whether a switch is possible.
[in] | step | The current simulation step |
Reimplemented in MSTLLogicControl::WAUTSwitchProcedure_JustSwitch.
Definition at line 272 of file MSTLLogicControl.cpp.
Referenced by MSTLLogicControl::check2Switch().
|
protectedinherited |
The control the logic belongs to.
Definition at line 596 of file MSTLLogicControl.h.
|
protectedinherited |
The current program of the tls to switch.
Definition at line 584 of file MSTLLogicControl.h.
|
protected |
the given Stretch-areas for the "to" program, this is 0-based indexed, while the input is 1-based
Definition at line 724 of file MSTLLogicControl.h.
Referenced by WAUTSwitchProcedure_Stretch().
|
protectedinherited |
Information whether to switch synchron (?)
Definition at line 590 of file MSTLLogicControl.h.
|
protectedinherited |
The program to switch the tls to.
Definition at line 587 of file MSTLLogicControl.h.
Referenced by WAUTSwitchProcedure_Stretch().
|
protectedinherited |
The WAUT responsible for switching.
Definition at line 593 of file MSTLLogicControl.h.