1 package org.opentrafficsim.core.gtu.lane;
2
3 import java.rmi.RemoteException;
4 import java.util.Map;
5
6 import nl.tudelft.simulation.dsol.SimRuntimeException;
7
8 import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
9 import org.opentrafficsim.core.gtu.TemplateGTUType;
10 import org.opentrafficsim.core.gtu.following.GTUFollowingModel;
11 import org.opentrafficsim.core.network.NetworkException;
12 import org.opentrafficsim.core.network.lane.Lane;
13 import org.opentrafficsim.core.unit.LengthUnit;
14 import org.opentrafficsim.core.unit.SpeedUnit;
15 import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar;
16
17
18
19
20
21
22
23
24
25
26
27
28 public abstract class AbstractLaneBasedTemplateGTU<ID> extends AbstractLaneBasedGTU<ID>
29 {
30
31 private static final long serialVersionUID = 20140822L;
32
33
34
35
36
37
38
39
40
41
42
43 public AbstractLaneBasedTemplateGTU(final ID id, final TemplateGTUType<?> gtuType,
44 final GTUFollowingModel gtuFollowingModel,
45 final Map<Lane, DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions,
46 final DoubleScalar.Abs<SpeedUnit> initialSpeed) throws RemoteException, NetworkException,
47 SimRuntimeException
48 {
49 super(id, gtuType, gtuFollowingModel, null , initialLongitudinalPositions, initialSpeed,
50 gtuType.getSimulator());
51 }
52
53
54 @SuppressWarnings("checkstyle:designforextension")
55 @Override
56 public TemplateGTUType<?> getGTUType()
57 {
58 return getGTUType();
59 }
60
61
62 @Override
63 public final DoubleScalar.Rel<LengthUnit> getLength()
64 {
65 return getGTUType().getLength();
66 }
67
68
69 @Override
70 public final DoubleScalar.Rel<LengthUnit> getWidth()
71 {
72 return getGTUType().getWidth();
73 }
74
75
76 @Override
77 public final DoubleScalar.Abs<SpeedUnit> getMaximumVelocity()
78 {
79 return getGTUType().getMaximumVelocity();
80 }
81
82
83 @Override
84 public final OTSDEVSSimulatorInterface getSimulator()
85 {
86 return getGTUType().getSimulator();
87 }
88
89 }