Package moa.core

Class 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 Detail

      • MiscUtils

        public MiscUtils()
    • Method Detail

      • chooseRandomIndexBasedOnWeights

        public static int chooseRandomIndexBasedOnWeights​(double[] weights,
                                                          Random random)
      • poisson

        public static int poisson​(double lambda,
                                  Random r)
      • getStackTraceString

        public static String getStackTraceString​(Exception ex)
      • 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