AnyLogic
Expand
Font size

@AnyLogicInternalAPI
public interface TrafficLightDelegate

Method Summary

Modifier and TypeMethodDescription
doublegetCurrentPhaseElapsedTime()
Returns time elapsed from beginning of the current phase in model time units or -1 if the traffic light is off
intgetCurrentPhaseIndex()
Returns 0-based index of the current phase, or -1 if the traffic light is off
booleanisOn()
Returns true if the traffic light is on, false otherwise
voidswitchToNextPhase()
Switches traffic light to next phase.
voidturnOff()
Turns off traffic light
voidturnOn(double offset)
Turns on traffic light with offset in model time units

Method Details

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