jigcell.compare.objective
Class WOSSObjective

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by jigcell.compare.impl.Transferer
          extended by jigcell.compare.impl.DataSource
              extended by jigcell.compare.data.DataGenerator
                  extended by jigcell.compare.data.EditableDataGenerator
                      extended by jigcell.compare.data.ProgrammableDataGenerator
                          extended by jigcell.compare.objective.Objective
                              extended by jigcell.compare.objective.WOSSObjective
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, IDataGenerator, IDataSource, IEditableDataGenerator, IProgrammableDataGenerator, IReadableDataSource, IWriteableDataSource, IDimensionWeightObjective, IElementWeightObjective, IInterpolationObjective, IObjective

public class WOSSObjective
extends Objective
implements IDimensionWeightObjective, IElementWeightObjective, IInterpolationObjective

A generator whose function is a weighted orthogonal sum of squares.

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

Author:
Nicholas Allen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jigcell.compare.data.EditableDataGenerator
EditableDataGenerator.EditableDataGeneratorDelegate
 
Nested classes/interfaces inherited from interface jigcell.compare.IDataSource
IDataSource.Option
 
Nested classes/interfaces inherited from interface jigcell.compare.IDataSource
IDataSource.Option
 
Nested classes/interfaces inherited from interface jigcell.compare.IDataSource
IDataSource.Option
 
Field Summary
protected static int BUFFER_LENGTH_ELEMENT
          Length of element slices to work with
protected static int BUFFER_LENGTH_VALUE
          Length of value slices to work with
static java.lang.String DIMENSIONWEIGHT_RECIPROCALSQUARE
          Default dimension weight of the square of the reciprocal of the element
static java.lang.String INTERPOLATION_LINEAR
          Linear interpolation
protected static java.lang.String NAME_GENERATOR
          Display name of this generator
protected static double SMALL_VALUE
          Size of the largest small double
 
Fields inherited from class jigcell.compare.objective.Objective
ERROR, OPTION_DATA, OPTION_FUNCTION
 
Fields inherited from class jigcell.compare.data.ProgrammableDataGenerator
allowDescriptionQuery, callStack, listenerList
 
Fields inherited from class jigcell.compare.data.DataGenerator
COMPARATOR_NAME, DESCRIPTION_READ, SEPARATOR_ESCAPE, SPECIAL_CHARS
 
Fields inherited from class jigcell.compare.impl.DataSource
OPTIONS_LOCK, SEPARATOR_PAIR, SEPARATOR_PART, SEPARATORS
 
Fields inherited from class jigcell.compare.impl.Transferer
CSV_FOOTER, CSV_LINEPOSTPEND, CSV_LINEPREPEND, CSV_LINESEPARATOR, HTML_FOOTER, HTML_HEADPOSTPEND, HTML_HEADPREPEND, HTML_HEADSEPARATOR, HTML_LINEPOSTPEND, HTML_LINEPREPEND, HTML_LINESEPARATOR
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Fields inherited from interface jigcell.compare.objective.IDimensionWeightObjective
ATTRIBUTE_DEFAULTDIMENSIONWEIGHT, ATTRIBUTE_DIMENSIONWEIGHTS, DIMENSIONWEIGHT_0, DIMENSIONWEIGHT_1, OPTION_DEFAULTDIMENSIONWEIGHTS
 
Fields inherited from interface jigcell.compare.IDataGenerator
ATTRIBUTE_COMMENT, ATTRIBUTE_GUID, PROPERTY_GENERATOR_EDIT, RESOURCE_GENERATORS
 
Fields inherited from interface jigcell.compare.IReadableDataSource
OPTION_READDESCRIPTION, OPTION_READICON
 
Fields inherited from interface jigcell.compare.IDataSource
OPTION_NAME
 
Fields inherited from interface jigcell.compare.objective.IElementWeightObjective
ATTRIBUTE_DEFAULTELEMENTWEIGHT, ATTRIBUTE_ELEMENTWEIGHTS, ELEMENTWEIGHT_0, ELEMENTWEIGHT_1, OPTION_DEFAULTELEMENTWEIGHTS
 
Fields inherited from interface jigcell.compare.IDataGenerator
ATTRIBUTE_COMMENT, ATTRIBUTE_GUID, PROPERTY_GENERATOR_EDIT, RESOURCE_GENERATORS
 
Fields inherited from interface jigcell.compare.IReadableDataSource
OPTION_READDESCRIPTION, OPTION_READICON
 
Fields inherited from interface jigcell.compare.IDataSource
OPTION_NAME
 
Fields inherited from interface jigcell.compare.objective.IInterpolationObjective
ATTRIBUTE_INTERPOLATION, INTERPOLATION_NONE, OPTION_INTERPOLATIONS
 
Fields inherited from interface jigcell.compare.IDataGenerator
ATTRIBUTE_COMMENT, ATTRIBUTE_GUID, PROPERTY_GENERATOR_EDIT, RESOURCE_GENERATORS
 
Fields inherited from interface jigcell.compare.IReadableDataSource
OPTION_READDESCRIPTION, OPTION_READICON
 
Fields inherited from interface jigcell.compare.IDataSource
OPTION_NAME
 
Fields inherited from interface jigcell.compare.objective.IObjective
OPTION_OBJECTIVE, PROPERTY_OBJECTIVE_EDIT, RESOURCE_OBJECTIVES
 
Fields inherited from interface jigcell.compare.IProgrammableDataGenerator
METHOD_GENERATE, OPTION_COMPARE, OPTION_INPUTTYPECHECKER, OPTION_OUTPUTTYPECHECKER
 
Fields inherited from interface jigcell.compare.IWriteableDataSource
OPTION_WRITEDESCRIPTION, OPTION_WRITEICON
 
Constructor Summary
WOSSObjective()
          Creates a new data generator based upon a least squares computation.
 
Method Summary
protected  IDataElement evaluate(IDataElement input)
          Computes the values of this generator.
protected  IDataElement evaluateLinear(IDataElement e1, IDataElement e2, IDataElement dimensionWeights, double dimensionWeightDefault, IDataElement elementWeights, double elementWeightDefault)
          Computes weighted orthogonal sum of squares with linear interpolation.
private  double evaluateLinear(IDataElement _e1, long l, double[] e1xBuffer, IDataElement e2, IDataElement[] e2Buffer, long l2, double[] e2xBuffer, double[] e2xBuffer2, IDataElement dimensionWeights, double dimensionWeightDefault, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares with linear interpolation.
private  double evaluateLinear(IDataElement _e1, long l, double[] e1xBuffer, IDataElement _e2, IDataElement _e3, double[] e2xBuffer, double[] e2xBuffer2, IDataElement dimensionWeights, double dimensionWeightDefault, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares with linear interpolation.
private  double evaluateLinear(IDataElement _e1, long l, double[] e1xBuffer, IDataElement _e2, IDataElement _e3, double[] e2xBuffer, double[] e2xBuffer2, IDataElement dimensionWeights, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares with linear interpolation.
protected  IDataElement evaluateNone(IDataElement e1, IDataElement e2, IDataElement dimensionWeights, double dimensionWeightDefault, IDataElement elementWeights, double elementWeightDefault)
          Computes weighted orthogonal sum of squares without interpolation.
private  double evaluateNone(IDataElement _e1, long l, double[] e1xBuffer, IDataElement _e2, double[] e2xBuffer, IDataElement dimensionWeights, double dimensionWeightDefault, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares without interpolation.
private  double evaluateNone(IDataElement _e1, long l, double[] e1xBuffer, IDataElement _e2, double[] e2xBuffer, IDataElement dimensionWeights, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares without interpolation.
private  double evaluateNone(IDataElement _e1, long l, double[] e1xBuffer, IDataElement e2, IDataElement[] e2Buffer, long l2, double[] e2xBuffer, IDataElement dimensionWeights, double dimensionWeightDefault, long dl, double[] scaleBuffer)
          Helper function for computing weighted orthogonal sum of squares without interpolation.
static java.lang.Object getCustomizableInstances()
          Generates an instance.
 java.lang.String getDefaultDimensionWeight()
          The dimension weight default.
 java.util.List getDefaultDimensionWeights()
          Valid dimension weight defaults.
 java.lang.String getDefaultElementWeight()
          The element weight default.
 java.util.List getDefaultElementWeights()
          Valid element weight defaults.
 IDataElement getDimensionWeights()
          The dimension weights.
 IDataElement getElementWeights()
          The element weights.
 java.lang.String getInterpolation()
          The interpolation.
 java.util.List getInterpolations()
          The valid interpolations
 void setDefaultDimensionWeight(java.lang.String weight)
          Sets the dimension weights.
 void setDefaultElementWeight(java.lang.String weight)
          Sets the element weights.
 void setDimensionWeights(IDataElement weights)
          Sets the suggested dimension weights.
 void setElementWeights(IDataElement weights)
          Sets the suggested element weights.
 void setInterpolation(java.lang.String interpolation)
          Sets the suggested interpolation.
protected  void setWeights(java.lang.String key, java.lang.String weights)
          Sets a weight.
 
Methods inherited from class jigcell.compare.objective.Objective
evaluate, getData, getFunction, getObjectiveForGenerator, setData, setFunction
 
Methods inherited from class jigcell.compare.data.ProgrammableDataGenerator
addEvaluationListener, clear, copy, createCustomizer, fireEvaluationError, fireEvaluationError, fireEvaluationStart, fireEvaluationStop, getAllowDescriptionQuery, getCallStack, getElement, getElement, getEvaluationLock, getInputTypeChecker, getInterface, getOutputTypeChecker, initializeSource, isCached, peekElement, peekInterface, propertyChange, removeEvaluationListener, setAllowDescriptionQuery, setInputTypeChecker, setInterfaceClass, setOutputTypeChecker, updateInterface
 
Methods inherited from class jigcell.compare.data.EditableDataGenerator
getPredictedCompatibility, getPredictedCompatibility, isSet, setAttribute, setComment, setElement, setElement, setOption, setState, write
 
Methods inherited from class jigcell.compare.data.DataGenerator
clone, compareByName, copy, generateGUID, getAttribute, getComment, getCopiedFrom, getName, getPredictedContents, getTransferData, isCopy, isCopyRelated, read, setCopyName, setName, toString
 
Methods inherited from class jigcell.compare.impl.DataSource
addOption, addPropertyChangeListener, addPropertyChangeListener, configure, getOption, getOptions, getOptionType, getPropertyChangeListeners, getPropertyChangeListeners, getReadDescriptionOption, getReadIconOption, getState, getWriteDescriptionOption, getWriteIconOption, persistSource, removePropertyChangeListener, removePropertyChangeListener, setOptions, setOptionType, setReadDescriptionOption, setReadIconOption, setWriteDescriptionOption, setWriteIconOption, unpersistSource
 
Methods inherited from class jigcell.compare.impl.Transferer
addExtension, addFlavor, createCSVTable, createFormattedTable, createHTMLTable, getExceptionRecorder, getExpectedClasses, getExpectedClasses, getExpectedClasses, getFlavors, getFlavors, getPreferredExtensions, getPreferredExtensions, getTransferClass, getTransferDataFlavors, getTransferFlavor, isDataFlavorSupported, transfer
 
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jigcell.compare.IDataGenerator
copy, getAttribute, getComment, getCopiedFrom, getElement, isCached, isCopy, isCopyRelated, setAttribute
 
Methods inherited from interface jigcell.compare.IReadableDataSource
getPredictedContents, getReadDescriptionOption, getReadIconOption, read, setReadDescriptionOption, setReadIconOption
 
Methods inherited from interface jigcell.compare.IDataSource
addOption, clone, configure, getName, getOption, getState, setOption, setState
 
Methods inherited from interface jigcell.compare.IDataGenerator
copy, getAttribute, getComment, getCopiedFrom, getElement, isCached, isCopy, isCopyRelated, setAttribute
 
Methods inherited from interface jigcell.compare.IReadableDataSource
getPredictedContents, getReadDescriptionOption, getReadIconOption, read, setReadDescriptionOption, setReadIconOption
 
Methods inherited from interface jigcell.compare.IDataSource
addOption, clone, configure, getName, getOption, getState, setOption, setState
 
Methods inherited from interface jigcell.compare.IDataGenerator
copy, getAttribute, getComment, getCopiedFrom, getElement, isCached, isCopy, isCopyRelated, setAttribute
 
Methods inherited from interface jigcell.compare.IReadableDataSource
getPredictedContents, getReadDescriptionOption, getReadIconOption, read, setReadDescriptionOption, setReadIconOption
 
Methods inherited from interface jigcell.compare.IDataSource
addOption, clone, configure, getName, getOption, getState, setOption, setState
 
Methods inherited from interface jigcell.compare.objective.IObjective
clear
 
Methods inherited from interface jigcell.compare.IProgrammableDataGenerator
addEvaluationListener, getCallStack, getElement, getEvaluationLock, getInputTypeChecker, getInterface, getOutputTypeChecker, peekElement, removeEvaluationListener
 
Methods inherited from interface jigcell.compare.IEditableDataGenerator
setComment, setCopyName, setElement, setName
 
Methods inherited from interface jigcell.compare.IWriteableDataSource
getPredictedCompatibility, getPredictedCompatibility, getWriteDescriptionOption, getWriteIconOption, setWriteDescriptionOption, setWriteIconOption, write
 

Field Detail

INTERPOLATION_LINEAR

public static final java.lang.String INTERPOLATION_LINEAR
Linear interpolation

See Also:
Constant Field Values

DIMENSIONWEIGHT_RECIPROCALSQUARE

public static final java.lang.String DIMENSIONWEIGHT_RECIPROCALSQUARE
Default dimension weight of the square of the reciprocal of the element

See Also:
Constant Field Values

SMALL_VALUE

protected static final double SMALL_VALUE
Size of the largest small double

See Also:
Constant Field Values

BUFFER_LENGTH_ELEMENT

protected static final int BUFFER_LENGTH_ELEMENT
Length of element slices to work with

See Also:
Constant Field Values

BUFFER_LENGTH_VALUE

protected static final int BUFFER_LENGTH_VALUE
Length of value slices to work with

See Also:
Constant Field Values

NAME_GENERATOR

protected static final java.lang.String NAME_GENERATOR
Display name of this generator

See Also:
Constant Field Values
Constructor Detail

WOSSObjective

public WOSSObjective()
Creates a new data generator based upon a least squares computation.

Method Detail

getCustomizableInstances

public static java.lang.Object getCustomizableInstances()
Generates an instance.


getDefaultDimensionWeight

public java.lang.String getDefaultDimensionWeight()
The dimension weight default.

Specified by:
getDefaultDimensionWeight in interface IDimensionWeightObjective

getDefaultDimensionWeights

public java.util.List getDefaultDimensionWeights()
Valid dimension weight defaults.

Specified by:
getDefaultDimensionWeights in interface IDimensionWeightObjective

getDefaultElementWeight

public java.lang.String getDefaultElementWeight()
The element weight default.

Specified by:
getDefaultElementWeight in interface IElementWeightObjective

getDefaultElementWeights

public java.util.List getDefaultElementWeights()
Valid element weight defaults.

Specified by:
getDefaultElementWeights in interface IElementWeightObjective

getDimensionWeights

public IDataElement getDimensionWeights()
The dimension weights.

Specified by:
getDimensionWeights in interface IDimensionWeightObjective

getElementWeights

public IDataElement getElementWeights()
The element weights.

Specified by:
getElementWeights in interface IElementWeightObjective

getInterpolation

public java.lang.String getInterpolation()
The interpolation.

Specified by:
getInterpolation in interface IInterpolationObjective

getInterpolations

public java.util.List getInterpolations()
The valid interpolations

Specified by:
getInterpolations in interface IInterpolationObjective

setDefaultDimensionWeight

public void setDefaultDimensionWeight(java.lang.String weight)
Sets the dimension weights. Implementations should act on this reasonably.

Specified by:
setDefaultDimensionWeight in interface IDimensionWeightObjective
Parameters:
weight - Dimension weight default

setDefaultElementWeight

public void setDefaultElementWeight(java.lang.String weight)
Sets the element weights. Implementations should act on this reasonably.

Specified by:
setDefaultElementWeight in interface IElementWeightObjective
Parameters:
weight - Element weight default

setDimensionWeights

public void setDimensionWeights(IDataElement weights)
Sets the suggested dimension weights. Implementations should act on this reasonably.

Specified by:
setDimensionWeights in interface IDimensionWeightObjective
Parameters:
weights - Dimension weights

setElementWeights

public void setElementWeights(IDataElement weights)
Sets the suggested element weights. Implementations should act on this reasonably.

Specified by:
setElementWeights in interface IElementWeightObjective
Parameters:
weights - Element weights

setInterpolation

public void setInterpolation(java.lang.String interpolation)
Sets the suggested interpolation. Implementations should act on this reasonably.

Specified by:
setInterpolation in interface IInterpolationObjective
Parameters:
interpolation - Interpolation

evaluate

protected IDataElement evaluate(IDataElement input)
Computes the values of this generator.

Overrides:
evaluate in class Objective
Parameters:
input - List of the inputs provided to this generator

evaluateLinear

protected IDataElement evaluateLinear(IDataElement e1,
                                      IDataElement e2,
                                      IDataElement dimensionWeights,
                                      double dimensionWeightDefault,
                                      IDataElement elementWeights,
                                      double elementWeightDefault)
Computes weighted orthogonal sum of squares with linear interpolation.

Parameters:
e1 - Experimental point set
e2 - Model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default dimension weight
elementWeights - Scale of point results
elementWeightDefault - Default element weight

evaluateNone

protected IDataElement evaluateNone(IDataElement e1,
                                    IDataElement e2,
                                    IDataElement dimensionWeights,
                                    double dimensionWeightDefault,
                                    IDataElement elementWeights,
                                    double elementWeightDefault)
Computes weighted orthogonal sum of squares without interpolation.

Parameters:
e1 - Experimental point set
e2 - Model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default dimension weight
elementWeights - Scale of point results
elementWeightDefault - Default element weight

setWeights

protected void setWeights(java.lang.String key,
                          java.lang.String weights)
Sets a weight.

Parameters:
key - Weight name
weights - Weights

evaluateLinear

private double evaluateLinear(IDataElement _e1,
                              long l,
                              double[] e1xBuffer,
                              IDataElement e2,
                              IDataElement[] e2Buffer,
                              long l2,
                              double[] e2xBuffer,
                              double[] e2xBuffer2,
                              IDataElement dimensionWeights,
                              double dimensionWeightDefault,
                              long dl,
                              double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares with linear interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
e2 - Model point set
e2Buffer - Temporary storage for rows from model point set
l2 - Number of model point set rows
e2xBuffer - Temporary storage for values from model point set
e2xBuffer2 - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default value for dimension weight
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values

evaluateLinear

private double evaluateLinear(IDataElement _e1,
                              long l,
                              double[] e1xBuffer,
                              IDataElement _e2,
                              IDataElement _e3,
                              double[] e2xBuffer,
                              double[] e2xBuffer2,
                              IDataElement dimensionWeights,
                              double dimensionWeightDefault,
                              long dl,
                              double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares with linear interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
_e2 - One row from model point set
_e3 - Next row from model point set
e2xBuffer - Temporary storage for values from model point set
e2xBuffer2 - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default value for dimension weight
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values

evaluateLinear

private double evaluateLinear(IDataElement _e1,
                              long l,
                              double[] e1xBuffer,
                              IDataElement _e2,
                              IDataElement _e3,
                              double[] e2xBuffer,
                              double[] e2xBuffer2,
                              IDataElement dimensionWeights,
                              long dl,
                              double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares with linear interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
_e2 - One row from model point set
_e3 - Next row from model point set
e2xBuffer - Temporary storage for values from model point set
e2xBuffer2 - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values

evaluateNone

private double evaluateNone(IDataElement _e1,
                            long l,
                            double[] e1xBuffer,
                            IDataElement e2,
                            IDataElement[] e2Buffer,
                            long l2,
                            double[] e2xBuffer,
                            IDataElement dimensionWeights,
                            double dimensionWeightDefault,
                            long dl,
                            double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares without interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
e2 - Model point set
e2Buffer - Temporary storage for rows from model point set
l2 - Number of model point set rows
e2xBuffer - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default value for dimension weight
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values

evaluateNone

private double evaluateNone(IDataElement _e1,
                            long l,
                            double[] e1xBuffer,
                            IDataElement _e2,
                            double[] e2xBuffer,
                            IDataElement dimensionWeights,
                            double dimensionWeightDefault,
                            long dl,
                            double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares without interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
_e2 - One row from model point set
e2xBuffer - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dimensionWeightDefault - Default value for dimension weight
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values

evaluateNone

private double evaluateNone(IDataElement _e1,
                            long l,
                            double[] e1xBuffer,
                            IDataElement _e2,
                            double[] e2xBuffer,
                            IDataElement dimensionWeights,
                            long dl,
                            double[] scaleBuffer)
Helper function for computing weighted orthogonal sum of squares without interpolation.

Parameters:
_e1 - One row from experimental point set
l - Length of row from experimental point set
e1xBuffer - Temporary storage for values from experimental point set
_e2 - One row from model point set
e2xBuffer - Temporary storage for values from model point set
dimensionWeights - Linear transformation of point vectors
dl - Number of dimension weights available
scaleBuffer - Temporary storage for dimension weight values