jigcell.compare.tests
Class ObjectiveBenchmark

java.lang.Object
  extended by jigcell.compare.tests.Benchmark
      extended by jigcell.compare.tests.ObjectiveBenchmark
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class ObjectiveBenchmark
extends Benchmark
implements java.beans.PropertyChangeListener

A collection of tests for evaluating objective function loading performance.

This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.

Author:
Nicholas Allen

Field Summary
protected  IDataEditorTab experimentView
          View to load experimental data in
protected  EditableSeriesView objectiveView
          View to load objective functions in
protected  IDataGenerator result
          Record of loading results
protected  FileDataSource source
          Source to load from
 
Fields inherited from class jigcell.compare.tests.Benchmark
benchmarkRunnable, compare
 
Constructor Summary
ObjectiveBenchmark(Compare compare)
          Creates a new tester for objective function loading performance.
 
Method Summary
 double benchmark(int size)
          Runs an objective loading benchmark.
 double benchmarkAddRow(int size)
          Runs a benchmark that loads an experiment file, adds a new row, saves the experiment file, loads a transform file, adds a new transform, and saves the transform file.
static IDataGeneratorMap generateData(int size)
          Generates some objective functions.
static IObjective generateObjective(IObjective metric, int seed)
          Generates a new objective function.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 IDataGenerator runBenchmark()
          Runs a collection of benchmarks for loading objective files.
 IDataGenerator runBenchmarkAddRow()
          Runs a collection of benchmarks for configuring a new experiment.
protected  void runOffEventThread()
          Performs the tester computations that do not interact with the interface.
protected  void runOnEventThread(int state)
          Performs an operation that interacts with the interface.
static void test(Compare compare)
          Runs a loading benchmark.
 
Methods inherited from class jigcell.compare.tests.Benchmark
createBenchmarkReport, currentTime, loadInView, reset, runState, timeRunState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectiveView

protected EditableSeriesView objectiveView
View to load objective functions in


source

protected FileDataSource source
Source to load from


experimentView

protected IDataEditorTab experimentView
View to load experimental data in


result

protected IDataGenerator result
Record of loading results

Constructor Detail

ObjectiveBenchmark

public ObjectiveBenchmark(Compare compare)
Creates a new tester for objective function loading performance.

Parameters:
compare - Comparator to abuse
Method Detail

generateData

public static IDataGeneratorMap generateData(int size)
Generates some objective functions. The objective functions match up with the experiments generated by ExperimentPerformanceTester.

Parameters:
size - Number of objective functions to create

generateObjective

public static IObjective generateObjective(IObjective metric,
                                           int seed)
Generates a new objective function.

Parameters:
metric - Function to use as objective
seed - Number used to create unique data

test

public static void test(Compare compare)
Runs a loading benchmark.

Parameters:
compare - Comparator to abuse

benchmark

public double benchmark(int size)
                 throws java.lang.Exception
Runs an objective loading benchmark.

Parameters:
size - Number of objectives to create
Throws:
java.lang.Exception

benchmarkAddRow

public double benchmarkAddRow(int size)
                       throws java.lang.Exception
Runs a benchmark that loads an experiment file, adds a new row, saves the experiment file, loads a transform file, adds a new transform, and saves the transform file.

Parameters:
size - Size of experiment and transform files
Throws:
java.lang.Exception

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

runBenchmark

public IDataGenerator runBenchmark()
                            throws java.lang.Exception
Runs a collection of benchmarks for loading objective files.

Throws:
java.lang.Exception

runBenchmarkAddRow

public IDataGenerator runBenchmarkAddRow()
                                  throws java.lang.Exception
Runs a collection of benchmarks for configuring a new experiment.

Throws:
java.lang.Exception

runOffEventThread

protected void runOffEventThread()
                          throws java.lang.Exception
Performs the tester computations that do not interact with the interface. This method will be called at the start of the test.

Specified by:
runOffEventThread in class Benchmark
Throws:
java.lang.Exception

runOnEventThread

protected void runOnEventThread(int state)
                         throws java.lang.Exception
Performs an operation that interacts with the interface. After the operation completes, the thread needs to notify the benchmark.

Specified by:
runOnEventThread in class Benchmark
Parameters:
state - Indicates which interface operation is next
Throws:
java.lang.Exception