Class SumoTrafficLightLogic
java.lang.Object
org.eclipse.mosaic.fed.sumo.bridge.api.complex.AbstractSubscriptionResult
org.eclipse.mosaic.fed.sumo.bridge.api.complex.SumoTrafficLightLogic
This class represents a traffic light program based on SUMO definition
as described on https://sumo.dlr.de/docs/Simulation/Traffic_Lights.html#defining_new_tls-programs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A helper class represents the switch phases of the traffic light. -
Field Summary
Fields inherited from class org.eclipse.mosaic.fed.sumo.bridge.api.complex.AbstractSubscriptionResult
id
-
Constructor Summary
ConstructorsConstructorDescriptionSumoTrafficLightLogic
(String logicId, List<SumoTrafficLightLogic.Phase> phases, int currentPhase) Creates a newSumoTrafficLightLogic
object. -
Method Summary
Modifier and TypeMethodDescriptionint
Getter for the Index of the phase.Getter for the Id of the traffic light logic.Getter for the switch phases.
-
Constructor Details
-
SumoTrafficLightLogic
public SumoTrafficLightLogic(String logicId, List<SumoTrafficLightLogic.Phase> phases, int currentPhase) Creates a newSumoTrafficLightLogic
object.- Parameters:
logicId
- The id of the traffic light logic.phases
- List of switch phases.currentPhase
- The index of the phase.
-
-
Method Details
-
getLogicId
Getter for the Id of the traffic light logic.- Returns:
- The logic Id.
-
getPhases
Getter for the switch phases.- Returns:
- List of switch phases.
-
getCurrentPhase
public int getCurrentPhase()Getter for the Index of the phase.- Returns:
- the index of the phase.
-