1 package org.opentrafficsim.road.gtu.lane.object;
2
3 import java.rmi.RemoteException;
4
5 import javax.naming.NamingException;
6
7 import org.djunits.unit.LengthUnit;
8 import org.djunits.value.vdouble.scalar.Length;
9 import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
10 import org.opentrafficsim.core.geometry.OTSGeometryException;
11 import org.opentrafficsim.road.gtu.lane.object.animation.TrafficLightAnimation;
12 import org.opentrafficsim.road.network.lane.Lane;
13
14
15
16
17
18
19
20
21
22
23
24 public class OldTrafficLight extends TrafficLight
25 {
26
27
28
29
30
31
32
33
34 public OldTrafficLight(final String id, final Lane lane, final Length.Rel position,
35 final OTSDEVSSimulatorInterface simulator) throws OTSGeometryException
36 {
37 super(AbstractCSEObject.createRectangleOnCSE(lane, position, new Length.Rel(0.5, LengthUnit.METER), lane
38 .getWidth(position).multiplyBy(0.8), new Length.Rel(0.5, LengthUnit.METER)), new Length.Rel(0.5,
39 LengthUnit.METER), TrafficLightColor.RED);
40
41 try
42 {
43 new TrafficLightAnimation(this, simulator);
44 }
45 catch (RemoteException exception)
46 {
47 exception.printStackTrace();
48 }
49 catch (NamingException exception)
50 {
51 exception.printStackTrace();
52 }
53 }
54 }