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.network.LateralDirectionality;
12  import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
13  import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
14  import org.opentrafficsim.road.gtu.lane.perception.headway.Headway;
15  
16  /**
17   * All directed lane change models must implement this interface. A directed lane change model is a lane change model where the
18   * choice for a lateral direction has already been made.
19   * <p>
20   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
21   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
22   * </p>
23   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
24   * @author <a href="https://github.com/peter-knoppers">Peter Knoppers</a>
25   */
26  public interface DirectedLaneChangeModel
27  {
28      /**
29       * Compute the acceleration and lane change.
30       * @param gtu the GTU for which the acceleration and lane change is computed
31       * @param direction the direction of the lane we want to change to
32       * @param sameLaneTraffic the set of information about observable GTUs in the current lane (can not be null and may include
33       *            the <code>gtu</code>)
34       * @param otherLaneTraffic the set of information about observable GTUs in the adjacent lane where GTUs should drive in the
35       *            absence of other traffic (must be null if there is no such lane)
36       * @param maxDistance the maximum distance that the current GTU can drive, e.g. due to a lane drop
37       * @param speedLimit the local speed limit
38       * @param otherLaneRouteIncentive route incentive to merge to the adjacent lane where GTUs should drive in the absence of
39       *            other traffic
40       * @param laneChangeThreshold threshold that prevents lane changes that have very little benefit merge to overtake other
41       *            traffic
42       * @param laneChangeTime time spent to overtake
43       * @return the result of the lane change and GTU following model
44       * @throws GtuException when the position of the GTU on the lane(s) cannot be determined
45       * @throws ParameterException in case of a parameter problem.
46       */
47      @SuppressWarnings("checkstyle:parameternumber")
48      DirectedLaneMovementStep computeLaneChangeAndAcceleration(LaneBasedGtu gtu, LateralDirectionality direction,
49              Collection<Headway> sameLaneTraffic, Collection<Headway> otherLaneTraffic, Length maxDistance, Speed speedLimit,
50              Acceleration otherLaneRouteIncentive, Acceleration laneChangeThreshold, Duration laneChangeTime)
51              throws GtuException, ParameterException;
52  
53      /** @return the perception. */
54      LanePerception getPerception();
55  
56      /**
57       * Return the name of this GTU following model.
58       * @return just the name of the GTU following model
59       */
60      String getName();
61  
62      /**
63       * Return complete textual information about this instantiation of this GTU following model.
64       * @return the name and parameter values of the GTU following model
65       */
66      String getLongName();
67  
68  }