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-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14   * </p>
15   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
16   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
17   */
18  public class LaneBasedGtuCharacteristics extends GtuCharacteristics
19  {
20      /** */
21      private static final long serialVersionUID = 1L;
22  
23      /** The strategical planner factory. */
24      private final LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory;
25  
26      /** Route. */
27      private final Route route;
28  
29      /** Origin. */
30      private final Node origin;
31  
32      /** Destination. */
33      private final Node destination;
34  
35      /** Vehicle model. */
36      private final VehicleModel vehicleModel;
37  
38      /**
39       * Construct a new set of lane based GTU characteristics.
40       * @param gtuCharacteristics GtuCharacteristics; characteristics of the super GTU type to be used for the GTU
41       * @param laneBasedStrategicalPlannerFactory LaneBasedStrategicalPlannerFactory&lt;?&gt;; the strategical planner for the
42       *            GTU
43       * @param route Route; route
44       * @param origin Node; origin
45       * @param destination Node; destination
46       * @param vehicleModel 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 }