1 package org.opentrafficsim.road.gtu.lane;
2
3 import java.util.Set;
4
5 import nl.tudelft.simulation.dsol.SimRuntimeException;
6
7 import org.djunits.value.vdouble.scalar.Length;
8 import org.djunits.value.vdouble.scalar.Speed;
9 import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
10 import org.opentrafficsim.core.geometry.OTSGeometryException;
11 import org.opentrafficsim.core.gtu.GTUException;
12 import org.opentrafficsim.core.gtu.GTUType;
13 import org.opentrafficsim.core.network.NetworkException;
14 import org.opentrafficsim.core.network.OTSNetwork;
15 import org.opentrafficsim.road.gtu.lane.perception.LanePerceptionFull;
16 import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlanner;
17 import org.opentrafficsim.road.network.lane.DirectedLanePosition;
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public abstract class AbstractLaneBasedIndividualGTU extends AbstractLaneBasedGTU
32 {
33
34 private static final long serialVersionUID = 20140822L;
35
36
37 private final Length.Rel length;
38
39
40 private final Length.Rel width;
41
42
43 private final Speed maximumVelocity;
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 @SuppressWarnings("checkstyle:parameternumber")
64 public AbstractLaneBasedIndividualGTU(final String id, final GTUType gtuType,
65 final Set<DirectedLanePosition> initialLongitudinalPositions, final Speed initialSpeed,
66 final Length.Rel length, final Length.Rel width, final Speed maximumVelocity,
67 final OTSDEVSSimulatorInterface simulator, final LaneBasedStrategicalPlanner strategicalPlanner,
68 final LanePerceptionFull perception, final OTSNetwork network) throws NetworkException, SimRuntimeException,
69 GTUException, OTSGeometryException
70 {
71 super(id, gtuType, initialLongitudinalPositions, initialSpeed, simulator, strategicalPlanner, perception,
72 network);
73 this.length = length;
74 this.width = width;
75 if (null == maximumVelocity)
76 {
77 throw new GTUException("maximumVelocity may not be null");
78 }
79 this.maximumVelocity = maximumVelocity;
80 }
81
82
83 @Override
84 public final Length.Rel getLength()
85 {
86 return this.length;
87 }
88
89
90 @Override
91 public final Length.Rel getWidth()
92 {
93 return this.width;
94 }
95
96
97 @Override
98 public final Speed getMaximumVelocity()
99 {
100 return this.maximumVelocity;
101 }
102
103 }