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 final String id;
21
22
23
24
25
26
27 public AbstractTrafficController(final String id, final OtsSimulatorInterface simulator)
28 {
29 Throw.whenNull(id, "Id may not be null.");
30 this.id = id;
31 fireTimedEvent(TrafficController.TRAFFICCONTROL_CONTROLLER_CREATED,
32 new Object[] {this.id, TrafficController.STARTING_UP}, simulator.getSimulatorTime());
33 }
34
35
36
37
38 @Override
39 public String getId()
40 {
41 return this.id;
42 }
43
44 }