aima.util
Class Util
java.lang.Object
aima.util.Util
public class Util
- extends java.lang.Object
Field Summary |
static java.lang.String |
NO
|
static java.lang.String |
YES
|
Constructor Summary |
Util()
|
Method Summary |
static double |
calculateMean(java.util.List<java.lang.Double> lst)
|
static double |
calculateStDev(java.util.List<java.lang.Double> values,
double mean)
|
static void |
checkForNanOrInfinity(double d)
|
static
|
first(java.util.List<T> l)
|
static double |
generateRandomDoubleBetween(double lowerLimit,
double upperLimit)
|
static double |
information(double[] probabilities)
|
static double |
log2(double d)
|
static int |
max(int i,
int j)
|
static int |
max(int i,
int j,
int k)
|
static int |
min(int i,
int j)
|
static int |
min(int i,
int j,
int k)
|
static
|
mode(java.util.List<T> l)
|
static double[] |
normalize(double[] probDist)
|
static java.util.List<java.lang.Double> |
normalize(java.util.List<java.lang.Double> values)
|
static java.util.List<java.lang.Double> |
normalizeFromMeanAndStdev(java.util.List<java.lang.Double> values,
double mean,
double stdev)
|
static java.lang.String |
ntimes(java.lang.String s,
int n)
|
static boolean |
randomBoolean()
|
static int |
randomNumberBetween(int i,
int j)
|
static
|
removeFrom(java.util.List<T> list,
T member)
|
static
|
rest(java.util.List<T> l)
|
static
|
selectRandomlyFromList(java.util.List<T> l)
|
static
<T extends java.lang.Number>
double |
|
sumOfSquares(java.util.List<T> list)
|
static java.lang.String[] |
yesno()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO
public static final java.lang.String NO
- See Also:
- Constant Field Values
YES
public static final java.lang.String YES
- See Also:
- Constant Field Values
Util
public Util()
first
public static <T> T first(java.util.List<T> l)
rest
public static <T> java.util.List<T> rest(java.util.List<T> l)
randomBoolean
public static boolean randomBoolean()
normalize
public static double[] normalize(double[] probDist)
normalize
public static java.util.List<java.lang.Double> normalize(java.util.List<java.lang.Double> values)
min
public static int min(int i,
int j)
max
public static int max(int i,
int j)
max
public static int max(int i,
int j,
int k)
min
public static int min(int i,
int j,
int k)
selectRandomlyFromList
public static <T> T selectRandomlyFromList(java.util.List<T> l)
mode
public static <T> T mode(java.util.List<T> l)
yesno
public static java.lang.String[] yesno()
log2
public static double log2(double d)
information
public static double information(double[] probabilities)
removeFrom
public static <T> java.util.List<T> removeFrom(java.util.List<T> list,
T member)
sumOfSquares
public static <T extends java.lang.Number> double sumOfSquares(java.util.List<T> list)
ntimes
public static java.lang.String ntimes(java.lang.String s,
int n)
checkForNanOrInfinity
public static void checkForNanOrInfinity(double d)
randomNumberBetween
public static int randomNumberBetween(int i,
int j)
calculateMean
public static double calculateMean(java.util.List<java.lang.Double> lst)
calculateStDev
public static double calculateStDev(java.util.List<java.lang.Double> values,
double mean)
normalizeFromMeanAndStdev
public static java.util.List<java.lang.Double> normalizeFromMeanAndStdev(java.util.List<java.lang.Double> values,
double mean,
double stdev)
generateRandomDoubleBetween
public static double generateRandomDoubleBetween(double lowerLimit,
double upperLimit)