View Javadoc
1   package org.opentrafficsim.road.gtu.lane.tactical.directedlanechange;
2   
3   import java.util.Collection;
4   
5   import org.djunits.value.vdouble.scalar.Acceleration;
6   import org.djunits.value.vdouble.scalar.Duration;
7   import org.djunits.value.vdouble.scalar.Length;
8   import org.djunits.value.vdouble.scalar.Speed;
9   import org.opentrafficsim.base.parameters.ParameterException;
10  import org.opentrafficsim.core.gtu.GTUException;
11  import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
12  import org.opentrafficsim.core.network.LateralDirectionality;
13  import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
14  import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
15  import org.opentrafficsim.road.gtu.lane.perception.headway.Headway;
16  
17  /**
18   * All directed lane change models must implement this interface. A directed lane change model is a lane change model where the
19   * choice for a lateral direction has already been made.
20   * <p>
21   * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
22   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
23   * <p>
24   * @version $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
25   *          initial version 3 nov. 2014 <br>
26   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
27   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
28   */
29  public interface DirectedLaneChangeModel
30  {
31      /**
32       * Compute the acceleration and lane change.
33       * @param gtu LaneBasedGTU; the GTU for which the acceleration and lane change is computed
34       * @param direction LateralDirectionality; the direction of the lane we want to change to
35       * @param sameLaneTraffic Collection&lt;Headway&gt;; the set of information about observable GTUs in the current lane (can
36       *            not be null and may include the <code>gtu</code>)
37       * @param otherLaneTraffic Collection&lt;Headway&gt;; the set of information about observable GTUs in the adjacent lane
38       *            where GTUs should drive in the absence of other traffic (must be null if there is no such lane)
39       * @param maxDistance Length; the maximum distance that the current GTU can drive, e.g. due to a lane drop
40       * @param speedLimit Speed; the local speed limit
41       * @param otherLaneRouteIncentive Acceleration; route incentive to merge to the adjacent lane where GTUs should drive in the
42       *            absence of other traffic
43       * @param laneChangeThreshold Acceleration; threshold that prevents lane changes that have very little benefit merge to
44       *            overtake other traffic
45       * @param laneChangeTime Duration; time spent to overtake
46       * @return LaneMovementStep; the result of the lane change and GTU following model
47       * @throws GTUException when the position of the GTU on the lane(s) cannot be determined
48       * @throws ParameterException in case of a parameter problem.
49       * @throws OperationalPlanException if DefaultAlexander perception category is not present
50       */
51      @SuppressWarnings("checkstyle:parameternumber")
52      DirectedLaneMovementStep computeLaneChangeAndAcceleration(final LaneBasedGTU gtu, final LateralDirectionality direction,
53              final Collection<Headway> sameLaneTraffic, final Collection<Headway> otherLaneTraffic, final Length maxDistance,
54              final Speed speedLimit, final Acceleration otherLaneRouteIncentive, final Acceleration laneChangeThreshold,
55              Duration laneChangeTime) throws GTUException, ParameterException, OperationalPlanException;
56  
57      /** @return the perception. */
58      LanePerception getPerception();
59  
60      /**
61       * Return the name of this GTU following model.
62       * @return String; just the name of the GTU following model
63       */
64      String getName();
65  
66      /**
67       * Return complete textual information about this instantiation of this GTU following model.
68       * @return String; the name and parameter values of the GTU following model
69       */
70      String getLongName();
71  
72  }