View Javadoc
1   package org.opentrafficsim.road.gtu.lane.changing;
2   
3   import java.util.Collection;
4   
5   import org.opentrafficsim.core.OTS_SCALAR;
6   import org.opentrafficsim.road.gtu.following.HeadwayGTU;
7   import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
8   
9   /**
10   * All lane change models must implement this interface.
11   * <p>
12   * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14   * <p>
15   * @version $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
16   *          initial version 3 nov. 2014 <br>
17   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
18   * @author <a href="http://Hansvanlint.weblog.tudelft.nl">Hans van Lint</a>
19   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
20   * @author <a href="http://www.citg.tudelft.nl">Guus Tamminga</a>
21   * @author <a href="http://www.citg.tudelft.nl">Yufei Yuan</a>
22   */
23  public interface LaneChangeModel extends OTS_SCALAR
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 DoubleScalar.Rel&lt;AccelerationUnit&gt;; route incentive to merge to the adjacent
36       *            lane where GTUs should drive in the absence of other traffic
37       * @param laneChangeThreshold DoubleScalar.Rel&lt;AccelerationUnit&gt;; threshold that prevents lane changes that have very
38       *            little benefit
39       * @param nonPreferredLaneRouteIncentive DoubleScalar.Rel&lt;AccelerationUnit&gt;; route incentive to merge to the adjacent
40       *            lane into which GTUs should merge to overtake other traffic
41       * @return LaneMovementStep; the result of the lane change and GTU following model
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.Abs speedLimit,
47          final Acceleration.Rel preferredLaneRouteIncentive, final Acceleration.Rel laneChangeThreshold,
48          final Acceleration.Rel nonPreferredLaneRouteIncentive);
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  }