Class ConstantStochasticLaw

  • All Implemented Interfaces:
    MathFunction, MathInversableFunction, JsonableObject

    public class ConstantStochasticLaw
    extends StochasticLaw
    Law that representes an uniform density with as its upper and lower bounds equal.

    This class uses the uniform random number distribution provided by Random. This class replies the value of the law.

    Since:
    13.0
    Version:
    17.0 2020-01-04 14:41:41
    Author:
    Christophe BOHRHAUER
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathstochastic
    • Constructor Detail

      • ConstantStochasticLaw

        public ConstantStochasticLaw​(double value1)
        Create a constant stochastic law.
        Parameters:
        value1 - is the value replied by this law.
    • Method Detail

      • inverseF

        @Pure
        public double inverseF​(double u)
                        throws MathException
        Description copied from class: StochasticLaw
        Replies the x according to the value of the inverted cummulative distribution function F<sup>-1</sup>(u) where u = U(0, 1).
        Specified by:
        inverseF in interface MathInversableFunction
        Specified by:
        inverseF in class StochasticLaw
        Parameters:
        u - is a value given by the uniform random variable generator U(0, 1).
        Returns:
        F<sup>-1</sup>(u)
        Throws:
        MathException - in case F<sup>-1</sup>(u) could not be computed
      • f

        @Pure
        public double f​(double x)
                 throws MathException
        Description copied from interface: MathFunction
        Replies the value of the function.
        Parameters:
        x - the x.
        Returns:
        the value of f(x).
        Throws:
        MathException - in case f(x) could not be computed
      • getRange

        @Pure
        public MathFunctionRange[] getRange()
        Description copied from interface: MathFunction
        Replies the range of the function.
        Returns:
        a array of ranges. It corresponds to a list of couples that defined the set of valid values.
      • toJson

        @Pure
        public void toJson​(JsonBuffer buffer)
        Description copied from interface: JsonableObject
        Replies the Json representation of this node.
        Parameters:
        buffer - the Json buffer.