Class ExtendedPseudoRandomGenerator

java.lang.Object
org.uma.jmetal.util.pseudorandom.impl.ExtendedPseudoRandomGenerator
All Implemented Interfaces:
Serializable, PseudoRandomGenerator

public class ExtendedPseudoRandomGenerator extends Object implements PseudoRandomGenerator
Extended pseudo random number generator based on the decorator pattern. Two new methods are added: randNormal() and randSphere()
Author:
Antonio J. Nebro invalid input: '<'antonio@lcc.uma.es>
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    long
     
    double
     
    double
    nextDouble(double lowerBound, double upperBound)
     
    int
    nextInt(int lowerBound, int upperBound)
     
    double
    randNormal(double mean, double standardDeviation)
    Use the polar form of the Box-Muller transformation to obtain a pseudo random number from a Gaussian distribution Code taken from Maurice Clerc's implementation
    double[]
    randSphere(int dimension)
    Get a random point from an hypersphere (center = 0, radius = 1) Code taken from Maurice Clerc's implementation
    double[]
    randSphere(int dimension, double center, double radius)
    Ger a random point from an hypersphere Code taken from Maurice Clerc's implementation
    void
    setSeed(long seed)
     

    Methods inherited from class java.lang.Object

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

    • ExtendedPseudoRandomGenerator

      public ExtendedPseudoRandomGenerator(PseudoRandomGenerator randomGenerator)
  • Method Details

    • nextInt

      public int nextInt(int lowerBound, int upperBound)
      Specified by:
      nextInt in interface PseudoRandomGenerator
    • nextDouble

      public double nextDouble(double lowerBound, double upperBound)
      Specified by:
      nextDouble in interface PseudoRandomGenerator
    • nextDouble

      public double nextDouble()
      Specified by:
      nextDouble in interface PseudoRandomGenerator
    • setSeed

      public void setSeed(long seed)
      Specified by:
      setSeed in interface PseudoRandomGenerator
    • getSeed

      public long getSeed()
      Specified by:
      getSeed in interface PseudoRandomGenerator
    • getName

      public String getName()
      Specified by:
      getName in interface PseudoRandomGenerator
    • randNormal

      public double randNormal(double mean, double standardDeviation)
      Use the polar form of the Box-Muller transformation to obtain a pseudo random number from a Gaussian distribution Code taken from Maurice Clerc's implementation
      Parameters:
      mean -
      standardDeviation -
      Returns:
      A pseudo random number
    • randSphere

      public double[] randSphere(int dimension)
      Get a random point from an hypersphere (center = 0, radius = 1) Code taken from Maurice Clerc's implementation
      Parameters:
      dimension -
      Returns:
      A pseudo random point
    • randSphere

      public double[] randSphere(int dimension, double center, double radius)
      Ger a random point from an hypersphere Code taken from Maurice Clerc's implementation
      Parameters:
      center -
      radius -
      Returns:
      A pseudo random number