autoweka

## Class SubProcessWrapper

- java.lang.Object
- - autoweka.Wrapper
  - - autoweka.SubProcessWrapper

-     public class SubProcessWrapper
      extends Wrapper

  An implementation of a Wrapper that should ideally just be called from other Java objects - it performes the training/evaluation of a classifier on a sub process to preserve the JVM of the caller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SubProcessWrapper.ErrorAndTime` Small class that just encapsulates the error and time of a sub process run TODO: Should really be changed to use a ClassifierResult instead

  - ### Field Summary

    - ### Fields inherited from class autoweka.Wrapper

      `mExperimentSeed, mInstance, mProperties, mResultMetric, mRunner, mTimeout`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SubProcessWrapper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_processParameter(java.lang.String arg, java.util.Queue<java.lang.String> args)` The only two things that a SubProcessWrapper cares about are the timeouts and the seed
    `protected void` | `_processResults(ClassifierResult res)` Emit the result from a sub process wrapper back up to whoever called us
    `protected void` | `_processWrapperParameterStart(java.util.Queue<java.lang.String> args)` We only have to set the instance string
    `static SubProcessWrapper.ErrorAndTime` | `getErrorAndTime(java.io.File runDir, Experiment exp, java.lang.String instance, java.lang.String args, java.lang.String autowekaSeed)`
    `static SubProcessWrapper.ErrorAndTime` | `getErrorAndTime(java.io.File runDir, Experiment exp, java.lang.String instance, java.lang.String args, java.lang.String autowekaSeed, java.util.Properties props)`
    `static SubProcessWrapper.ErrorAndTime` | `getErrorAndTime(java.io.File runDir, autoweka.ListExperiment exp, java.lang.String instance, java.lang.String args, java.lang.String autowekaSeed)`
    `static SubProcessWrapper.ErrorAndTime` | `getErrorAndTime(java.io.File runDir, autoweka.ListExperiment exp, java.lang.String instance, java.lang.String args, java.lang.String autowekaSeed, java.util.Properties props)`
    `static SubProcessWrapper.ErrorAndTime` | `getErrorAndTime(java.io.File runDir, java.lang.String memory, java.util.Properties props, float trainTimeout, java.lang.String instance, java.lang.String args, java.lang.String autowekaSeed)` Calls the SubProcessWrapper as a SubProcess, and returns the result back up to the caller.
    `static void` | `main(java.lang.String[] args)` Calls the SubProcessWrapper using the given arguments

    - ### Methods inherited from class autoweka.Wrapper

      `_doRun, _postRun, _preRun, run`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SubProcessWrapper

          public SubProcessWrapper()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      Calls the SubProcessWrapper using the given arguments
      Parameters:
        `args` - Any arguments.

    - #### _processParameter

          protected void _processParameter(java.lang.String arg,
                                           java.util.Queue<java.lang.String> args)

      The only two things that a SubProcessWrapper cares about are the timeouts and the seed
      Overrides:
        `_processParameter` in class `Wrapper`
      Parameters:
        `arg` - The parameter.
        `args` - The list of parameters.

    - #### _processWrapperParameterStart

          protected void _processWrapperParameterStart(java.util.Queue<java.lang.String> args)

      We only have to set the instance string
      Overrides:
        `_processWrapperParameterStart` in class `Wrapper`
      Parameters:
        `args` - The list of arguments.

    - #### _processResults

          protected void _processResults(ClassifierResult res)

      Emit the result from a sub process wrapper back up to whoever called us
      Overrides:
        `_processResults` in class `Wrapper`
      Parameters:
        `res` - The classifier result.

    - #### getErrorAndTime

          public static SubProcessWrapper.ErrorAndTime getErrorAndTime(java.io.File runDir,
                                                                       autoweka.ListExperiment exp,
                                                                       java.lang.String instance,
                                                                       java.lang.String args,
                                                                       java.lang.String autowekaSeed)

    - #### getErrorAndTime

          public static SubProcessWrapper.ErrorAndTime getErrorAndTime(java.io.File runDir,
                                                                       autoweka.ListExperiment exp,
                                                                       java.lang.String instance,
                                                                       java.lang.String args,
                                                                       java.lang.String autowekaSeed,
                                                                       java.util.Properties props)

    - #### getErrorAndTime

          public static SubProcessWrapper.ErrorAndTime getErrorAndTime(java.io.File runDir,
                                                                       Experiment exp,
                                                                       java.lang.String instance,
                                                                       java.lang.String args,
                                                                       java.lang.String autowekaSeed)

    - #### getErrorAndTime

          public static SubProcessWrapper.ErrorAndTime getErrorAndTime(java.io.File runDir,
                                                                       Experiment exp,
                                                                       java.lang.String instance,
                                                                       java.lang.String args,
                                                                       java.lang.String autowekaSeed,
                                                                       java.util.Properties props)

    - #### getErrorAndTime

          public static SubProcessWrapper.ErrorAndTime getErrorAndTime(java.io.File runDir,
                                                                       java.lang.String memory,
                                                                       java.util.Properties props,
                                                                       float trainTimeout,
                                                                       java.lang.String instance,
                                                                       java.lang.String args,
                                                                       java.lang.String autowekaSeed)

      Calls the SubProcessWrapper as a SubProcess, and returns the result back up to the caller. This method is super useful to ensure that leaking doesn't happen/memory limits are enforced, since all the work is done in a subprocess - if anything bad happens, it dies down there, letting your process carry on willy nilly
      Parameters:
        `runDir` - The run directory.
        `memory` - The memory limit.
        `props` - The properties.
        `trainTimeout` - The timeout for training.
        `instance` - The instance.
        `args` - The arguments.
        `autowekaSeed` - The seed.
      Returns:
        The error and time.