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      /** */
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 characteristics of the super GTU type to be used for the GTU
41       * @param laneBasedStrategicalPlannerFactory the strategical planner for the GTU
42       * @param route route
43       * @param origin origin
44       * @param destination destination
45       * @param vehicleModel vehicle model
46       */
47      public LaneBasedGtuCharacteristics(final GtuCharacteristics gtuCharacteristics,
48              final LaneBasedStrategicalPlannerFactory<?> laneBasedStrategicalPlannerFactory, final Route route,
49              final Node origin, final Node destination, final VehicleModel vehicleModel)
50      {
51          super(gtuCharacteristics.getGtuType(), gtuCharacteristics.getLength(), gtuCharacteristics.getWidth(),
52                  gtuCharacteristics.getMaximumSpeed(), gtuCharacteristics.getMaximumAcceleration(),
53                  gtuCharacteristics.getMaximumDeceleration(), gtuCharacteristics.getFront());
54          this.strategicalPlannerFactory = laneBasedStrategicalPlannerFactory;
55          this.route = route;
56          this.origin = origin;
57          this.destination = destination;
58          this.vehicleModel = vehicleModel;
59      }
60  
61      /**
62       * @return the strategical planner factory for the GTU
63       */
64      public final LaneBasedStrategicalPlannerFactory<?> getStrategicalPlannerFactory()
65      {
66          return this.strategicalPlannerFactory;
67      }
68  
69      /**
70       * @return route
71       */
72      public final Route getRoute()
73      {
74          return this.route;
75      }
76  
77      /**
78       * @return origin
79       */
80      public Node getOrigin()
81      {
82          return this.origin;
83      }
84  
85      /**
86       * @return destination
87       */
88      public Node getDestination()
89      {
90          return this.destination;
91      }
92  
93      /**
94       * Returns the vehicle model.
95       * @return vehicle model
96       */
97      public VehicleModel getVehicleModel()
98      {
99          return this.vehicleModel;
100     }
101 
102 }