public class CCOL extends EventProducer implements TrafficController
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
listenersBEING_CLONED, NO_STREAM, OFF, RUNNING, SHUTTING_DOWN, STARTING_UP, TRAFFIC_LIGHT_CHANGED, TRAFFICCONTROL_CONFLICT_GROUP_CHANGED, TRAFFICCONTROL_CONTROLLER_CREATED, TRAFFICCONTROL_CONTROLLER_EVALUATING, TRAFFICCONTROL_CONTROLLER_WARNING, TRAFFICCONTROL_SET_TRACING, TRAFFICCONTROL_STATE_CHANGED, TRAFFICCONTROL_TRACED_VARIABLE_UPDATED, TRAFFICCONTROL_VARIABLE_CREATEDFIRST_POSITION, LAST_POSITION| Constructor and Description |
|---|
CCOL(String id,
String controlProgram,
Set<TrafficLight> trafficLights,
Set<TrafficLightSensor> sensors,
DEVSSimulator<Time,Duration,SimTimeDoubleUnit> simulator)
Construct a new CCOL communication link.
|
| Modifier and Type | Method and Description |
|---|---|
InvisibleObjectInterface |
clone(SimulatorInterface.TimeDoubleUnit newSimulator,
Network newNetwork) |
String |
getFullId() |
String |
getId()
Retrieve the Id of the traffic light controller.
|
void |
notify(EventInterface event) |
void |
updateDetector(String detectorId,
boolean detectingGTU)
Tell the traffic controller that the state of a detector has changed.
|
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, addListener, addListener, addListener, removeListenerpublic CCOL(String id, String controlProgram, Set<TrafficLight> trafficLights, Set<TrafficLightSensor> sensors, DEVSSimulator<Time,Duration,SimTimeDoubleUnit> simulator) throws TrafficControlException, SimRuntimeException
id - String; id of the traffic controllercontrolProgram - String; name of the CCOL program that this CCOL link must communicate withtrafficLights - Set<TrafficLight>; the traffic lights. The ids of the traffic lights must end with two digits
that match the stream numbers as used in the traffic control programsensors - Set<TrafficLightSensor>; the traffic sensors. The ids of the traffic sensors must end with three
digits; the first two of those must match the stream and sensor numbers used in the traffic control programsimulator - DEVSSimulator<Time, Duration, SimTimeDoubleUnit>; the simulation engineTrafficControlException - on failure to initialize the connection to the external CCOL programSimRuntimeException - on failure to schedule the first evaluation eventpublic void notify(EventInterface event) throws RemoteException
notify in interface EventListenerInterfaceRemoteExceptionpublic String getId()
getId in interface IdentifiablegetId in interface TrafficControllerpublic String getFullId()
getFullId in interface InvisibleObjectInterfacepublic void updateDetector(String detectorId, boolean detectingGTU)
updateDetector in interface TrafficControllerdetectorId - String; id of the detectordetectingGTU - boolean;public InvisibleObjectInterface clone(SimulatorInterface.TimeDoubleUnit newSimulator, Network newNetwork) throws NetworkException
clone in interface InvisibleObjectInterfaceNetworkExceptionCopyright © 2014–2018 Delft University of Technology. All rights reserved.