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://github.com/peter-knoppers">Peter Knoppers</a>
17   */
18  public class LaneBasedGtuCharacteristics extends GtuCharacteristics
19  {
20      /** The strategical planner factory. */
21      private final LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory;
22  
23      /** Route. */
24      private final Route route;
25  
26      /** Origin. */
27      private final Node origin;
28  
29      /** Destination. */
30      private final Node destination;
31  
32      /** Vehicle model. */
33      private final VehicleModel vehicleModel;
34  
35      /**
36       * Construct a new set of lane based GTU characteristics.
37       * @param gtuCharacteristics characteristics of the super GTU type to be used for the GTU
38       * @param laneBasedStrategicalPlannerFactory the strategical planner for the GTU
39       * @param route route
40       * @param origin origin
41       * @param destination destination
42       * @param vehicleModel vehicle model
43       */
44      public LaneBasedGtuCharacteristics(final GtuCharacteristics gtuCharacteristics,
45              final LaneBasedStrategicalPlannerFactory<?> laneBasedStrategicalPlannerFactory, final Route route,
46              final Node origin, final Node destination, final VehicleModel vehicleModel)
47      {
48          super(gtuCharacteristics.getGtuType(), gtuCharacteristics.getLength(), gtuCharacteristics.getWidth(),
49                  gtuCharacteristics.getMaximumSpeed(), gtuCharacteristics.getMaximumAcceleration(),
50                  gtuCharacteristics.getMaximumDeceleration(), gtuCharacteristics.getFront());
51          this.strategicalPlannerFactory = laneBasedStrategicalPlannerFactory;
52          this.route = route;
53          this.origin = origin;
54          this.destination = destination;
55          this.vehicleModel = vehicleModel;
56      }
57  
58      /**
59       * Returns the strategical planner factory.
60       * @return the strategical planner factory for the GTU
61       */
62      public final LaneBasedStrategicalPlannerFactory<?> getStrategicalPlannerFactory()
63      {
64          return this.strategicalPlannerFactory;
65      }
66  
67      /**
68       * Returns the route.
69       * @return route
70       */
71      public final Route getRoute()
72      {
73          return this.route;
74      }
75  
76      /**
77       * Returns the origin.
78       * @return origin
79       */
80      public Node getOrigin()
81      {
82          return this.origin;
83      }
84  
85      /**
86       * Returns the destination.
87       * @return destination
88       */
89      public Node getDestination()
90      {
91          return this.destination;
92      }
93  
94      /**
95       * Returns the vehicle model.
96       * @return vehicle model
97       */
98      public VehicleModel getVehicleModel()
99      {
100         return this.vehicleModel;
101     }
102 
103 }