org.simbrain.gauge.core
Class Projector

java.lang.Object
  extended by org.simbrain.gauge.core.Projector
Direct Known Subclasses:
ProjectCoordinate, ProjectPCA, ProjectSammon

public abstract class Projector
extends Object

Projector is a class describing a projection algorithm, which contains a high dimensional dataset (an "upstairs") and a low-dimensional projection of that high dimensional data (a "downstairs"). Classes which extend this class provide different ways of projecting the high dimensional space to the lowdimensional space. This class provides general methods for handling pairs of datasets and checking their integrity.


Field Summary
protected  String addMethod
          Current selected add methods.
protected  Dataset downstairs
          A set of low-d datapoints, each of which is an array of doubles The projection of the upstairs data.
protected  Settings theSettings
          Reference to an object which contains information which must persist between re-inits of the projector.
protected  Dataset upstairs
          A set of hi-d datapoints, each of which is an array of doubles The data to be projected.
 
Constructor Summary
Projector()
           
 
Method Summary
 void addDatapoint(double[] point)
          Add a datapoint to the upstairs dataset, and a corresponding point to the downstairs dataset.
 void addUpstairs(File theFile)
          Add new high-d datapoints and reinitialize the datasets.
 void checkDatasets()
          Check validity of datasets.
 boolean compareDatasets()
          Chcek the integrity of the two datasets by checking: (1) That the low-d set is at least 2 dimensions (2) That the low d space is lower dimensional than the hi d space (3) That both datasets have the same number of points.
 String getAddMethod()
           
 int getAddMethodIndex()
          Indices sed in populating combo box in general dialog.
 Dataset getDownstairs()
           
 double getPerturbationAmount()
           
 Settings getTheSettings()
           
 double getTolerance()
           
 Dataset getUpstairs()
           
abstract  boolean hasDialog()
           
 void init(Dataset up, Dataset down)
          Initialize the projector with high and low-d data.
 void init(int dims)
          Initilize a projector when only the dimension of the dataset is known.
abstract  boolean isExtendable()
           
abstract  boolean isIterable()
           
abstract  double iterate()
          Iterate, if it is iterable.
abstract  void project()
          Perform operations necessay to project the data.
 void setAddMethod(String string)
           
 void setDownstairs(Dataset downstairs)
           
 void setPerturbationAmount(double d)
           
 void setTheSettings(Settings settings)
           
 void setTolerance(double d)
           
 void setUpstairs(Dataset upstairs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upstairs

protected Dataset upstairs
A set of hi-d datapoints, each of which is an array of doubles The data to be projected.


downstairs

protected Dataset downstairs
A set of low-d datapoints, each of which is an array of doubles The projection of the upstairs data.


theSettings

protected Settings theSettings
Reference to an object which contains information which must persist between re-inits of the projector.


addMethod

protected String addMethod
Current selected add methods.

Constructor Detail

Projector

public Projector()
Method Detail

init

public void init(Dataset up,
                 Dataset down)
Initialize the projector with high and low-d data.

Parameters:
up - Reference to high dimensional dataset
down - Reference to low dimensional dataset. Pass NULL if not available

checkDatasets

public void checkDatasets()
Check validity of datasets.


init

public void init(int dims)
Initilize a projector when only the dimension of the dataset is known.

Parameters:
dims - Dimensionality of the new dataset

addUpstairs

public void addUpstairs(File theFile)
Add new high-d datapoints and reinitialize the datasets.

Parameters:
theFile - file containing the high-d data, forwarded to a dataset method

compareDatasets

public boolean compareDatasets()
Chcek the integrity of the two datasets by checking: (1) That the low-d set is at least 2 dimensions (2) That the low d space is lower dimensional than the hi d space (3) That both datasets have the same number of points.

Returns:
true if low dimensions are lower than hi dimensions and low dimension is less than one

project

public abstract void project()
Perform operations necessay to project the data. For iterable functions this is just a stub.


iterate

public abstract double iterate()
Iterate, if it is iterable. For non iterable-projectors this is just a stub

Returns:
the current error

isIterable

public abstract boolean isIterable()
Returns:
true if this projection algorithm is iterable, false otherwise

isExtendable

public abstract boolean isExtendable()
Returns:
true if this projection algorithm accepts new new points, false otherwise

hasDialog

public abstract boolean hasDialog()
Returns:
true true if current projector has a dialog.

getUpstairs

public Dataset getUpstairs()
Returns:
the high-dimensional dataset

getDownstairs

public Dataset getDownstairs()
Returns:
the low dimensional dataset

addDatapoint

public void addDatapoint(double[] point)
Add a datapoint to the upstairs dataset, and a corresponding point to the downstairs dataset. Add the new point using the currently selected method

Parameters:
point - point to be added

getTolerance

public double getTolerance()
Returns:
distance within which points are considered unique

setTolerance

public void setTolerance(double d)
Parameters:
d - distance within which points are considered unique

getPerturbationAmount

public double getPerturbationAmount()
Returns:
amount by which to perturb datapoints which overlap

setPerturbationAmount

public void setPerturbationAmount(double d)
Parameters:
d - amount by which to perturb datapoints which overlap

getTheSettings

public Settings getTheSettings()
Returns:
reference to object which contains preferences which persist when the projector is re-initialized

setTheSettings

public void setTheSettings(Settings settings)
Parameters:
settings - reference to object which contains preferences which persist when the projector is re-initialized

getAddMethod

public String getAddMethod()
Returns:
name of the add method currently selected

getAddMethodIndex

public int getAddMethodIndex()
Indices sed in populating combo box in general dialog.

Returns:
index of the add method currently selected

setAddMethod

public void setAddMethod(String string)
Parameters:
string - Method to be added.

setDownstairs

public void setDownstairs(Dataset downstairs)
Parameters:
downstairs - Sets projector downstairs.

setUpstairs

public void setUpstairs(Dataset upstairs)
Parameters:
upstairs - Sets projector upstairs.