Class StochasticLaw

    • Field Detail

      • NAME_NAME

        protected static final String NAME_NAME
        Name of the property that contains the law's name.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StochasticLaw

        public StochasticLaw()
        Construct a stochastic law.
    • Method Detail

      • getLawName

        protected String getLawName()
        Replies the name of the law.
        Returns:
        the name.
      • paramDouble

        @Pure
        protected static double paramDouble​(String paramName,
                                            Map<String,​String> parameters)
                                     throws LawParameterNotFoundException
        Extract a parameter value from a map of parameters.
        Parameters:
        paramName - is the nameof the parameter to extract.
        parameters - is the map of available parameters
        Returns:
        the extract value
        Throws:
        LawParameterNotFoundException - if the parameter was not found or the value is not a double.
      • paramBoolean

        @Pure
        protected static boolean paramBoolean​(String paramName,
                                              Map<String,​String> parameters)
                                       throws LawParameterNotFoundException
        Extract a parameter value from a map of parameters.
        Parameters:
        paramName - is the nameof the parameter to extract.
        parameters - is the map of available parameters
        Returns:
        the extract value
        Throws:
        LawParameterNotFoundException - if the parameter was not found or the value is not a double.
      • generateRandomValue

        public double generateRandomValue()
                                   throws MathException
        Replies a random value that respect the current stochastic law.
        Returns:
        a value depending of the stochastic law parameters
        Throws:
        MathException - when error in math definition.
      • inverseF

        protected double inverseF​(Random u)
                           throws MathException
        Replies the x according to the value of the inverted cummulative distribution function F<sup>-1</sup>(u) where u = U(0, 1).
        Parameters:
        u - is 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
      • inverseF

        @Pure
        public abstract double inverseF​(double u)
                                 throws MathException
        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
        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