SUMO - Simulation of Urban MObility
|
This class switches using the Stretch algorithm. More...
#include <MSTLLogicControl.h>
Data Structures | |
struct | StretchBereichDef |
A definition of a stretch - Bereich. More... | |
Public Member Functions | |
bool | trySwitch (SUMOTime step) |
Determines whether a switch is possible. | |
WAUTSwitchProcedure_Stretch (MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron) | |
Constructor. | |
~WAUTSwitchProcedure_Stretch () | |
Destructor. | |
Protected Member Functions | |
void | adaptLogic (SUMOTime step) |
Determines the destination program's changes and applies them. | |
void | cutLogic (SUMOTime step, SUMOTime startPos, SUMOTime allCutTime) |
Cuts the logic to synchronize. | |
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. | |
int | getStretchAreaNo (MSTrafficLightLogic *from) const |
Returns the number of given Stretch-areas for the given program. | |
StretchBereichDef | getStretchBereichDef (MSTrafficLightLogic *from, int index) const |
Returns the numbered Stretch-area for the given program. | |
bool | isPosAtGSP (SUMOTime currentTime, const MSTrafficLightLogic &logic) |
Checks, whether the position of a signal programm is at the GSP ("GuenstigerUmschaltPunkt") | |
void | stretchLogic (SUMOTime step, SUMOTime startPos, SUMOTime allStretchTime) |
Stretches the logic to synchronize. | |
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_Stretch & | operator= (const WAUTSwitchProcedure_Stretch &) |
Invalidated assignment operator. | |
WAUTSwitchProcedure_Stretch (const WAUTSwitchProcedure_Stretch &) | |
Invalidated copy constructor. |
This class switches using the Stretch algorithm.
Definition at line 685 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 337 of file MSTLLogicControl.cpp.
Destructor.
Definition at line 343 of file MSTLLogicControl.cpp.
MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch | ( | const WAUTSwitchProcedure_Stretch & | ) | [private] |
Invalidated copy constructor.
void MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic | ( | SUMOTime | step | ) | [protected] |
Determines the destination program's changes and applies them.
[in] | step | The current simulation step |
Definition at line 365 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::begin, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end, and TIME2STEPS.
void MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic | ( | SUMOTime | step, |
SUMOTime | startPos, | ||
SUMOTime | allCutTime | ||
) | [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 397 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::begin, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end, MIN2(), and TIME2STEPS.
SUMOTime MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase | ( | MSTrafficLightLogic & | logic, |
SUMOTime | toTime | ||
) | [protected, inherited] |
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 241 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getOffsetFromIndex().
unsigned int MSTLLogicControl::WAUTSwitchProcedure::getGSPValue | ( | const MSTrafficLightLogic & | logic | ) | const [protected, inherited] |
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 222 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getParameterValue().
int MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo | ( | MSTrafficLightLogic * | from | ) | const [protected] |
Returns the number of given Stretch-areas for the given program.
[in] | from | The tls program to get the number of stretch areas from |
Definition at line 502 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::getParameterValue(), and toString().
MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef | ( | MSTrafficLightLogic * | from, |
int | index | ||
) | const [protected] |
Returns the numbered Stretch-area for the given program.
The first area has normally the number "1", not "0"!
[in] | from | The tls program to get the named stretch area from |
[in] | index | The index (identifier) for the area |
Definition at line 512 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::begin, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::fac, MSTrafficLightLogic::getParameterValue(), and toString().
bool MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP | ( | SUMOTime | currentTime, |
const MSTrafficLightLogic & | logic | ||
) | [protected, inherited] |
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 232 of file MSTLLogicControl.cpp.
References MSPhaseDefinition::duration, MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), MSTrafficLightLogic::getNextSwitchTime(), MSTrafficLightLogic::getOffsetFromIndex(), and TIME2STEPS.
WAUTSwitchProcedure_Stretch& MSTLLogicControl::WAUTSwitchProcedure_Stretch::operator= | ( | const WAUTSwitchProcedure_Stretch & | ) | [private] |
Invalidated assignment operator.
void MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic | ( | SUMOTime | step, |
SUMOTime | startPos, | ||
SUMOTime | allStretchTime | ||
) | [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 445 of file MSTLLogicControl.cpp.
References MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::fac, STEPS2TIME, SUMOReal, and TIME2STEPS.
void MSTLLogicControl::WAUTSwitchProcedure::switchToPos | ( | SUMOTime | simStep, |
MSTrafficLightLogic & | logic, | ||
SUMOTime | toTime | ||
) | [protected, inherited] |
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 250 of file MSTLLogicControl.cpp.
References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getPhase().
bool MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch | ( | SUMOTime | step | ) | [virtual] |
Determines whether a switch is possible.
[in] | step | The current simulation step |
Implements MSTLLogicControl::WAUTSwitchProcedure.
Definition at line 347 of file MSTLLogicControl.cpp.
References TIME2STEPS.
MSTLLogicControl& MSTLLogicControl::WAUTSwitchProcedure::myControl [protected, inherited] |
The control the logic belongs to.
Definition at line 584 of file MSTLLogicControl.h.
MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myFrom [protected, inherited] |
The current program of the tls to switch.
Definition at line 572 of file MSTLLogicControl.h.
bool MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron [protected, inherited] |
Information whether to switch synchron (?)
Definition at line 578 of file MSTLLogicControl.h.
MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myTo [protected, inherited] |
The program to switch the tls to.
Definition at line 575 of file MSTLLogicControl.h.
WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT [protected, inherited] |
The WAUT responsible for switching.
Definition at line 581 of file MSTLLogicControl.h.