autoweka
Class SubProcessWrapper

java.lang.Object
  extended by autoweka.Wrapper
      extended by 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
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, mSeed, mTimeout
 
Constructor Summary
SubProcessWrapper()
           
 
Method Summary
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, boolean verbose, 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


_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

_processWrapperParameterStart

protected void _processWrapperParameterStart(java.util.Queue<java.lang.String> args)
We only have to set the instance string

Overrides:
_processWrapperParameterStart in class Wrapper

_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

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,
                                                             boolean verbose,
                                                             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