SUMO - Simulation of Urban MObility
MSTLLogicControl::WAUTSwitchProcedure_Stretch Class Reference

This class switches using the Stretch algorithm. More...

#include <MSTLLogicControl.h>

Inheritance diagram for MSTLLogicControl::WAUTSwitchProcedure_Stretch:
Inheritance graph
Collaboration diagram for MSTLLogicControl::WAUTSwitchProcedure_Stretch:
Collaboration graph

Data Structures

struct  StretchBereichDef
 A definition of a stretch - Bereich. More...
 

Public Member Functions

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...
 
int getGSPValue (const MSTrafficLightLogic &logic) const
 Returns the GSP-value. More...
 
int getStretchAreaNo (MSTrafficLightLogic *from) const
 Returns the number of given Stretch-areas for the given program. More...
 
StretchBereichDef getStretchBereichDef (MSTrafficLightLogic *from, int index) const
 Returns the numbered Stretch-area for the given program. More...
 
bool isPosAtGSP (SUMOTime currentTime, const MSTrafficLightLogic &logic)
 Checks, whether the position of a signal programm is at the GSP ("GuenstigerUmschaltPunkt") 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

MSTLLogicControlmyControl
 The control the logic belongs to. More...
 
MSTrafficLightLogicmyFrom
 The current program of the tls to switch. More...
 
bool mySwitchSynchron
 Information whether to switch synchron (?) More...
 
MSTrafficLightLogicmyTo
 The program to switch the tls to. More...
 
WAUTmyWAUT
 The WAUT responsible for switching. More...
 

Private Member Functions

WAUTSwitchProcedure_Stretchoperator= (const WAUTSwitchProcedure_Stretch &)
 Invalidated assignment operator. More...
 
 WAUTSwitchProcedure_Stretch (const WAUTSwitchProcedure_Stretch &)
 Invalidated copy constructor. More...
 

Detailed Description

This class switches using the Stretch algorithm.

Definition at line 704 of file MSTLLogicControl.h.

Constructor & Destructor Documentation

MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch ( MSTLLogicControl control,
WAUT waut,
MSTrafficLightLogic from,
MSTrafficLightLogic to,
bool  synchron 
)

Constructor.

Parameters
[in]controlThe responsible tls control
[in]wautThe WAUT to switch
[in]fromThe original tls program
[in]toThe destination tls program
[in]synchronWhether the switch shall be done in synchronuous mode

Definition at line 360 of file MSTLLogicControl.cpp.

MSTLLogicControl::WAUTSwitchProcedure_Stretch::~WAUTSwitchProcedure_Stretch ( )

Destructor.

Definition at line 366 of file MSTLLogicControl.cpp.

MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch ( const WAUTSwitchProcedure_Stretch )
private

Invalidated copy constructor.

Member Function Documentation

SUMOTime MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase ( MSTrafficLightLogic logic,
SUMOTime  toTime 
)
protectedinherited

Returns the difference between a given time and the start of the phase.

Parameters
[in]logicThe logic to consider
[in]toTimeThe time to ask for
Returns
How much time elapsed between the last pahse start and the given time

Definition at line 264 of file MSTLLogicControl.cpp.

References MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getOffsetFromIndex().

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), cutLogic(), and stretchLogic().

int MSTLLogicControl::WAUTSwitchProcedure::getGSPValue ( const MSTrafficLightLogic logic) const
protectedinherited

Returns the GSP-value.

The GSP must be given as a logic's parameter ("GSP").

Parameters
[in]logicThe logic to retrieve the GSP from
Returns
The GSP value; 0 if not given.
See also
MSTrafficLightLogic::getParameterValue

Definition at line 245 of file MSTLLogicControl.cpp.

References TplConvert::_2int(), and Parameterised::getParameter().

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and trySwitch().

int MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo ( MSTrafficLightLogic from) const
protected

Returns the number of given Stretch-areas for the given program.

Parameters
[in]fromThe tls program to get the number of stretch areas from
Returns
The number of stretch areas

Definition at line 529 of file MSTLLogicControl.cpp.

References Parameterised::getParameter(), and toString().

Referenced by adaptLogic(), cutLogic(), and stretchLogic().

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"!

Parameters
[in]fromThe tls program to get the named stretch area from
[in]indexThe index (identifier) for the area
Returns
The definition of the stretch area

Definition at line 539 of file MSTLLogicControl.cpp.

References TplConvert::_2SUMOReal(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::begin, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::end, MSTLLogicControl::WAUTSwitchProcedure_Stretch::StretchBereichDef::fac, Parameterised::getParameter(), and toString().

Referenced by adaptLogic(), cutLogic(), and stretchLogic().

bool MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP ( SUMOTime  currentTime,
const MSTrafficLightLogic logic 
)
protectedinherited

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.

Parameters
[in]currentTimeThe current time step
[in]logicThe logic for which this should be examined
Returns
Whether the current step is the GSP
See also
getGSPValue

Definition at line 255 of file MSTLLogicControl.cpp.

References MSPhaseDefinition::duration, MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), MSTrafficLightLogic::getNextSwitchTime(), MSTrafficLightLogic::getOffsetFromIndex(), and TIME2STEPS.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and trySwitch().

WAUTSwitchProcedure_Stretch& MSTLLogicControl::WAUTSwitchProcedure_Stretch::operator= ( const WAUTSwitchProcedure_Stretch )
private

Invalidated assignment operator.

void MSTLLogicControl::WAUTSwitchProcedure::switchToPos ( SUMOTime  simStep,
MSTrafficLightLogic logic,
SUMOTime  toTime 
)
protectedinherited

switches the given logic directly to the given position

Parameters
[in]simStepThe current simulation time
[in]logicThe logic to switch
[in]toTimeThe time offset within the logic's phases to switch to

Definition at line 273 of file MSTLLogicControl.cpp.

References MSTrafficLightLogic::changeStepAndDuration(), MSPhaseDefinition::duration, MSTrafficLightLogic::getIndexFromOffset(), and MSTrafficLightLogic::getPhase().

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and trySwitch().

bool MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch ( SUMOTime  step)
virtual

Field Documentation

MSTLLogicControl& MSTLLogicControl::WAUTSwitchProcedure::myControl
protectedinherited

The control the logic belongs to.

Definition at line 603 of file MSTLLogicControl.h.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), cutLogic(), and stretchLogic().

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myFrom
protectedinherited

The current program of the tls to switch.

Definition at line 591 of file MSTLLogicControl.h.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and trySwitch().

bool MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
protectedinherited

Information whether to switch synchron (?)

Definition at line 597 of file MSTLLogicControl.h.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and trySwitch().

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myTo
protectedinherited
WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT
protectedinherited

The WAUT responsible for switching.

Definition at line 600 of file MSTLLogicControl.h.

Referenced by stretchLogic().


The documentation for this class was generated from the following files: