AnyLogic
Expand
Font size

@AnyLogicInternalAPI
public interface TrafficLightDelegate

Method Summary

All Methods Instance Methods Abstract Methods 
double getCurrentPhaseElapsedTime()
Returns time elapsed from beginning of the current phase in model time units or -1 if the traffic light is off
int getCurrentPhaseIndex()
Returns 0-based index of the current phase, or -1 if the traffic light is off
boolean isOn()
Returns true if the traffic light is on, false otherwise
void switchToNextPhase()
Switches traffic light to next phase.
void turnOff()
Turns off traffic light
void turnOn​(double offset)
Turns on traffic light with offset in model time units
Modifier and Type Method Description

Method Detail

turnOn

void turnOn​(double offset)
Turns on traffic light with offset in model time units
Parameters:
offset - offset in model time units

turnOff

void turnOff()
Turns off traffic light

isOn

boolean isOn()
Returns true if the traffic light is on, false otherwise
Returns:
true if the traffic light is on, false otherwise

getCurrentPhaseIndex

int getCurrentPhaseIndex()
Returns 0-based index of the current phase, or -1 if the traffic light is off
Returns:
0-based index of the current phase, or -1 if the traffic light is off

getCurrentPhaseElapsedTime

double getCurrentPhaseElapsedTime()
Returns time elapsed from beginning of the current phase in model time units or -1 if the traffic light is off
Returns:
time elapsed from beginning of the current phase in model time units or -1 if the traffic light is off

switchToNextPhase

void switchToNextPhase()
Switches traffic light to next phase. Typical use case: current phase has infinite duration and should be switched
How can we improve this article?