1 package org.opentrafficsim.trafficcontrol;
2
3 import org.djutils.event.LocalEventProducer;
4 import org.djutils.exceptions.Throw;
5 import org.opentrafficsim.core.dsol.OtsSimulatorInterface;
6
7
8
9
10
11
12
13
14
15
16 public abstract class AbstractTrafficController extends LocalEventProducer implements TrafficController
17 {
18
19
20 private static final long serialVersionUID = 20190221L;
21
22
23 private final String id;
24
25
26
27
28
29
30 public AbstractTrafficController(final String id, final OtsSimulatorInterface simulator)
31 {
32 Throw.whenNull(id, "Id may not be null.");
33 this.id = id;
34 fireTimedEvent(TrafficController.TRAFFICCONTROL_CONTROLLER_CREATED,
35 new Object[] {this.id, TrafficController.STARTING_UP}, simulator.getSimulatorTime());
36 }
37
38
39
40
41 @Override
42 public String getId()
43 {
44 return this.id;
45 }
46
47 }