Class FixedTimeController
java.lang.Object
org.djutils.event.EventProducer
org.opentrafficsim.trafficcontrol.AbstractTrafficController
org.opentrafficsim.trafficcontrol.FixedTimeController
- All Implemented Interfaces:
java.io.Serializable
,java.util.EventListener
,EventListenerInterface
,EventProducerInterface
,Identifiable
,Drawable
,InvisibleObjectInterface
,TrafficController
public class FixedTimeController extends AbstractTrafficController
Fixed time traffic light control.
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 21 feb. 2019
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FixedTimeController.SignalGroup
Fixed time signal group. -
Field Summary
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
Fields inherited from interface org.opentrafficsim.trafficcontrol.TrafficController
BEING_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_CREATED
-
Constructor Summary
Constructors Constructor Description FixedTimeController(java.lang.String id, OTSSimulatorInterface simulator, Network network, Duration cycleTime, Duration offset, java.util.Set<FixedTimeController.SignalGroup> signalGroups)
Constructor for fixed time traffic controller. -
Method Summary
Modifier and Type Method Description InvisibleObjectInterface
clone(OTSSimulatorInterface newSimulator, Network newNetwork)
Duration
getCycleTime()
java.lang.String
getFullId()
Duration
getOffset()
java.util.Set<FixedTimeController.SignalGroup>
getSignalGroups()
java.io.Serializable
getSourceId()
void
notify(EventInterface event)
java.lang.String
toString()
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, hasListeners, numberOfListeners, removeListener
-
Constructor Details
-
FixedTimeController
public FixedTimeController(java.lang.String id, OTSSimulatorInterface simulator, Network network, Duration cycleTime, Duration offset, java.util.Set<FixedTimeController.SignalGroup> signalGroups) throws SimRuntimeExceptionConstructor for fixed time traffic controller.- Parameters:
id
- String; idsimulator
- OTSSimulatorInterface; simulatornetwork
- Network; networkoffset
- Duration; off set from simulation start timecycleTime
- Duration; cycle timesignalGroups
- Set<SignalGroup>; signal groups- Throws:
SimRuntimeException
- simulator is past zero time
-
-
Method Details
-
notify
- Throws:
java.rmi.RemoteException
-
clone
public InvisibleObjectInterface clone(OTSSimulatorInterface newSimulator, Network newNetwork) throws NetworkException- Throws:
NetworkException
-
getFullId
public java.lang.String getFullId() -
getCycleTime
- Returns:
- cycleTime.
-
getOffset
- Returns:
- offset.
-
getSignalGroups
- Returns:
- signalGroups.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getSourceId
public java.io.Serializable getSourceId()- Specified by:
getSourceId
in interfaceEventProducerInterface
- Specified by:
getSourceId
in classEventProducer
-