Eclipse SUMO - Simulation of Urban MObility
MSTLLogicControl::WAUTSwitchProcedure_JustSwitch Class Reference

This class simply switches to the next program. More...

#include <MSTLLogicControl.h>

Inheritance diagram for MSTLLogicControl::WAUTSwitchProcedure_JustSwitch:
[legend]
Collaboration diagram for MSTLLogicControl::WAUTSwitchProcedure_JustSwitch:
[legend]

Public Member Functions

bool trySwitch (SUMOTime step)
 Determines whether a switch is possible. More...
 
 WAUTSwitchProcedure_JustSwitch (MSTLLogicControl &control, WAUT &waut, MSTrafficLightLogic *from, MSTrafficLightLogic *to, bool synchron)
 Constructor. More...
 
 ~WAUTSwitchProcedure_JustSwitch ()
 Destructor. More...
 

Protected Member Functions

virtual void adaptLogic (SUMOTime step)
 Changes the destination program's phase to which the tls was switched. 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 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...
 

Detailed Description

This class simply switches to the next program.

Definition at line 613 of file MSTLLogicControl.h.

Constructor & Destructor Documentation

◆ WAUTSwitchProcedure_JustSwitch()

MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::WAUTSwitchProcedure_JustSwitch ( 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 326 of file MSTLLogicControl.cpp.

◆ ~WAUTSwitchProcedure_JustSwitch()

MSTLLogicControl::WAUTSwitchProcedure_JustSwitch::~WAUTSwitchProcedure_JustSwitch ( )

Destructor.

Definition at line 332 of file MSTLLogicControl.cpp.

Member Function Documentation

◆ adaptLogic()

virtual void MSTLLogicControl::WAUTSwitchProcedure::adaptLogic ( SUMOTime  step)
inlineprotectedvirtualinherited

Changes the destination program's phase to which the tls was switched.

Default does nothing, implemented only in the subclasses.

Parameters
[in]stepThe current simulation time

Reimplemented in MSTLLogicControl::WAUTSwitchProcedure_Stretch, and MSTLLogicControl::WAUTSwitchProcedure_GSP.

Definition at line 578 of file MSTLLogicControl.h.

References UNUSED_PARAMETER.

◆ getDiffToStartOfPhase()

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 304 of file MSTLLogicControl.cpp.

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

◆ getGSPTime()

SUMOTime MSTLLogicControl::WAUTSwitchProcedure::getGSPTime ( 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 290 of file MSTLLogicControl.cpp.

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

◆ isPosAtGSP()

bool MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP ( SUMOTime  currentTime,
const MSTrafficLightLogic logic 
)
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.

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 296 of file MSTLLogicControl.cpp.

References MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getDefaultCycleTime(), MSTrafficLightLogic::getOffsetFromIndex(), and MSTrafficLightLogic::getSpentDuration().

◆ switchToPos()

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 313 of file MSTLLogicControl.cpp.

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

◆ trySwitch()

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

Determines whether a switch is possible.

Parameters
[in]stepThe current simulation step
Returns
This implementation alsways returns true

Reimplemented from MSTLLogicControl::WAUTSwitchProcedure.

Definition at line 336 of file MSTLLogicControl.cpp.

Field Documentation

◆ myControl

MSTLLogicControl& MSTLLogicControl::WAUTSwitchProcedure::myControl
protectedinherited

The control the logic belongs to.

Definition at line 596 of file MSTLLogicControl.h.

◆ myFrom

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myFrom
protectedinherited

The current program of the tls to switch.

Definition at line 584 of file MSTLLogicControl.h.

◆ mySwitchSynchron

bool MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
protectedinherited

Information whether to switch synchron (?)

Definition at line 590 of file MSTLLogicControl.h.

◆ myTo

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myTo
protectedinherited

The program to switch the tls to.

Definition at line 587 of file MSTLLogicControl.h.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch().

◆ myWAUT

WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT
protectedinherited

The WAUT responsible for switching.

Definition at line 593 of file MSTLLogicControl.h.


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