Package moa.core
Class MiscUtils
- java.lang.Object
-
- moa.core.MiscUtils
-
public class MiscUtils extends Object
Class implementing some utility methods.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz), Bernhard Pfahringer (bernhard@cs.waikato.ac.nz)
-
-
Constructor Summary
Constructors Constructor Description MiscUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
chooseRandomIndexBasedOnWeights(double[] weights, Random random)
static String
getStackTraceString(Exception ex)
static int
maxIndex(double[] doubles)
Returns index of maximum element in a given array of doubles.static int
poisson(double lambda, Random r)
-
-
-
Method Detail
-
chooseRandomIndexBasedOnWeights
public static int chooseRandomIndexBasedOnWeights(double[] weights, Random random)
-
poisson
public static int poisson(double lambda, Random r)
-
maxIndex
public static int maxIndex(double[] doubles)
Returns index of maximum element in a given array of doubles. First maximum is returned.- Parameters:
doubles
- the array of doubles- Returns:
- the index of the maximum element
-
-