View Javadoc
1   package org.opentrafficsim.road.gtu.lane.tactical.lanechangemobil;
2   
3   import java.util.Collection;
4   
5   import org.djunits.value.vdouble.scalar.Acceleration;
6   import org.djunits.value.vdouble.scalar.Speed;
7   import org.opentrafficsim.base.parameters.ParameterException;
8   import org.opentrafficsim.core.gtu.GtuException;
9   import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
10  import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
11  import org.opentrafficsim.road.gtu.lane.perception.headway.Headway;
12  
13  /**
14   * All lane change models must implement this interface. <br>
15   * TODO: Lane change models should use the perceived nearby GTUs rather than a provided list of same lane traffic, etc.
16   * <p>
17   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
18   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
19   * </p>
20   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
21   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
22   */
23  public interface LaneChangeModel
24  {
25      /**
26       * Compute the acceleration and lane change.
27       * @param gtu LaneBasedGtu; the GTU for which the acceleration and lane change is computed
28       * @param sameLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the current lane (can not be null and may
29       *            include the <code>gtu</code>)
30       * @param rightLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the adjacent lane where GTUs should
31       *            drive in the absence of other traffic (must be null if there is no such lane)
32       * @param leftLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the adjacent lane into which GTUs should
33       *            merge to overtake other traffic (must be null if there is no such lane)
34       * @param speedLimit Speed; the local speed limit
35       * @param preferredLaneRouteIncentive Acceleration; route incentive to merge to the adjacent lane where GTUs should drive in
36       *            the absence of other traffic
37       * @param laneChangeThreshold Acceleration; threshold that prevents lane changes that have very little benefit
38       * @param nonPreferredLaneRouteIncentive Acceleration; route incentive to merge to the adjacent lane into which GTUs should
39       *            merge to overtake other traffic
40       * @return LaneMovementStep; the result of the lane change and GTU following model
41       * @throws GtuException when the speed of the GTU can not be determined
42       * @throws ParameterException in case of a parameter problem.
43       * @throws OperationalPlanException if DefaultAlexander perception category is not present.
44       */
45      @SuppressWarnings("checkstyle:parameternumber")
46      LaneMovementStep computeLaneChangeAndAcceleration(LaneBasedGtu gtu, Collection<Headway> sameLaneTraffic,
47              Collection<Headway> rightLaneTraffic, Collection<Headway> leftLaneTraffic, Speed speedLimit,
48              Acceleration preferredLaneRouteIncentive, Acceleration laneChangeThreshold,
49              Acceleration nonPreferredLaneRouteIncentive) throws GtuException, ParameterException, OperationalPlanException;
50  
51      /**
52       * Return the name of this GTU following model.
53       * @return String; just the name of the GTU following model
54       */
55      String getName();
56  
57      /**
58       * Return complete textual information about this instantiation of this GTU following model.
59       * @return String; the name and parameter values of the GTU following model
60       */
61      String getLongName();
62  
63  }