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 enum
Identifies which kind of parameter type is used in this TrafficLightStateChange. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
String 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 TypeMethodDescriptionboolean
int
double
int
hashCode()
void
reset()
Resets the pre-defined parameter type and the corresponding parameters.void
setCustomState
(List<TrafficLightState> stateList) Sets a custom state which will be set for the traffic light.void
setPhaseIndex
(int phaseIndex) Sets index of the new traffic light program phase.void
setPhaseRemainingDuration
(double remainingDuration) Sets the phase remaining duration.void
setProgramId
(String programId) Sets id of the new traffic light program.void
setProgramWithPhase
(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 thisTrafficLightStateChange
changes toParamType.Undefined
. -
setPhaseRemainingDuration
public void setPhaseRemainingDuration(double remainingDuration) Sets the phase remaining duration. The parameter type of thisTrafficLightStateChange
changes toParamType.RemainingDuration
.- Parameters:
remainingDuration
- new phase remaining duration in millisecond
-
setProgramId
Sets id of the new traffic light program. The parameter type of thisTrafficLightStateChange
changes 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 thisTrafficLightStateChange
changes 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 thisTrafficLightStateChange
changes 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:
hashCode
in classInteraction
-
equals
- Overrides:
equals
in classInteraction
-
toString
- Overrides:
toString
in classInteraction
-