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