Class AMUtils


  • public class AMUtils
    extends java.lang.Object
    This class holds constants and methods used in the AM classifier.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double HETEROGENEOUS
      A heterogeneous outcome, which means we don't bother with it.
      static java.lang.String LINE_SEPARATOR  
      static double NONDETERMINISTIC
      A non-deterministic outcome, meaning that there is more than one possibility.
      static java.lang.String NONDETERMINISTIC_STRING  
      static com.jakewharton.picnic.CellStyle REPORT_TABLE_STYLE
      Picnic library table style used for printing gangs and analogical sets
      static double UNKNOWN
      An unknown class value.
    • Constructor Summary

      Constructors 
      Constructor Description
      AMUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatPercentage​(java.math.BigDecimal val, int numDecimals, boolean addPercentPrefix)  
      static java.lang.String formatPointerPercentage​(java.math.BigInteger pointers, java.math.BigDecimal totalPointers, int numDecimals, boolean addPercentPrefix)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NONDETERMINISTIC

        public static final double NONDETERMINISTIC
        A non-deterministic outcome, meaning that there is more than one possibility.
        See Also:
        Constant Field Values
      • NONDETERMINISTIC_STRING

        public static final java.lang.String NONDETERMINISTIC_STRING
        See Also:
        Constant Field Values
      • HETEROGENEOUS

        public static final double HETEROGENEOUS
        A heterogeneous outcome, which means we don't bother with it.
        See Also:
        Constant Field Values
      • LINE_SEPARATOR

        public static final java.lang.String LINE_SEPARATOR
      • REPORT_TABLE_STYLE

        public static final com.jakewharton.picnic.CellStyle REPORT_TABLE_STYLE
        Picnic library table style used for printing gangs and analogical sets
    • Constructor Detail

      • AMUtils

        public AMUtils()
    • Method Detail

      • formatPointerPercentage

        public static java.lang.String formatPointerPercentage​(java.math.BigInteger pointers,
                                                               java.math.BigDecimal totalPointers,
                                                               int numDecimals,
                                                               boolean addPercentPrefix)
        Parameters:
        pointers - the number of pointers for the current context
        totalPointers - the number of pointers for all contexts
        numDecimals - the number of digits to output after the decimal point.
        addPercentPrefix - true if a percent sign (%) should be prefixed
        Returns:
        return a formatted percentage indicating the size of the analogical effect of pointers
      • formatPercentage

        public static java.lang.String formatPercentage​(java.math.BigDecimal val,
                                                        int numDecimals,
                                                        boolean addPercentPrefix)
        Parameters:
        numDecimals - the number of digits to output after the decimal point.
        addPercentPrefix - true if a percent sign (%) should be prefixed
        Returns:
        val formatted as a percentage with three decimal places