SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSTLLogicControl::WAUTSwitchProcedure_GSP Class Reference

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

#include <MSTLLogicControl.h>

Inheritance diagram for MSTLLogicControl::WAUTSwitchProcedure_GSP:
MSTLLogicControl::WAUTSwitchProcedure

Public Member Functions

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

Protected Member Functions

void adaptLogic (SUMOTime step)
 Stretches the destination program's phase to which the tls was switched.
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.
bool isPosAtGSP (SUMOTime currentTime, const MSTrafficLightLogic &logic)
 Checks, whether the position of a signal programm is at the GSP ("GuenstigerUmschaltPunkt")
void switchToPos (SUMOTime simStep, MSTrafficLightLogic &logic, SUMOTime toTime)
 switches the given logic directly to the given position

Protected Attributes

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

Private Member Functions

WAUTSwitchProcedure_GSPoperator= (const WAUTSwitchProcedure_GSP &)
 Invalidated assignment operator.
 WAUTSwitchProcedure_GSP (const WAUTSwitchProcedure_GSP &)
 Invalidated copy constructor.

Detailed Description

This class switches using the GSP algorithm.

Definition at line 651 of file MSTLLogicControl.h.

Constructor & Destructor Documentation

MSTLLogicControl::WAUTSwitchProcedure_GSP::WAUTSwitchProcedure_GSP ( 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 305 of file MSTLLogicControl.cpp.

MSTLLogicControl::WAUTSwitchProcedure_GSP::~WAUTSwitchProcedure_GSP ( )

Destructor.

Definition at line 311 of file MSTLLogicControl.cpp.

MSTLLogicControl::WAUTSwitchProcedure_GSP::WAUTSwitchProcedure_GSP ( const WAUTSwitchProcedure_GSP )
private

Invalidated copy constructor.

Member Function Documentation

void MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic ( SUMOTime  step)
protected

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

Definition at line 333 of file MSTLLogicControl.cpp.

References TIME2STEPS.

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

unsigned 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().

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.

WAUTSwitchProcedure_GSP& MSTLLogicControl::WAUTSwitchProcedure_GSP::operator= ( const WAUTSwitchProcedure_GSP )
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().

bool MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch ( SUMOTime  step)
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.

Implements MSTLLogicControl::WAUTSwitchProcedure.

Definition at line 315 of file MSTLLogicControl.cpp.

References TIME2STEPS.

Field Documentation

MSTLLogicControl& MSTLLogicControl::WAUTSwitchProcedure::myControl
protectedinherited

The control the logic belongs to.

Definition at line 594 of file MSTLLogicControl.h.

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myFrom
protectedinherited

The current program of the tls to switch.

Definition at line 582 of file MSTLLogicControl.h.

bool MSTLLogicControl::WAUTSwitchProcedure::mySwitchSynchron
protectedinherited

Information whether to switch synchron (?)

Definition at line 588 of file MSTLLogicControl.h.

MSTrafficLightLogic* MSTLLogicControl::WAUTSwitchProcedure::myTo
protectedinherited

The program to switch the tls to.

Definition at line 585 of file MSTLLogicControl.h.

WAUT& MSTLLogicControl::WAUTSwitchProcedure::myWAUT
protectedinherited

The WAUT responsible for switching.

Definition at line 591 of file MSTLLogicControl.h.


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