© 2006-2007 ETH Zurich

org.ximtec.igesture.batch
Class BatchProcess

java.lang.Object
  extended by org.ximtec.igesture.batch.BatchProcess
All Implemented Interfaces:
Callable<BatchResultSet>

public class BatchProcess
extends Object
implements Callable<BatchResultSet>

This class provides the logic of the batch process for testing algorithm configurations.

Version:
1.0 Dec 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Constructor Summary
BatchProcess(BatchProcessContainer container)
          Constructs a new batch process.
 
Method Summary
 void addGestureSet(GestureSet set)
          Adds a gesture set.
 void addGestureSets(List<GestureSet> sets)
          Adds a list of gesture sets.
 BatchResultSet call()
           
static List<Configuration> createConfigurations(File file)
          Creates a list of configurations.
static List<Configuration> createConfigurations(List<BatchAlgorithm> algorithms)
          Creates a list of configurations.
protected static void processForLoopParameter(BatchParameter param, Configuration configuration, String algorithm, List<BatchParameter> parameters, int index, List<Configuration> configurations)
          Processes for loop parameters.
protected static void processPowerSetParameter(BatchParameter param, Configuration configuration, String algorithm, List<BatchParameter> parameters, int index, List<Configuration> configurations)
          Processes power set parameters.
protected static void processSequenceParameter(BatchParameter param, Configuration configuration, String algorithm, List<BatchParameter> parameters, int index, List<Configuration> configurations)
          Processes sequence parameters.
protected static void processSimpleParameter(BatchParameter param, Configuration configuration, String algorithm, List<BatchParameter> parameters, int index, List<Configuration> configurations)
          Processes simple value parameters.
 BatchResultSet run()
          Runs the batch process.
 void setTestSet(TestSet testSet)
          Adds a test set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchProcess

public BatchProcess(BatchProcessContainer container)
Constructs a new batch process.

Parameters:
file - the XML file with the configuration.
Method Detail

setTestSet

public void setTestSet(TestSet testSet)
Adds a test set.

Parameters:
testSet - the test set to be added.

addGestureSet

public void addGestureSet(GestureSet set)
Adds a gesture set.

Parameters:
set - the gesture set to be added.

addGestureSets

public void addGestureSets(List<GestureSet> sets)
Adds a list of gesture sets.

Parameters:
sets - the list of gesture sets to be added.

run

public BatchResultSet run()
Runs the batch process.

Returns:
the batch result set.

createConfigurations

public static List<Configuration> createConfigurations(List<BatchAlgorithm> algorithms)
Creates a list of configurations. This method permutes all possible parameters and creates configuration instances. For the permutation part a recursive method is invoked. For each permutation a configuration instance is created.

Parameters:
algorithms - the BatchAlgorithm instances.
Returns:
a list of configurations.

createConfigurations

public static List<Configuration> createConfigurations(File file)
Creates a list of configurations.

Parameters:
file - the file containing the configurations.
Returns:
the newly created configurations.

processSimpleParameter

protected static void processSimpleParameter(BatchParameter param,
                                             Configuration configuration,
                                             String algorithm,
                                             List<BatchParameter> parameters,
                                             int index,
                                             List<Configuration> configurations)
Processes simple value parameters.

Parameters:
param - the batch parameter.
configuration - the configuration.
algorithm - the algorithm to be used.
parameters - the batch parameters to be used.
index -

processPowerSetParameter

protected static void processPowerSetParameter(BatchParameter param,
                                               Configuration configuration,
                                               String algorithm,
                                               List<BatchParameter> parameters,
                                               int index,
                                               List<Configuration> configurations)
Processes power set parameters.

Parameters:
param -
configuration -
algorithm -
parameters -
index -
configurations -

processSequenceParameter

protected static void processSequenceParameter(BatchParameter param,
                                               Configuration configuration,
                                               String algorithm,
                                               List<BatchParameter> parameters,
                                               int index,
                                               List<Configuration> configurations)
Processes sequence parameters.

Parameters:
param -
configuration -
algorithm -
parameters -
index -
configurations -

processForLoopParameter

protected static void processForLoopParameter(BatchParameter param,
                                              Configuration configuration,
                                              String algorithm,
                                              List<BatchParameter> parameters,
                                              int index,
                                              List<Configuration> configurations)
Processes for loop parameters.

Parameters:
param -
configuration -
algorithm -
parameters -
index -
configurations -

call

public BatchResultSet call()
                    throws Exception
Specified by:
call in interface Callable<BatchResultSet>
Throws:
Exception

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.