Class DoubleRange

java.lang.Object
toxi.util.datatypes.DoubleRange
Direct Known Subclasses:
BiasedDoubleRange

public class DoubleRange extends Object
  • Field Details

    • min

      public double min
    • max

      public double max
    • currValue

      public double currValue
  • Constructor Details

    • DoubleRange

      public DoubleRange()
    • DoubleRange

      public DoubleRange(double min, double max)
  • Method Details

    • fromSamples

      public static DoubleRange fromSamples(double... samples)
    • fromSamples

      public static DoubleRange fromSamples(List<Double> samples)
    • adjustCurrentBy

      public double adjustCurrentBy(double val)
    • copy

      public DoubleRange copy()
    • getAt

      public final double getAt(double perc)
      Returns the value at the normalized position (0.0 = min ... 1.0 = max-EPS) within the range. Since the max value is exclusive, the value returned for position 1.0 is the range max value minus MathUtils.EPS. Also note the given position is not being clipped to the 0.0-1.0 interval, so when passing in values outside that interval will produce out-of-range values too.
      Parameters:
      perc -
      Returns:
      value within the range
    • getCurrent

      public double getCurrent()
    • getMedian

      public double getMedian()
    • getRange

      public double getRange()
    • isValueInRange

      public boolean isValueInRange(float val)
    • pickRandom

      public double pickRandom()
    • seed

      public DoubleRange seed(long seed)
    • setCurrent

      public double setCurrent(double val)
    • setRandom

      public DoubleRange setRandom(Random rnd)
    • toArray

      public Double[] toArray(double step)
    • toString

      public String toString()
      Overrides:
      toString in class Object