
aima.core.util.JavaRandomizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
package aima.core.util;
import java.util.Random;
/**
* Implementation of the Randomizer Interface using Java's java.util.Random
* class.
*
* @author Ravi Mohan
*
*/
public class JavaRandomizer implements Randomizer {
private static Random _r = new Random();
private Random r = null;
public JavaRandomizer() {
this(_r);
}
public JavaRandomizer(Random r) {
this.r = r;
}
//
// START-Randomizer
@Override
public double nextDouble() {
return r.nextDouble();
}
// END-Randomizer
//
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy