SUMO - Simulation of Urban MObility
MSTLLogicControl::WAUTSwitchProcedure Class Referenceabstract

This is the abstract base class for switching from one tls program to another. More...

#include <MSTLLogicControl.h>

Inheritance diagram for MSTLLogicControl::WAUTSwitchProcedure:
Inheritance graph
Collaboration diagram for MSTLLogicControl::WAUTSwitchProcedure:
Collaboration graph

Public Member Functions

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

Protected Member Functions

SUMOTime getDiffToStartOfPhase (MSTrafficLightLogic &logic, SUMOTime toTime)
 Returns the difference between a given time and the start of the phase. More...
 
unsigned int getGSPValue (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 ("GuenstigerUmschaltPunkt") 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

WAUTSwitchProcedureoperator= (const WAUTSwitchProcedure &)
 Invalidated assignment operator. More...
 
 WAUTSwitchProcedure (const WAUTSwitchProcedure &)
 Invalidated copy constructor. More...
 

Detailed Description

This is the abstract base class for switching from one tls program to another.

Definition at line 521 of file MSTLLogicControl.h.

Constructor & Destructor Documentation

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

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 530 of file MSTLLogicControl.h.

virtual MSTLLogicControl::WAUTSwitchProcedure::~WAUTSwitchProcedure ( )
inlinevirtual

Destructor.

Definition at line 537 of file MSTLLogicControl.h.

MSTLLogicControl::WAUTSwitchProcedure::WAUTSwitchProcedure ( const WAUTSwitchProcedure )
private

Invalidated copy constructor.

Member Function Documentation

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

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(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), and MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic().

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").

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(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch().

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.

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 MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch().

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

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 MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch().

virtual bool MSTLLogicControl::WAUTSwitchProcedure::trySwitch ( SUMOTime  step)
pure virtual

Determines whether a switch is possible.

Parameters
[in]stepThe current simulation step
Returns
If a switch shall be done, this method should return true.

Implemented in MSTLLogicControl::WAUTSwitchProcedure_Stretch, MSTLLogicControl::WAUTSwitchProcedure_GSP, and MSTLLogicControl::WAUTSwitchProcedure_JustSwitch.

Referenced by MSTLLogicControl::check2Switch().

Field Documentation

MSTLLogicControl& MSTLLogicControl::WAUTSwitchProcedure::myControl
protected
MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myFrom
protected

The current program of the tls to switch.

Definition at line 589 of file MSTLLogicControl.h.

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

bool MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
protected

Information whether to switch synchron (?)

Definition at line 595 of file MSTLLogicControl.h.

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

WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT
protected

The WAUT responsible for switching.

Definition at line 598 of file MSTLLogicControl.h.

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


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