Class HeadwayConflict.Width
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayConflict.Width
-
- Enclosing class:
- HeadwayConflict
public static class HeadwayConflict.Width extends java.lang.ObjectWidth progression of conflict.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$, $LastChangedDate$, by $Author$, initial version 11 aug. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description Width(double[] fractions, LengthVector width)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LengthgetWidth(double fraction)Returns the width at the given fraction.static HeadwayConflict.Widthlinear(Length startWidth, Length endWidth)Returns a linear width progression.
-
-
-
Constructor Detail
-
Width
public Width(double[] fractions, LengthVector width)- Parameters:
fractions- double[]; fractions, from 0 to 1width- LengthVector; vector of equal length with widths
-
-
Method Detail
-
getWidth
public Length getWidth(double fraction) throws ValueRuntimeException
Returns the width at the given fraction.- Parameters:
fraction- double; fraction from 0 to 1- Returns:
- Length; width at the given fraction
- Throws:
ValueRuntimeException- when index is out of bounds
-
linear
public static HeadwayConflict.Width linear(Length startWidth, Length endWidth)
Returns a linear width progression.- Parameters:
startWidth- Length; start widthendWidth- Length; end width- Returns:
- Width; linear width progression
-
-