Class HeadwayConflict.Width

java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayConflict.Width
Enclosing class:
HeadwayConflict

public static class HeadwayConflict.Width extends Object
Width progression of conflict.

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

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Summary

    Constructors
    Constructor
    Description
    Width(double[] fractions, org.djunits.value.vdouble.vector.LengthVector width)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.djunits.value.vdouble.scalar.Length
    getWidth(double fraction)
    Returns the width at the given fraction.
    linear(org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth)
    Returns a linear width progression.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Width

      public Width(double[] fractions, org.djunits.value.vdouble.vector.LengthVector width)
      Parameters:
      fractions - double[]; fractions, from 0 to 1
      width - LengthVector; vector of equal length with widths
  • Method Details

    • getWidth

      public org.djunits.value.vdouble.scalar.Length getWidth(double fraction) throws org.djunits.value.ValueRuntimeException
      Returns the width at the given fraction.
      Parameters:
      fraction - double; fraction from 0 to 1
      Returns:
      Length; width at the given fraction
      Throws:
      org.djunits.value.ValueRuntimeException - when index is out of bounds
    • linear

      public static HeadwayConflict.Width linear(org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth)
      Returns a linear width progression.
      Parameters:
      startWidth - Length; start width
      endWidth - Length; end width
      Returns:
      Width; linear width progression