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