Class TrafficLightStateChange
java.lang.Object
org.eclipse.mosaic.rti.api.Interaction
org.eclipse.mosaic.interactions.traffic.TrafficLightStateChange
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Interaction>
This extension of
Interaction is intended to be used to
forward a request to change the state of a simulated traffic light.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIdentifies which kind of parameter type is used in this TrafficLightStateChange. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringString identifying the type of this interaction.Fields inherited from class org.eclipse.mosaic.rti.api.Interaction
time -
Constructor Summary
ConstructorsConstructorDescriptionTrafficLightStateChange(long time, String trafficLightGroupId) ConstructsTrafficLightStateChange>. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintdoubleinthashCode()voidreset()Resets the pre-defined parameter type and the corresponding parameters.voidsetCustomState(List<TrafficLightState> stateList) Sets a custom state which will be set for the traffic light.voidsetPhaseIndex(int phaseIndex) Sets index of the new traffic light program phase.voidsetPhaseRemainingDuration(double remainingDuration) Sets the phase remaining duration.voidsetProgramId(String programId) Sets id of the new traffic light program.voidsetProgramWithPhase(String programId, int phaseId) Sets id of the new traffic light program and index of the new phase for the new program.toString()Methods inherited from class org.eclipse.mosaic.rti.api.Interaction
compareTo, createTypeIdentifier, getId, getSenderId, getTime, getTypeId, setSenderId
-
Field Details
-
TYPE_ID
String identifying the type of this interaction.
-
-
Constructor Details
-
TrafficLightStateChange
ConstructsTrafficLightStateChange>. The parameter type is initiallyParamType.Undefined.- Parameters:
time- Timestamp of this interaction, unit: [ns]trafficLightGroupId- traffic light group identifier
-
-
Method Details
-
reset
public void reset()Resets the pre-defined parameter type and the corresponding parameters. The parameter type of thisTrafficLightStateChangechanges toParamType.Undefined. -
setPhaseRemainingDuration
public void setPhaseRemainingDuration(double remainingDuration) Sets the phase remaining duration. The parameter type of thisTrafficLightStateChangechanges toParamType.RemainingDuration.- Parameters:
remainingDuration- new phase remaining duration in millisecond
-
setProgramId
Sets id of the new traffic light program. The parameter type of thisTrafficLightStateChangechanges toParamType.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 thisTrafficLightStateChangechanges toParamType.ChangePhase.- Parameters:
phaseIndex- index of the new traffic light program phase
-
setProgramWithPhase
Sets id of the new traffic light program and index of the new phase for the new program. The parameter type of thisTrafficLightStateChangechanges toParamType.ChangeProgramWithPhase.- Parameters:
programId- index of the new traffic light program
-
setCustomState
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
-
getParameterType
-
getPhaseRemainingDuration
public double getPhaseRemainingDuration() -
getProgramId
-
getPhaseIndex
public int getPhaseIndex() -
getCustomStateList
-
hashCode
public int hashCode()- Overrides:
hashCodein classInteraction
-
equals
- Overrides:
equalsin classInteraction
-
toString
- Overrides:
toStringin classInteraction
-