Class FixedLaneChangeModel

java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.lanechangemobil.FixedLaneChangeModel
All Implemented Interfaces:
java.io.Serializable, LaneChangeModel

public class FixedLaneChangeModel
extends java.lang.Object
implements LaneChangeModel, java.io.Serializable
Dummy lane change model with totally predictable results (used for testing).

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $, initial version 11 feb. 2015
Author:
Peter Knoppers
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static ParameterTypeLength LOOKAHEAD
    Look ahead parameter type.
  • Constructor Summary

    Constructors 
    Constructor Description
    FixedLaneChangeModel​(LateralDirectionality laneChange)
    Construct a FixedLaneChangeModel.
  • Method Summary

    Modifier and Type Method Description
    LaneMovementStep computeLaneChangeAndAcceleration​(LaneBasedGTU gtu, java.util.Collection<Headway> sameLaneTraffic, java.util.Collection<Headway> rightLaneTraffic, java.util.Collection<Headway> leftLaneTraffic, Speed speedLimit, Acceleration preferredLaneRouteIncentive, Acceleration laneChangeThreshold, Acceleration nonPreferredLaneRouteIncentive)
    Compute the acceleration and lane change.
    java.lang.String getLongName()
    Return complete textual information about this instantiation of this GTU following model.
    java.lang.String getName()
    Return the name of this GTU following model.
    java.lang.String toString()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • FixedLaneChangeModel

      public FixedLaneChangeModel​(LateralDirectionality laneChange)
      Construct a FixedLaneChangeModel.
      Parameters:
      laneChange - LateralDirectionality; the lane change that (always) be returned by this FixedLaneChangeModel.
  • Method Details

    • computeLaneChangeAndAcceleration

      public final LaneMovementStep computeLaneChangeAndAcceleration​(LaneBasedGTU gtu, java.util.Collection<Headway> sameLaneTraffic, java.util.Collection<Headway> rightLaneTraffic, java.util.Collection<Headway> leftLaneTraffic, Speed speedLimit, Acceleration preferredLaneRouteIncentive, Acceleration laneChangeThreshold, Acceleration nonPreferredLaneRouteIncentive) throws GTUException, ParameterException
      Compute the acceleration and lane change.
      Specified by:
      computeLaneChangeAndAcceleration in interface LaneChangeModel
      Parameters:
      gtu - LaneBasedGTU; the GTU for which the acceleration and lane change is computed
      sameLaneTraffic - Collection<Headway>; the set of observable GTUs in the current lane (can not be null and may include the gtu)
      rightLaneTraffic - Collection<Headway>; the set of observable GTUs in the adjacent lane where GTUs should drive in the absence of other traffic (must be null if there is no such lane)
      leftLaneTraffic - Collection<Headway>; the set of observable GTUs in the adjacent lane into which GTUs should merge to overtake other traffic (must be null if there is no such lane)
      speedLimit - Speed; the local speed limit
      preferredLaneRouteIncentive - Acceleration; route incentive to merge to the adjacent lane where GTUs should drive in the absence of other traffic
      laneChangeThreshold - Acceleration; threshold that prevents lane changes that have very little benefit
      nonPreferredLaneRouteIncentive - Acceleration; route incentive to merge to the adjacent lane into which GTUs should merge to overtake other traffic
      Returns:
      LaneMovementStep; the result of the lane change and GTU following model
      Throws:
      GTUException - when the speed of the GTU can not be determined
      ParameterException - in case of a parameter problem.
    • getName

      public final java.lang.String getName()
      Return the name of this GTU following model.
      Specified by:
      getName in interface LaneChangeModel
      Returns:
      String; just the name of the GTU following model
    • getLongName

      public final java.lang.String getLongName()
      Return complete textual information about this instantiation of this GTU following model.
      Specified by:
      getLongName in interface LaneChangeModel
      Returns:
      String; the name and parameter values of the GTU following model
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class java.lang.Object