Class HeadwayConflict.Width

    • Constructor Detail

      • Width

        public Width​(double[] fractions,
                     LengthVector width)
        Parameters:
        fractions - double[]; fractions, from 0 to 1
        width - 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 width
        endWidth - Length; end width
        Returns:
        Width; linear width progression