Class VariateBiased<T>

  • Type Parameters:
    T - the type of the random variate values.
    All Implemented Interfaces:
    Variate<T>

    public final class VariateBiased<T>
    extends java.lang.Object
    implements Variate<T>
    This class represents a biased T-type random variate (a discrete probability distribution).
    • Constructor Summary

      Constructors 
      Constructor Description
      VariateBiased​(java.util.List<T> values, java.util.List<java.lang.Integer> biases)
      Constructs a biased random variate.
      VariateBiased​(T[] values, int[] biases)
      Constructs a biased random variate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T value()
      Returns a value (instance) of the random variate.
      • Methods inherited from class java.lang.Object

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

      • VariateBiased

        public VariateBiased​(java.util.List<T> values,
                             java.util.List<java.lang.Integer> biases)
        Constructs a biased random variate.
        Parameters:
        values - the value area of the random variate.
        biases - the random biases of the values.
        Throws:
        java.lang.IllegalArgumentException - if values == null or biases == null; if the values and biases arrays have different sizes or they are empty or the biases array contains negative numbers.
      • VariateBiased

        public VariateBiased​(T[] values,
                             int[] biases)
        Constructs a biased random variate.
        Parameters:
        values - the value area of the random variate.
        biases - the random biases of the values.
        Throws:
        java.lang.IllegalArgumentException - if values == null or biases == null; if the values and biases arrays have different sizes or they are empty or the biases array contains negative numbers.
    • Method Detail

      • value

        public T value()
        Description copied from interface: Variate
        Returns a value (instance) of the random variate.
        Specified by:
        value in interface Variate<T>
        Returns:
        a random variate value.