View Javadoc
1   package org.opentrafficsim.core.gtu.lane.changing;
2   
3   import java.rmi.RemoteException;
4   import java.util.Collection;
5   
6   import org.opentrafficsim.core.gtu.following.HeadwayGTU;
7   import org.opentrafficsim.core.gtu.lane.LaneBasedGTU;
8   import org.opentrafficsim.core.unit.AccelerationUnit;
9   import org.opentrafficsim.core.unit.SpeedUnit;
10  import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar;
11  import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar.Rel;
12  
13  /**
14   * All lane change models must implement this interface.
15   * <p>
16   * Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights
17   * reserved. <br>
18   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
19   * <p>
20   * @version 3 nov. 2014 <br>
21   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
22   * @author <a href="http://Hansvanlint.weblog.tudelft.nl">Hans van Lint</a>
23   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
24   * @author <a href="http://www.citg.tudelft.nl">Guus Tamminga</a>
25   * @author <a href="http://www.citg.tudelft.nl">Yufei Yuan</a>
26   */
27  public interface LaneChangeModel
28  {
29      /**
30       * Compute the acceleration and lane change. <br />
31       * FIXME the parameters of this method will change. Hopefully will become straightforward to figure out the nearby
32       * vehicles in the current and the adjacent lanes.
33       * @param gtu GTU; the GTU for which the acceleration and lane change is computed
34       * @param sameLaneTraffic Collection&lt;GTU&gt;; the set of observable GTUs in the current lane (can not be null and
35       *            may include gtu)
36       * @param rightLaneTraffic Collection&lt;GTU&gt;; the set of observable GTUs in the adjacent lane where GTUs should
37       *            drive in the absence of other traffic (must be null if there is no such lane)
38       * @param leftLaneTraffic Collection&lt;GTU&gt;; the set of observable GTUs in the adjacent lane into which
39       *            GTUs should merge to overtake other traffic (must be null if there is no such lane)
40       * @param speedLimit DoubleScalarAbs&lt;SpeedUnit&gt;; the local speed limit
41       * @param preferredLaneRouteIncentive DoubleScalar.Rel&lt;AccelerationUnit&gt;; route incentive to merge to the
42       *            adjacent lane where GTUs should drive in the absence of other traffic
43       * @param laneChangeThreshold DoubleScalar.Rel&lt;AccelerationUnit&gt;; changing threshold that prevents lane
44       *            changes that have very little benefit
45       * @param nonPreferredLaneRouteIncentive DoubleScalar.Rel&lt;AccelerationUnit&gt;; route incentive to merge to the
46       *            adjacent lane into which GTUs should merge to overtake other traffic
47       * @return LaneMovementStep; the result of the lane change and GTU following model
48       * @throws RemoteException in case the simulation time cannot be retrieved.
49       */
50      @SuppressWarnings("checkstyle:parameternumber")
51      LaneMovementStep computeLaneChangeAndAcceleration(final LaneBasedGTU<?> gtu,
52              final Collection<HeadwayGTU> sameLaneTraffic,
53              final Collection<HeadwayGTU> rightLaneTraffic,
54              final Collection<HeadwayGTU> leftLaneTraffic,
55              final DoubleScalar.Abs<SpeedUnit> speedLimit,
56              final DoubleScalar.Rel<AccelerationUnit> preferredLaneRouteIncentive,
57              Rel<AccelerationUnit> laneChangeThreshold,
58              final DoubleScalar.Rel<AccelerationUnit> nonPreferredLaneRouteIncentive) throws RemoteException;
59  
60  }