1 package org.opentrafficsim.road.gtu.generator;
2
3 import java.io.Serializable;
4
5 import nl.tudelft.simulation.dsol.SimRuntimeException;
6
7 import org.djunits.unit.LengthUnit;
8 import org.djunits.unit.SpeedUnit;
9 import org.djunits.unit.TimeUnit;
10 import org.djunits.value.vdouble.scalar.Duration;
11 import org.djunits.value.vdouble.scalar.Length;
12 import org.djunits.value.vdouble.scalar.Speed;
13 import org.djunits.value.vdouble.scalar.Time;
14 import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
15 import org.opentrafficsim.core.gtu.GTUDirectionality;
16 import org.opentrafficsim.core.gtu.GTUType;
17 import org.opentrafficsim.core.gtu.animation.GTUColorer;
18 import org.opentrafficsim.core.network.OTSNetwork;
19 import org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar;
20 import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlanner;
21 import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlannerFactory;
22 import org.opentrafficsim.road.network.lane.Lane;
23
24
25
26
27
28
29
30
31
32
33
34
35 public class GTUGeneratorIndividual extends AbstractGTUGenerator implements Serializable
36 {
37
38 private static final long serialVersionUID = 20160000L;
39
40
41 private final OTSDEVSSimulatorInterface simulator;
42
43
44 private final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> lengthDist;
45
46
47 private final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> widthDist;
48
49
50 private final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> maximumSpeedDist;
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 @SuppressWarnings("checkstyle:parameternumber")
74 public GTUGeneratorIndividual(final String name, final OTSDEVSSimulatorInterface simulator, final GTUType gtuType,
75 final Class<?> gtuClass, final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> initialSpeedDist,
76 final ContinuousDistDoubleScalar.Rel<Duration, TimeUnit> interarrivelTimeDist,
77 final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> lengthDist,
78 final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> widthDist,
79 final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> maximumSpeedDist, final long maxGTUs,
80 final Time startTime, final Time endTime, final Lane lane, final Length position,
81 final GTUDirectionality direction, final GTUColorer gtuColorer,
82 final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory,
83 final OTSNetwork network) throws SimRuntimeException
84 {
85 super(name, simulator, gtuType, gtuClass, initialSpeedDist, interarrivelTimeDist, maxGTUs, startTime, endTime,
86 lane, position, direction, gtuColorer, strategicalPlannerFactory, network);
87 this.simulator = simulator;
88 this.lengthDist = lengthDist;
89 this.widthDist = widthDist;
90 this.maximumSpeedDist = maximumSpeedDist;
91 }
92
93
94 @Override
95 public final OTSDEVSSimulatorInterface getSimulator()
96 {
97 return this.simulator;
98 }
99
100
101
102
103 public final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> getLengthDist()
104 {
105 return this.lengthDist;
106 }
107
108
109
110
111 public final ContinuousDistDoubleScalar.Rel<Length, LengthUnit> getWidthDist()
112 {
113 return this.widthDist;
114 }
115
116
117
118
119 public final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> getMaximumSpeedDist()
120 {
121 return this.maximumSpeedDist;
122 }
123
124
125 @Override
126 public final String toString()
127 {
128 return "GTUGeneratorIndividual [lengthDist=" + this.lengthDist + ", widthDist=" + this.widthDist
129 + ", maximumSpeedDist=" + this.maximumSpeedDist + "]";
130 }
131
132 }