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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
18   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
19   * <p>
20   * @version $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
21   *          initial version 3 nov. 2014 <br>
22   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
23   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
24   */
25  public interface LaneChangeModel
26  {
27      /**
28       * Compute the acceleration and lane change.
29       * @param gtu LaneBasedGTU; the GTU for which the acceleration and lane change is computed
30       * @param sameLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the current lane (can not be null and may
31       *            include the <code>gtu</code>)
32       * @param rightLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the adjacent lane where GTUs should
33       *            drive in the absence of other traffic (must be null if there is no such lane)
34       * @param leftLaneTraffic Collection&lt;Headway&gt;; the set of observable GTUs in the adjacent lane into which GTUs should
35       *            merge to overtake other traffic (must be null if there is no such lane)
36       * @param speedLimit Speed; the local speed limit
37       * @param preferredLaneRouteIncentive Acceleration; route incentive to merge to the adjacent lane where GTUs should drive in
38       *            the absence of other traffic
39       * @param laneChangeThreshold Acceleration; threshold that prevents lane changes that have very little benefit
40       * @param nonPreferredLaneRouteIncentive Acceleration; route incentive to merge to the adjacent lane into which GTUs should
41       *            merge to overtake other traffic
42       * @return LaneMovementStep; the result of the lane change and GTU following model
43       * @throws GTUException when the speed of the GTU can not be determined
44       * @throws ParameterException in case of a parameter problem.
45       * @throws OperationalPlanException if DefaultAlexander perception category is not present.
46       */
47      @SuppressWarnings("checkstyle:parameternumber")
48      LaneMovementStep computeLaneChangeAndAcceleration(final LaneBasedGTU gtu, final Collection<Headway> sameLaneTraffic,
49              final Collection<Headway> rightLaneTraffic, final Collection<Headway> leftLaneTraffic, final Speed speedLimit,
50              final Acceleration preferredLaneRouteIncentive, final Acceleration laneChangeThreshold,
51              final Acceleration nonPreferredLaneRouteIncentive)
52              throws GTUException, ParameterException, OperationalPlanException;
53  
54      /**
55       * Return the name of this GTU following model.
56       * @return String; just the name of the GTU following model
57       */
58      String getName();
59  
60      /**
61       * Return complete textual information about this instantiation of this GTU following model.
62       * @return String; the name and parameter values of the GTU following model
63       */
64      String getLongName();
65  
66  }