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