Class TrafficLightStateChange

    • Field Detail

      • TYPE_ID

        public static final String TYPE_ID
        String identifying the type of this interaction.
    • Constructor Detail

      • TrafficLightStateChange

        public TrafficLightStateChange​(long time,
                                       String trafficLightGroupId)
        Constructs TrafficLightStateChange>. The parameter type is initially ParamType.Undefined.
        Parameters:
        time - Timestamp of this interaction, unit: [ns]
        trafficLightGroupId - traffic light group identifier
    • Method Detail

      • reset

        public void reset()
        Resets the pre-defined parameter type and the corresponding parameters. The parameter type of this TrafficLightStateChange changes to ParamType.Undefined.
      • setPhaseRemainingDuration

        public void setPhaseRemainingDuration​(double remainingDuration)
        Sets the phase remaining duration. The parameter type of this TrafficLightStateChange changes to ParamType.RemainingDuration.
        Parameters:
        remainingDuration - new phase remaining duration in millisecond
      • setProgramId

        public void setProgramId​(String programId)
        Sets id of the new traffic light program. The parameter type of this TrafficLightStateChange changes to ParamType.ProgramId.
        Parameters:
        programId - id of the new traffic light program
      • setPhaseIndex

        public void setPhaseIndex​(int phaseIndex)
        Sets index of the new traffic light program phase. The parameter type of this TrafficLightStateChange changes to ParamType.ChangePhase.
        Parameters:
        phaseIndex - index of the new traffic light program phase
      • setProgramWithPhase

        public void setProgramWithPhase​(String programId,
                                        int phaseId)
        Sets id of the new traffic light program and index of the new phase for the new program. The parameter type of this TrafficLightStateChange changes to ParamType.ChangeProgramWithPhase.
        Parameters:
        programId - index of the new traffic light program
      • setCustomState

        public void setCustomState​(List<TrafficLightState> stateList)
        Sets a custom state which will be set for the traffic light.
        Parameters:
        stateList - the list of states for all traffic lights of the group
      • getTrafficLightGroupId

        public String getTrafficLightGroupId()
      • getPhaseRemainingDuration

        public double getPhaseRemainingDuration()
      • getProgramId

        public String getProgramId()
      • getPhaseIndex

        public int getPhaseIndex()