View Javadoc
1   package org.opentrafficsim.road.gtu.generator.characteristics;
2   
3   import org.opentrafficsim.core.gtu.GTUCharacteristics;
4   import org.opentrafficsim.core.network.Node;
5   import org.opentrafficsim.core.network.route.Route;
6   import org.opentrafficsim.road.gtu.lane.VehicleModel;
7   import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlannerFactory;
8   
9   /**
10   * Characteristics for a lane base GTU. This class is used to store all characteristics of a (not-yet constructed) LaneBasedGTU.
11   * <p>
12   * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
14   * <p>
15   * @version $Revision$, $LastChangedDate$, by $Author$, initial version Mar 8, 2016 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   */
19  public class LaneBasedGTUCharacteristics extends GTUCharacteristics
20  {
21      /** */
22      private static final long serialVersionUID = 1L;
23  
24      /** The strategical planner factory. */
25      private final LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory;
26  
27      /** Route. */
28      private final Route route;
29  
30      /** Origin. */
31      private final Node origin;
32  
33      /** Destination. */
34      private final Node destination;
35      
36      /** Vehicle model. */
37      private final VehicleModel vehicleModel;
38  
39      /**
40       * Construct a new set of lane based GTU characteristics.
41       * @param gtuCharacteristics GTUCharacteristics; characteristics of the super GTU type to be used for the GTU
42       * @param laneBasedStrategicalPlannerFactory LaneBasedStrategicalPlannerFactory; the strategical planner for the GTU
43       * @param route route
44       * @param origin origin
45       * @param destination destination
46       * @param vehicleModel vehicle model
47       */
48      public LaneBasedGTUCharacteristics(final GTUCharacteristics gtuCharacteristics,
49              final LaneBasedStrategicalPlannerFactory<?> laneBasedStrategicalPlannerFactory, final Route route,
50              final Node origin, final Node destination, final VehicleModel vehicleModel)
51      {
52          super(gtuCharacteristics.getGTUType(), gtuCharacteristics.getLength(), gtuCharacteristics.getWidth(),
53                  gtuCharacteristics.getMaximumSpeed(), gtuCharacteristics.getMaximumAcceleration(),
54                  gtuCharacteristics.getMaximumDeceleration(), gtuCharacteristics.getFront());
55          this.strategicalPlannerFactory = laneBasedStrategicalPlannerFactory;
56          this.route = route;
57          this.origin = origin;
58          this.destination = destination;
59          this.vehicleModel = vehicleModel;
60      }
61  
62      /**
63       * @return LaneBasedStrategicalPlannerFactory; the strategical planner factory for the GTU
64       */
65      public final LaneBasedStrategicalPlannerFactory<?> getStrategicalPlannerFactory()
66      {
67          return this.strategicalPlannerFactory;
68      }
69  
70      /**
71       * @return Route; route
72       */
73      public final Route getRoute()
74      {
75          return this.route;
76      }
77  
78      /**
79       * @return Node; origin
80       */
81      public Node getOrigin()
82      {
83          return this.origin;
84      }
85  
86      /**
87       * @return Node; destination
88       */
89      public Node getDestination()
90      {
91          return this.destination;
92      }
93      
94      /**
95       * Returns the vehicle model.
96       * @return VehicleModel; vehicle model
97       */
98      public VehicleModel getVehicleModel()
99      {
100         return this.vehicleModel;
101     }
102 
103 }