![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Class realising the switch between the traffic light phases. More...
#include <MSTrafficLightLogic.h>
Public Member Functions | |
| void | deschedule (MSTrafficLightLogic *tlLogic) |
| Marks this swicth as invalid (if the phase duration has changed, f.e.). | |
| SUMOTime | execute (SUMOTime currentTime) |
| Executes the regarded junction's "trySwitch"- method. | |
| SUMOTime | getNextSwitchTime () const |
| Returns the assumed next switch time. | |
| SUMOTime | shiftTime (SUMOTime currentTime, SUMOTime execTime, SUMOTime newTime) |
| Reschedule or deschedule the command when quick-loading state. | |
| SwitchCommand (MSTLLogicControl &tlcontrol, MSTrafficLightLogic *tlLogic, SUMOTime nextSwitch) | |
| Constructor. | |
| ~SwitchCommand () | |
| Destructor. | |
Data Fields | |
| int | priority = 0 |
Private Member Functions | |
| SwitchCommand & | operator= (const SwitchCommand &) |
| Invalidated assignment operator. | |
| SwitchCommand (const SwitchCommand &) | |
| Invalidated copy constructor. | |
Private Attributes | |
| bool | myAmValid |
| Information whether this switch command is still valid. | |
| SUMOTime | myAssumedNextSwitch |
| Assumed switch time (may change in case of adaptive traffic lights). | |
| MSTLLogicControl & | myTLControl |
| The responsible traffic lights control. | |
| MSTrafficLightLogic * | myTLLogic |
| The logic to be executed on a switch. | |
Class realising the switch between the traffic light phases.
Definition at line 441 of file MSTrafficLightLogic.h.
| MSTrafficLightLogic::SwitchCommand::SwitchCommand | ( | MSTLLogicControl & | tlcontrol, |
| MSTrafficLightLogic * | tlLogic, | ||
| SUMOTime | nextSwitch ) |
Constructor.
| [in] | tlcontrol | The responsible traffic lights control |
| [in] | tlLogic | The controlled tls logic |
| [in] | duration | Duration till next switch |
Definition at line 54 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::MSTrafficLightLogic(), myAmValid, myAssumedNextSwitch, myTLControl, myTLLogic, and Command::priority.
Referenced by operator=(), and SwitchCommand().
| MSTrafficLightLogic::SwitchCommand::~SwitchCommand | ( | ) |
Destructor.
Definition at line 63 of file MSTrafficLightLogic.cpp.
|
private |
Invalidated copy constructor.
References SwitchCommand().
| void MSTrafficLightLogic::SwitchCommand::deschedule | ( | MSTrafficLightLogic * | tlLogic | ) |
Marks this swicth as invalid (if the phase duration has changed, f.e.).
| [in] | tlLogic | The controlled tls logic |
Definition at line 96 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::MSTrafficLightLogic(), myAmValid, myAssumedNextSwitch, and myTLLogic.
Executes the regarded junction's "trySwitch"- method.
| [in] | currentTime | The current simulation time |
Implements Command.
Definition at line 68 of file MSTrafficLightLogic.cpp.
References MSTLLogicControl::TLSLogicVariants::executeOnSwitchActions(), myAmValid, myAssumedNextSwitch, myTLControl, and myTLLogic.
|
inline |
Returns the assumed next switch time.
Definition at line 471 of file MSTrafficLightLogic.h.
References myAssumedNextSwitch.
|
private |
Invalidated assignment operator.
References SwitchCommand().
|
virtual |
Reschedule or deschedule the command when quick-loading state.
The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.
| [in] | currentTime | The current simulation time |
| [in] | execTime | The time at which the command would have been executed |
| [in] | newTime | The simulation time at which the simulation is restarted |
Reimplemented from Command.
Definition at line 105 of file MSTrafficLightLogic.cpp.
References DELTA_T, myTLLogic, and UNUSED_PARAMETER.
|
private |
Information whether this switch command is still valid.
Definition at line 499 of file MSTrafficLightLogic.h.
Referenced by deschedule(), execute(), and SwitchCommand().
|
private |
Assumed switch time (may change in case of adaptive traffic lights).
Definition at line 496 of file MSTrafficLightLogic.h.
Referenced by deschedule(), execute(), getNextSwitchTime(), and SwitchCommand().
|
private |
The responsible traffic lights control.
Definition at line 490 of file MSTrafficLightLogic.h.
Referenced by execute(), and SwitchCommand().
|
private |
The logic to be executed on a switch.
Definition at line 493 of file MSTrafficLightLogic.h.
Referenced by deschedule(), execute(), shiftTime(), and SwitchCommand().
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().