View Javadoc
1   package org.opentrafficsim.road.gtu.lane;
2   
3   import java.util.Set;
4   
5   import org.djunits.value.vdouble.scalar.Speed;
6   import org.opentrafficsim.core.gtu.GTUCharacteristics;
7   import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlanner;
8   import org.opentrafficsim.road.network.lane.DirectedLanePosition;
9   
10  /**
11   * Characteristics for a lane base GTU. This class is used to store all characteristics of a (not-yet constructed) LaneBasedGTU.
12   * <p>
13   * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
14   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
15   * <p>
16   * @version $Revision$, $LastChangedDate$, by $Author$, initial version Mar 8, 2016 <br>
17   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
18   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
19   */
20  public class LaneBasedGTUCharacteristics extends GTUCharacteristics
21  {
22      /** */
23      private static final long serialVersionUID = 1L;
24  
25      /** The strategical planner of the GTU. */
26      private final LaneBasedStrategicalPlanner strategicalPlanner;
27  
28      /** The maximum speed of the GTU. */
29      private final Speed speed;
30  
31      /** The initial lanes, positions and direction of the GTU. */
32      private final Set<DirectedLanePosition> initialLongitudinalPositions;
33  
34      /**
35       * Construct a new set of lane based GTU characteristics.
36       * @param gtuCharacteristics GTUCharacteristics; characteristics of the super GTU type to be used for the GTU
37       * @param laneBasedStrategicalPlanner LaneBasedStrategicalPlanner; the strategical planner for the GTU
38       * @param speed Speed; the initial speed of the GTU
39       * @param initialLongitudinalPositions Set&lt;DirectedLanePosition&gt;; the lane, initial position and direction of the GTU
40       */
41      public LaneBasedGTUCharacteristics(final GTUCharacteristics gtuCharacteristics, 
42              final LaneBasedStrategicalPlanner laneBasedStrategicalPlanner, final Speed speed,
43              final Set<DirectedLanePosition> initialLongitudinalPositions)
44      {
45          super(gtuCharacteristics.getGTUType(), gtuCharacteristics.getIdGenerator(), gtuCharacteristics.getLength(),
46                  gtuCharacteristics.getWidth(), gtuCharacteristics.getMaximumSpeed(), gtuCharacteristics.getSimulator(),
47                  gtuCharacteristics.getNetwork());
48          this.strategicalPlanner = laneBasedStrategicalPlanner;
49          this.speed = speed;
50          this.initialLongitudinalPositions = initialLongitudinalPositions;
51      }
52  
53      /**
54       * @return LaneBasedStrategicalPlanner; the strategical planner for the GTU
55       */
56      public final LaneBasedStrategicalPlanner getStrategicalPlanner()
57      {
58          return this.strategicalPlanner;
59      }
60  
61      /**
62       * @return Speed; the maximum speed of the GTU
63       */
64      public final Speed getSpeed()
65      {
66          return this.speed;
67      }
68  
69      /**
70       * @return Set&lt;DirectedLanePosition&gt;; the position and direction on each lane that the GTU will initially be on
71       */
72      public final Set<DirectedLanePosition> getInitialLongitudinalPositions()
73      {
74          return this.initialLongitudinalPositions;
75      }
76  
77  }