Class ModelUtil


  • public final class ModelUtil
    extends Object
    Utility class for handling of models.
    • Method Detail

      • validateOutcomes

        public static boolean validateOutcomes​(MaxentModel model,
                                               String... expectedOutcomes)
        Checks if the expectedOutcomes are all contained as outcomes in the given model.
        Parameters:
        model - A valid MaxentModel instance.
        expectedOutcomes - The outcomes to be checked for.
        Returns:
        true if all expected outcomes are the only outcomes of the model false otherwise.
      • read

        public static byte[] read​(InputStream in)
                           throws IOException
        Reads from the provided InputStream into a byte array.
        Parameters:
        in - A valid, open InputStream to read data from.
        Returns:
        A byte[] with the data read.
        Throws:
        IOException - Thrown if IO errors occurred.
      • addCutoffAndIterations

        public static void addCutoffAndIterations​(Map<String,​String> manifestInfoEntries,
                                                  int cutoff,
                                                  int iterations)
        Adds cutoff and iterations to manifestInfoEntries.
        Parameters:
        manifestInfoEntries - A Map representing a manifest.properties config.
        cutoff - The cut-off value to set. Must be greater than 0.
        iterations - The number of iterations to set. Must be greater than 0.