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.core.gtu.GTUException;
8   import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
9   import org.opentrafficsim.road.gtu.lane.tactical.following.HeadwayGTU;
10  
11  /**
12   * All lane change models must implement this interface. <br>
13   * TODO: Lane change models should use the perceived nearby GTUs rather than a provided list of same lane traffic, etc.
14   * <p>
15   * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
16   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
17   * <p>
18   * @version $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
19   *          initial version 3 nov. 2014 <br>
20   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
21   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
22   */
23  public interface LaneChangeModel
24  {
25      /**
26       * Compute the acceleration and lane change.
27       * @param gtu GTU; the GTU for which the acceleration and lane change is computed
28       * @param sameLaneTraffic Collection&lt;GTU&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;GTU&gt;; the set of observable GTUs in the adjacent lane where GTUs should drive in
31       *            the absence of other traffic (must be null if there is no such lane)
32       * @param leftLaneTraffic Collection&lt;GTU&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 DoubleScalarAbs&lt;SpeedUnit&gt;; 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       */
43      @SuppressWarnings("checkstyle:parameternumber")
44      LaneMovementStep computeLaneChangeAndAcceleration(final LaneBasedGTU gtu,
45          final Collection<HeadwayGTU> sameLaneTraffic, final Collection<HeadwayGTU> rightLaneTraffic,
46          final Collection<HeadwayGTU> leftLaneTraffic, final Speed speedLimit,
47          final Acceleration preferredLaneRouteIncentive, final Acceleration laneChangeThreshold,
48          final Acceleration nonPreferredLaneRouteIncentive) throws GTUException;
49  
50      /**
51       * Return the name of this GTU following model.
52       * @return String; just the name of the GTU following model
53       */
54      String getName();
55  
56      /**
57       * Return complete textual information about this instantiation of this GTU following model.
58       * @return String; the name and parameter values of the GTU following model
59       */
60      String getLongName();
61  
62  }