Interface TrafficController
- All Superinterfaces:
 Drawable,java.util.EventListener,nl.tudelft.simulation.event.EventListenerInterface,nl.tudelft.simulation.event.EventProducerInterface,Identifiable,InvisibleObjectInterface
- All Known Subinterfaces:
 ActuatedTrafficController
- All Known Implementing Classes:
 AbstractTrafficController,CCOL,FixedTimeController,TrafCOD
public interface TrafficController extends nl.tudelft.simulation.event.EventProducerInterface, nl.tudelft.simulation.event.EventListenerInterface, InvisibleObjectInterface, Identifiable
Interface for traffic light controllers.
 
 Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. 
 BSD-style license. See OpenTrafficSim License.
 
- Version:
 - $Revision$, $LastChangedDate$, by $Author$, initial version Oct 14, 2016 
 - Author:
 - Alexander Verbraeck, Peter Knoppers, Wouter Schakel
 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEING_CLONEDTraffic controller is being cloned.static intNO_STREAMConstant to select variables that have no associated traffic stream.static java.lang.StringOFFTraffic controller is off.static java.lang.StringRUNNINGTraffic controller is running.static java.lang.StringSHUTTING_DOWNTraffic controller is shutting down.static java.lang.StringSTARTING_UPTraffic controller is starting up.static nl.tudelft.simulation.event.EventTypeTRAFFIC_LIGHT_CHANGEDThe timedevent that is fired by a traffic control program when a traffic light must change state.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_CONFLICT_GROUP_CHANGEDThe timed event for pub/sub emitted by a traffic control machine when it changes to another conflict group.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_CONTROLLER_CREATEDThe timed event type for pub/sub that a newly created traffic controller emits.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_CONTROLLER_EVALUATINGThe timed event type for pub/sub that a traffic controller emits when it begins the computations to determine its response to the current input (detector states).
Payload: Object[] { String trafficControllerId }static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_CONTROLLER_WARNINGThe timed event type for pub/sub that a traffic controller uses to convey warnings.
Payload: Object[] { String trafficControllerId, String message }static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_SET_TRACINGThe timed event type that instruct a traffic controller to change the tracing level of a variable.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_STATE_CHANGEDThe timed event for pub/sub emitted by a traffic control machine when it changes state (STARTING_UP, RUNNING, SHUTTING_DOWN, OFF, etc.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_TRACED_VARIABLE_UPDATEDThe timed event type for pub/sub indicating the update of a traced control program variable.static nl.tudelft.simulation.event.EventTypeTRAFFICCONTROL_VARIABLE_CREATEDThe timed event type for pub/sub indicating the creation of a traffic control program variable. - 
Method Summary
Modifier and Type Method Description java.lang.StringgetId()Retrieve the Id of the traffic light controller.Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, removeListenerMethods inherited from interface org.opentrafficsim.core.object.InvisibleObjectInterface
clone, getFullId 
- 
Field Details
- 
STARTING_UP
static final java.lang.String STARTING_UPTraffic controller is starting up. Particular traffic control programs may use additional states not listed here.- See Also:
 - Constant Field Values
 
 - 
BEING_CLONED
static final java.lang.String BEING_CLONEDTraffic controller is being cloned. Particular traffic control programs may use additional states not listed here.- See Also:
 - Constant Field Values
 
 - 
RUNNING
static final java.lang.String RUNNINGTraffic controller is running.- See Also:
 - Constant Field Values
 
 - 
SHUTTING_DOWN
static final java.lang.String SHUTTING_DOWNTraffic controller is shutting down.- See Also:
 - Constant Field Values
 
 - 
OFF
static final java.lang.String OFFTraffic controller is off.- See Also:
 - Constant Field Values
 
 - 
NO_STREAM
static final int NO_STREAMConstant to select variables that have no associated traffic stream.- See Also:
 - Constant Field Values
 
 - 
TRAFFICCONTROL_CONTROLLER_CREATED
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_CONTROLLER_CREATEDThe timed event type for pub/sub that a newly created traffic controller emits.
Payload: Object[] { String trafficControllerId, String initialState } - 
TRAFFICCONTROL_CONTROLLER_EVALUATING
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_CONTROLLER_EVALUATINGThe timed event type for pub/sub that a traffic controller emits when it begins the computations to determine its response to the current input (detector states).
Payload: Object[] { String trafficControllerId } - 
TRAFFICCONTROL_CONTROLLER_WARNING
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_CONTROLLER_WARNINGThe timed event type for pub/sub that a traffic controller uses to convey warnings.
Payload: Object[] { String trafficControllerId, String message } - 
TRAFFICCONTROL_STATE_CHANGED
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_STATE_CHANGEDThe timed event for pub/sub emitted by a traffic control machine when it changes state (STARTING_UP, RUNNING, SHUTTING_DOWN, OFF, etc. The exact set of states may vary depending on the type of traffic control machine.
Payload: Object[] { String trafficControllerId, String oldState, String newState } - 
TRAFFIC_LIGHT_CHANGED
static final nl.tudelft.simulation.event.EventType TRAFFIC_LIGHT_CHANGEDThe timedevent that is fired by a traffic control program when a traffic light must change state.
Payload: Object[] { String trafficControllerId, Integer stream, TrafficLightColor newColor } - 
TRAFFICCONTROL_VARIABLE_CREATED
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_VARIABLE_CREATEDThe timed event type for pub/sub indicating the creation of a traffic control program variable.
Listeners to this event can sendTRAFFICCONTROL_SET_TRACEmessages to set the tracing level of a variable.
Payload: Object[] {String trafficControllerId, String variableId, Integer trafficStream, Double initialValue} - 
TRAFFICCONTROL_SET_TRACING
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_SET_TRACINGThe timed event type that instruct a traffic controller to change the tracing level of a variable.
Payload: Object[] { String trafficControllerId, String variableId, Integer trafficStream, Boolean trace }
Remark 1: an empty string for the variableId sets or clears tracing for all variables associated with the traffic stream.
Remark 2: The stream numberNO_STREAMselects variable(s) that are not associated with a particular traffic stream.
Remark 3: setting the tracing level of a variable changes the amount ofTRAFFICCONTROL_TRACED_VARIABLE_UPDATEDevents sent to all listeners; i.e. it is not possible to affect tracing on a per listener basis. - 
TRAFFICCONTROL_TRACED_VARIABLE_UPDATED
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_TRACED_VARIABLE_UPDATEDThe timed event type for pub/sub indicating the update of a traced control program variable.
Payload: Object[] {String trafficControllerId, String variableId, Integer trafficStream, Double oldValue, Double newValue, String expressionOrDescription}
Remark 1: for variable that are not associated with a particular traffic stream, the trafficStream value shall beNO_STREAM
Remark 2: if the variable is a timer that has just been initialized; newValue will reflect the duration in seconds - 
TRAFFICCONTROL_CONFLICT_GROUP_CHANGED
static final nl.tudelft.simulation.event.EventType TRAFFICCONTROL_CONFLICT_GROUP_CHANGEDThe timed event for pub/sub emitted by a traffic control machine when it changes to another conflict group.
Payload: Object[] { String trafficControllerId, String oldConflictGroupStreams, String newConflictGroupStreams }
Remark 1: a conflict group is described as a space-separated list of traffic stream numbers. The traffic streams within a conflict group should be compatible; i.e. not conflicting.
Remark 2: The value00can be used as a place holder for a stream in a conflict groups that have fewer than the maximum number of traffic streams that occur in any conflict group.
Remark 3: The very first event of this type may use an empty string foroldConflictGroupStreams.
Remark 4: Some traffic control systems may not operate in a conflict group by conflict group fashion and therefore not emit these events. 
 - 
 - 
Method Details
- 
getId
java.lang.String getId()Retrieve the Id of the traffic light controller.- Specified by:
 getIdin interfaceIdentifiable- Returns:
 - String; the id of the traffic light controller
 
 
 -