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