View Javadoc
1   package org.opentrafficsim.road.gtu.generator;
2   
3   import java.io.Serializable;
4   import java.util.ArrayList;
5   import java.util.LinkedHashSet;
6   import java.util.List;
7   import java.util.Set;
8   
9   import nl.tudelft.simulation.dsol.SimRuntimeException;
10  
11  import org.djunits.unit.LengthUnit;
12  import org.djunits.unit.SpeedUnit;
13  import org.djunits.unit.TimeUnit;
14  import org.djunits.value.vdouble.scalar.Duration;
15  import org.djunits.value.vdouble.scalar.Length;
16  import org.djunits.value.vdouble.scalar.Speed;
17  import org.djunits.value.vdouble.scalar.Time;
18  import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
19  import org.opentrafficsim.core.dsol.OTSSimTimeDouble;
20  import org.opentrafficsim.core.gtu.GTUDirectionality;
21  import org.opentrafficsim.core.gtu.GTUException;
22  import org.opentrafficsim.core.gtu.GTUType;
23  import org.opentrafficsim.core.gtu.RelativePosition;
24  import org.opentrafficsim.core.gtu.animation.GTUColorer;
25  import org.opentrafficsim.core.network.NetworkException;
26  import org.opentrafficsim.core.network.OTSNetwork;
27  import org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar;
28  import org.opentrafficsim.road.gtu.animation.DefaultCarAnimation;
29  import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
30  import org.opentrafficsim.road.gtu.lane.LaneBasedIndividualGTU;
31  import org.opentrafficsim.road.gtu.lane.LaneBasedIndividualGTU.LaneBasedIndividualCarBuilder;
32  import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
33  import org.opentrafficsim.road.gtu.lane.perception.headway.Headway;
34  import org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayDistance;
35  import org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayGTUSimple;
36  import org.opentrafficsim.road.gtu.lane.tactical.following.GTUFollowingModelOld;
37  import org.opentrafficsim.road.gtu.lane.tactical.following.IDMPlusOld;
38  import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlanner;
39  import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlannerFactory;
40  import org.opentrafficsim.road.network.lane.DirectedLanePosition;
41  import org.opentrafficsim.road.network.lane.Lane;
42  
43  /**
44   * Common code for LaneBasedGTU generators that may have to postpone putting a GTU on the road due to congestion growing into
45   * the generator. <br>
46   * Generally, these generators will discover that there is not enough room AFTER having decided what kind (particular length) of
47   * GTU will be constructed next. When this happens, the generator must remember the properties of the GTU, but postpone actual
48   * generation until there is enough room.
49   * <p>
50   * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
51   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
52   * <p>
53   * @version $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
54   *          initial version Feb 2, 2015 <br>
55   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
56   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
57   */
58  public abstract class AbstractGTUGenerator implements Serializable
59  {
60      /** */
61      private static final long serialVersionUID = 20150202L;
62  
63      /** The generator name. Will be used for generated GTUs as Name:# where # is the id of the GTU when ID is a String. */
64      private final String name;
65  
66      /** The type of GTU to generate. */
67      private final GTUType gtuType;
68  
69      /** The GTU class to instantiate. */
70      private final Class<?> gtuClass;
71  
72      /** Distribution of the initial speed of the GTU. */
73      private final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> initialSpeedDist;
74  
75      /** Distribution of the interarrival time. */
76      private final ContinuousDistDoubleScalar.Rel<Duration, TimeUnit> interarrivelTimeDist;
77  
78      /** Generated number of GTUs. */
79      private long generatedGTUs = 0;
80  
81      /** Maximum number of GTUs to generate. */
82      private final long maxGTUs;
83  
84      /** Start time of generation (delayed start). */
85      private final Time startTime;
86  
87      /** End time of generation. */
88      private final Time endTime;
89  
90      /** Lane to generate the GTU on -- at the end for now. */
91      private final Lane lane;
92  
93      /** Position on the lane, relative to the design line of the link. */
94      private final Length position;
95  
96      /** The direction in which the GTU has to be generated; DIR_PLUS or DIR_MINUS. */
97      private final GTUDirectionality direction;
98  
99      /** GTUColorer to use. */
100     private final GTUColorer gtuColorer;
101 
102     /** The lane-based strategical planner factory to use. */
103     private final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory;
104 
105     /** The network. */
106     private final OTSNetwork network;
107 
108     /** Car builder list. */
109     private List<LaneBasedIndividualCarBuilder> carBuilderList = new ArrayList<>();
110 
111     /** Number of generated GTUs. */
112     @SuppressWarnings("checkstyle:visibilitymodifier")
113     protected long numberGTUs = 0;
114 
115     /**
116      * @param name the name of the generator
117      * @param simulator the simulator to schedule the start of the generation
118      * @param gtuType the type of GTU to generate
119      * @param gtuClass the GTU class to instantiate
120      * @param initialSpeedDist distribution of the initial speed of the GTU
121      * @param interarrivelTimeDist distribution of the interarrival time
122      * @param maxGTUs maximum number of GTUs to generate
123      * @param startTime start time of generation (delayed start)
124      * @param endTime end time of generation
125      * @param lane the lane to generate the GTU on
126      * @param position position on the lane, relative to the design line of the link
127      * @param direction the direction on the lane in which the GTU has to be generated (DIR_PLUS, or DIR_MINUS)
128      * @param gtuColorer the GTUColorer to use
129      * @param strategicalPlannerFactory the lane-based strategical planner factory to use
130      * @param network the network to register the generated GTUs into
131      * @throws SimRuntimeException when simulation scheduling fails
132      */
133     @SuppressWarnings("checkstyle:parameternumber")
134     public AbstractGTUGenerator(final String name, final OTSDEVSSimulatorInterface simulator, final GTUType gtuType,
135             final Class<?> gtuClass, final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> initialSpeedDist,
136             final ContinuousDistDoubleScalar.Rel<Duration, TimeUnit> interarrivelTimeDist, final long maxGTUs,
137             final Time startTime, final Time endTime, final Lane lane, final Length position,
138             final GTUDirectionality direction, final GTUColorer gtuColorer,
139             final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory,
140             final OTSNetwork network) throws SimRuntimeException
141     {
142         super();
143         this.name = name;
144         this.gtuType = gtuType;
145         this.gtuClass = gtuClass;
146         this.initialSpeedDist = initialSpeedDist;
147         this.interarrivelTimeDist = interarrivelTimeDist;
148         this.maxGTUs = maxGTUs;
149         this.startTime = startTime;
150         this.endTime = endTime;
151         this.lane = lane;
152         this.position = position;
153         this.direction = direction;
154         this.gtuColorer = gtuColorer;
155         this.strategicalPlannerFactory = strategicalPlannerFactory;
156         this.network = network;
157 
158         simulator.scheduleEventAbs(startTime, this, this, "generate", null);
159     }
160 
161     /**
162      * Generate a GTU.
163      * @throws Exception when something in the generation fails.
164      */
165     protected final void generate() throws Exception
166     {
167         // check if we are after the end time
168         if (getSimulator().getSimulatorTime().getTime().gt(this.endTime))
169         {
170             return;
171         }
172 
173         // check if we have generated sufficient GTUs
174         if (this.generatedGTUs >= this.maxGTUs)
175         {
176             return;
177         }
178 
179         // create a unique id
180         this.numberGTUs++;
181         String id = this.name + ":" + this.numberGTUs;
182 
183         // create the GTU
184         if (LaneBasedIndividualGTU.class.isAssignableFrom(getGtuClass()))
185         {
186             LaneBasedIndividualCarBuilder carBuilder = new LaneBasedIndividualCarBuilder();
187             carBuilder.setId(id);
188             carBuilder.setGtuType(getGtuType());
189             Length carLength = getLengthDist().draw();
190             carBuilder.setLength(carLength);
191             carBuilder.setWidth(getWidthDist().draw());
192             carBuilder.setMaximumSpeed(getMaximumSpeedDist().draw());
193             carBuilder.setInitialSpeed(getInitialSpeedDist().draw());
194             carBuilder.setSimulator(getSimulator());
195             Set<DirectedLanePosition> initialLongitudinalPositions = new LinkedHashSet<>(1);
196             initialLongitudinalPositions.add(new DirectedLanePosition(this.lane, this.position, this.direction));
197             carBuilder.setInitialLongitudinalPositions(initialLongitudinalPositions);
198             carBuilder.setAnimationClass(DefaultCarAnimation.class);
199             carBuilder.setGtuColorer(this.gtuColorer);
200             carBuilder.setNetwork(this.network);
201             this.generatedGTUs++;
202 
203             if (enoughSpace(carBuilder))
204             {
205                 carBuilder.build(this.strategicalPlannerFactory);
206             }
207             else
208             {
209                 // put the car in the queue and take it from there -- if the headway is enough, build the car.
210                 this.carBuilderList.add(carBuilder);
211                 // System.out.println("GTUGenerator - backlog = " + this.carBuilderList.size());
212                 if (this.carBuilderList.size() == 1)
213                 {
214                     // first entry in list - start the watch thread
215                     getSimulator()
216                             .scheduleEventRel(new Duration(0.1, TimeUnit.SECOND), this, this, "checkCarBuilderList", null);
217                 }
218             }
219         }
220         else
221         {
222             throw new GTUException("GTU class " + getGtuClass().getName() + ": cannot instantiate, no builder.");
223         }
224 
225         // reschedule next arrival
226         OTSSimTimeDouble nextTime = getSimulator().getSimulatorTime().plus(this.interarrivelTimeDist.draw());
227         if (nextTime.get().le(this.endTime))
228         {
229             getSimulator().scheduleEventAbs(nextTime, this, this, "generate", null);
230         }
231     }
232 
233     /**
234      * Check if the car to be built is not overlapping with another GTU on the same lane, and if it has enough headway to be
235      * generated safely.
236      * @param carBuilder the car to be generated
237      * @return true if car can be safely built, false otherwise.
238      * @throws NetworkException when the speed limit of the lane is not known
239      * @throws GTUException if GTU does not have a position on the lane where it is registered
240      */
241     protected final boolean enoughSpace(final LaneBasedIndividualCarBuilder carBuilder) throws NetworkException, GTUException
242     {
243         DirectedLanePosition directedLanePosition = carBuilder.getInitialLongitudinalPositions().iterator().next();
244         Lane generatorLane = directedLanePosition.getLane();
245         double genPosSI = directedLanePosition.getPosition().getSI();
246         //GTUDirectionality direction = directedLanePosition.getGtuDirection();
247         // XXX different from this.direction?
248         double lengthSI = generatorLane.getLength().getSI();
249         double frontNew = (genPosSI + carBuilder.getLength().getSI()) / lengthSI;
250         double rearNew = genPosSI / lengthSI;
251 
252         // test for overlap with other GTUs
253         for (LaneBasedGTU gtu : generatorLane.getGtuList())
254         {
255             double frontGTU = gtu.fractionalPosition(generatorLane, gtu.getFront());
256             double rearGTU = gtu.fractionalPosition(generatorLane, gtu.getRear());
257             if ((frontNew >= rearGTU && frontNew <= frontGTU) || (rearNew >= rearGTU && rearNew <= frontGTU)
258                     || (frontGTU >= rearNew && frontGTU <= frontNew) || (rearGTU >= rearNew && rearGTU <= frontNew))
259             {
260                 // System.out.println(getSimulator().getSimulatorTime() + ", generator overlap with GTU " + gtu);
261                 return false;
262             }
263         }
264 
265         // test for sufficient headway
266         GTUFollowingModelOld followingModel = new IDMPlusOld();
267         // carBuilder.getStrategicalPlanner().getBehavioralCharacteristics().getGTUFollowingModel();
268 
269         Headway headway = headway(new Length(250.0, LengthUnit.METER), generatorLane);
270         Length minimumHeadway = new Length(0.0, LengthUnit.METER);
271         if (headway.getObjectType().isGtu())
272         {
273             minimumHeadway =
274                     followingModel.minimumHeadway(carBuilder.getInitialSpeed(), headway.getSpeed(), new Length(1.0,
275                             LengthUnit.CENTIMETER), new Length(250.0, LengthUnit.METER), generatorLane
276                             .getSpeedLimit(carBuilder.getGtuType()), carBuilder.getMaximumSpeed());
277             double acc =
278                     followingModel.computeAcceleration(carBuilder.getInitialSpeed(), carBuilder.getMaximumSpeed(),
279                             headway.getSpeed(), minimumHeadway, carBuilder.getMaximumSpeed()).getSI();
280             if (acc < 0)
281             {
282                 System.err.println(getSimulator().getSimulatorTime() + ", generator headway for GTU " + headway.getId()
283                         + ", distance " + headway.getDistance().si + " m, max " + minimumHeadway + ", has to brake with a="
284                         + acc + " m/s^2");
285                 return false;
286             }
287         }
288 
289         // System.out.println(getSimulator().getSimulatorTime() + ", generator headway for GTU " + headwayGTU.getOtherGTU()
290         // + ", distance " + headwayGTU.getDistance().si + " m, max " + minimumHeadway);
291         return headway.getDistance().ge(minimumHeadway);
292     }
293 
294     /**
295      * Calculate the minimum headway, possibly on subsequent lanes, in DIR_PLUS direction.
296      * @param theLane the lane where we are looking right now
297      * @param lanePositionSI from which position on this lane do we start measuring? This is the current position of the GTU
298      *            when we measure in the lane where the original GTU is positioned, and 0.0 for each subsequent lane
299      * @param cumDistanceSI the distance we have already covered searching on previous lanes
300      * @param maxDistanceSI the maximum distance to look for in SI units; stays the same in subsequent calls
301      * @param when the current or future time for which to calculate the headway
302      * @return the headway in SI units when we have found the GTU, or a null GTU with a distance of Double.MAX_VALUE meters when
303      *         no other GTU could not be found within maxDistanceSI meters
304      * @throws GTUException when there is a problem with the geometry of the network
305      */
306     private Headway headwayRecursiveForwardSI(final Lane theLane, final double lanePositionSI, final double cumDistanceSI,
307             final double maxDistanceSI, final Time when) throws GTUException
308     {
309         // TODO: THIS METHOD IS ALSO IN PERCEPTION -- DON'T DUPLICATE; ALSO, THIS VERSION IS WRONG.
310         LaneBasedGTU otherGTU =
311                 theLane.getGtuAhead(new Length(lanePositionSI, LengthUnit.METER), GTUDirectionality.DIR_PLUS,
312                         RelativePosition.REAR, when);
313         if (otherGTU != null)
314         {
315             double distanceM = cumDistanceSI + otherGTU.position(theLane, otherGTU.getRear(), when).getSI() - lanePositionSI;
316             if (distanceM > 0 && distanceM <= maxDistanceSI)
317             {
318                 return new HeadwayGTUSimple(otherGTU.getId(), otherGTU.getGTUType(), new Length(distanceM, LengthUnit.SI),
319                         otherGTU.getLength(), otherGTU.getSpeed(), null);
320             }
321             return new HeadwayDistance(Double.MAX_VALUE);
322         }
323 
324         // Continue search on successor lanes.
325         if (cumDistanceSI + theLane.getLength().getSI() - lanePositionSI < maxDistanceSI)
326         {
327             // is there a successor link?
328             if (theLane.nextLanes(this.gtuType).size() > 0)
329             {
330                 Headway foundMaxGTUDistanceSI = new HeadwayDistance(Double.MAX_VALUE);
331                 for (Lane nextLane : theLane.nextLanes(this.gtuType).keySet())
332                 {
333                     // TODO Only follow links on the Route if there is a "real" Route
334                     // if (routeNavigator.getRoute() == null || routeNavigator.getRoute().size() == 0 /* XXXXX STUB dummy route
335                     // */
336                     // || routeNavigator.getRoute().containsLink((Link) theLane.getParentLink()))
337                     {
338                         double traveledDistanceSI = cumDistanceSI + theLane.getLength().getSI() - lanePositionSI;
339                         Headway closest = headwayRecursiveForwardSI(nextLane, 0.0, traveledDistanceSI, maxDistanceSI, when);
340                         if (closest.getDistance().si < maxDistanceSI
341                                 && closest.getDistance().si < foundMaxGTUDistanceSI.getDistance().si)
342                         {
343                             foundMaxGTUDistanceSI = closest;
344                         }
345                     }
346                 }
347                 return foundMaxGTUDistanceSI;
348             }
349         }
350 
351         // No other GTU was not on one of the current lanes or their successors.
352         return new HeadwayDistance(Double.MAX_VALUE);
353     }
354 
355     /**
356      * Calculate the minimum headway, possibly on subsequent lanes, in DIR_MINUS direction.
357      * @param theLane the lane where we are looking right now
358      * @param lanePositionSI from which position on this lane do we start measuring? This is the current position of the GTU
359      *            when we measure in the lane where the original GTU is positioned, and 0.0 for each subsequent lane
360      * @param cumDistanceSI the distance we have already covered searching on previous lanes
361      * @param maxDistanceSI the maximum distance to look for in SI units; stays the same in subsequent calls
362      * @param when the current or future time for which to calculate the headway
363      * @return the headway in SI units when we have found the GTU, or a null GTU with a distance of Double.MAX_VALUE meters when
364      *         no other GTU could not be found within maxDistanceSI meters
365      * @throws GTUException when there is a problem with the geometry of the network
366      */
367     private Headway headwayRecursiveBackwardSI(final Lane theLane, final double lanePositionSI, final double cumDistanceSI,
368             final double maxDistanceSI, final Time when) throws GTUException
369     {
370         // TODO: THIS METHOD IS ALSO IN PERCEPTION -- DON'T DUPLICATE; ALSO, THIS VERSION IS RONG.
371         LaneBasedGTU otherGTU =
372                 theLane.getGtuBehind(new Length(lanePositionSI, LengthUnit.METER), GTUDirectionality.DIR_PLUS,
373                         RelativePosition.FRONT, when);
374         if (otherGTU != null)
375         {
376             double distanceM = cumDistanceSI + otherGTU.position(theLane, otherGTU.getFront(), when).getSI() - lanePositionSI;
377             if (distanceM > 0 && distanceM <= maxDistanceSI)
378             {
379                 return new HeadwayGTUSimple(otherGTU.getId(), otherGTU.getGTUType(), new Length(distanceM, LengthUnit.SI),
380                         otherGTU.getLength(), otherGTU.getSpeed(), null);
381             }
382             return new HeadwayDistance(Double.MAX_VALUE);
383         }
384 
385         // Continue search on all predecessor lanes.
386         if (cumDistanceSI + theLane.getLength().getSI() - lanePositionSI < maxDistanceSI)
387         {
388             // is there a predecessor link?
389             if (theLane.prevLanes(this.gtuType).size() > 0)
390             {
391                 Headway foundMaxGTUDistanceSI = new HeadwayDistance(Double.MAX_VALUE);
392                 for (Lane prevLane : theLane.prevLanes(this.gtuType).keySet())
393                 {
394                     // TODO Only follow links on the Route if there is a "real" Route
395                     // if (routeNavigator.getRoute() == null || routeNavigator.getRoute().size() == 0 /* XXXXX STUB dummy route
396                     // */
397                     // || routeNavigator.getRoute().containsLink((Link) theLane.getParentLink()))
398                     {
399                         double traveledDistanceSI = cumDistanceSI + theLane.getLength().getSI() - lanePositionSI;
400                         Headway closest = headwayRecursiveBackwardSI(prevLane, 0.0, traveledDistanceSI, maxDistanceSI, when);
401                         if (closest.getDistance().si < maxDistanceSI
402                                 && closest.getDistance().si < foundMaxGTUDistanceSI.getDistance().si)
403                         {
404                             foundMaxGTUDistanceSI = closest;
405                         }
406                     }
407                 }
408                 return foundMaxGTUDistanceSI;
409             }
410         }
411 
412         // No other GTU was not on one of the current lanes or their successors.
413         return new HeadwayDistance(Double.MAX_VALUE);
414     }
415 
416     /**
417      * Find the first GTU starting on the specified lane following the specified route.
418      * @param maxDistanceSI the maximum distance to look for in SI units
419      * @param generatorLane Lane; the lane on which the the search for a leader starts
420      * @return the nearest GTU and the net headway to this GTU in SI units when we have found the GTU, or a null GTU with a
421      *         distance of Double.MAX_VALUE meters when no other GTU could not be found within maxDistanceSI meters
422      * @throws GTUException when there is a problem with the geometry of the network
423      */
424     private Headway headwayGTUSIForward(final double maxDistanceSI, final Lane generatorLane) throws GTUException
425     {
426         Time when = getSimulator().getSimulatorTime().getTime();
427         Headway foundMaxGTUDistanceSI = new HeadwayDistance(Double.MAX_VALUE);
428         // search for the closest GTU on all current lanes we are registered on.
429         Headway closest;
430         if (this.direction.equals(GTUDirectionality.DIR_PLUS))
431         {
432             closest = headwayRecursiveForwardSI(this.lane, generatorLane.getLength().getSI(), 0.0, maxDistanceSI, when);
433         }
434         else
435         {
436             closest = headwayRecursiveBackwardSI(this.lane, generatorLane.getLength().getSI(), 0.0, maxDistanceSI, when);
437         }
438         if (closest.getDistance().si < maxDistanceSI && closest.getDistance().si < foundMaxGTUDistanceSI.getDistance().si)
439         {
440             foundMaxGTUDistanceSI = closest;
441         }
442         return foundMaxGTUDistanceSI;
443     }
444 
445     /**
446      * Check the available headway for GTU that is about to be constructed.
447      * @param maxDistance Length; the maximum distance to look for a leader
448      * @param generatorLane Lane; the lane on which the GTU is generated
449      * @return HeadwayGTU; the available headway and the GTU at that headway
450      * @throws GTUException on network inconsistency
451      */
452     public final Headway headway(final Length maxDistance, final Lane generatorLane) throws GTUException
453     {
454         return headwayGTUSIForward(maxDistance.getSI(), generatorLane);
455     }
456 
457     /**
458      * Check if car can be generated.
459      * @throws Exception on any problem
460      */
461     protected final void checkCarBuilderList() throws Exception
462     {
463         if (!this.carBuilderList.isEmpty())
464         {
465             LaneBasedIndividualCarBuilder carBuilder = this.carBuilderList.get(0);
466             if (enoughSpace(carBuilder))
467             {
468                 this.carBuilderList.remove(0);
469                 carBuilder.build(this.strategicalPlannerFactory);
470             }
471         }
472 
473         // only reschedule if list not empty
474         if (!this.carBuilderList.isEmpty())
475         {
476             getSimulator().scheduleEventRel(new Duration(0.1, TimeUnit.SECOND), this, this, "checkCarBuilderList", null);
477         }
478     }
479 
480     /** @return simulator. */
481     public abstract OTSDEVSSimulatorInterface getSimulator();
482 
483     /** @return lengthDist. */
484     public abstract ContinuousDistDoubleScalar.Rel<Length, LengthUnit> getLengthDist();
485 
486     /** @return widthDist. */
487     public abstract ContinuousDistDoubleScalar.Rel<Length, LengthUnit> getWidthDist();
488 
489     /** @return maximumSpeedDist. */
490     public abstract ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> getMaximumSpeedDist();
491 
492     /**
493      * @return name.
494      */
495     public final String getName()
496     {
497         return this.name;
498     }
499 
500     /**
501      * @return gtuType.
502      */
503     public final GTUType getGtuType()
504     {
505         return this.gtuType;
506     }
507 
508     /**
509      * @return gtuClass.
510      */
511     public final Class<?> getGtuClass()
512     {
513         return this.gtuClass;
514     }
515 
516     /**
517      * @return initialSpeedDist.
518      */
519     public final ContinuousDistDoubleScalar.Rel<Speed, SpeedUnit> getInitialSpeedDist()
520     {
521         return this.initialSpeedDist;
522     }
523 
524     /**
525      * @return interarrivelTimeDist.
526      */
527     public final ContinuousDistDoubleScalar.Rel<Duration, TimeUnit> getInterarrivelTimeDist()
528     {
529         return this.interarrivelTimeDist;
530     }
531 
532     /**
533      * @return maxGTUs.
534      */
535     public final long getMaxGTUs()
536     {
537         return this.maxGTUs;
538     }
539 
540     /**
541      * @return startTime.
542      */
543     public final Time getStartTime()
544     {
545         return this.startTime;
546     }
547 
548     /**
549      * @return endTime.
550      */
551     public final Time getEndTime()
552     {
553         return this.endTime;
554     }
555 
556     /**
557      * @return gtuColorer.
558      */
559     public final GTUColorer getGtuColorer()
560     {
561         return this.gtuColorer;
562     }
563 
564     /**
565      * @return strategicalPlanner
566      */
567     public final LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> getStrategicalPlannerFactory()
568     {
569         return this.strategicalPlannerFactory;
570     }
571 
572 }