public class Projector
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Dataset |
downstairs
A set of low-d datapoints, each of which is an array of doubles The
projection of the upstairs data.
|
protected double |
tolerance
Distance within which added points are considered old and are thus not
added.
|
protected Dataset |
upstairs
A set of hi-d datapoints, each of which is an array of doubles The data
to be projected.
|
Constructor and Description |
---|
Projector()
Default constructor for projector.
|
Projector(int dimension)
Default constructor for projector.
|
Modifier and Type | Method and Description |
---|---|
void |
addDatapoint(DataPointColored point)
Add a new point to the dataset, using the currently selected add method.
|
void |
addListener(ProjectorListener projectorListener)
Add a projector listener.
|
boolean |
compareDatasets()
Check 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.
|
void |
fireDataPointAdded()
Notify listeners that a new datapoint has been added to the projector.
|
void |
fireProjectionMethodChanged()
Notify listeners that the projection method has been changed.
|
void |
fireProjectorColorsChanged()
Notify listeners that the colors of some datapoints have changed but
nothing else.
|
void |
fireProjectorDataChanged()
Notify listeners that data (in particular the underlying points) have
been changed.
|
DataColoringManager |
getColorManager() |
java.lang.String |
getCurrentMethodString()
Used to get the String associated with the current projection method.
|
DataPoint |
getCurrentPoint() |
int |
getDimensions()
Number of dimensions of the underlying data.
|
Dataset |
getDownstairs()
Convenience method to get downstairs dataset.
|
int |
getNumPoints()
Returns the size of the dataset.
|
ProjectionMethod |
getProjectionMethod() |
java.util.HashMap<java.lang.Class<?>,java.lang.String> |
getProjectionMethods() |
double |
getTolerance() |
Dataset |
getUpstairs()
Convenience method to get upstairs dataset.
|
void |
importData(java.io.File theFile)
Add new high-d datapoints and reinitialize the datasets.
|
void |
init(int dims)
Initialize projector to accept data of a specified dimension.
|
void |
iterate()
Iterate the dataset once.
|
void |
postOpenInit()
Updates datasets from persistent forms of data.
|
void |
randomize(int upperBound)
Randomize the low-dimensional data.
|
void |
reset()
Reset the projector.
|
void |
resetColors()
Reset the colors of all colored data points.
|
void |
setProjectionMethod(ProjectionMethod method)
Change the current projection method and perform and other needed
initialization.
|
void |
setProjectionMethod(java.lang.String projName) |
void |
setTolerance(double tolerance) |
java.lang.String |
toString() |
protected Dataset upstairs
protected Dataset downstairs
protected double tolerance
public Projector()
public Projector(int dimension)
dimension
- dimensionality of data to be projectedpublic void addListener(ProjectorListener projectorListener)
projectorListener
- the listener to addpublic void init(int dims)
dims
- dimensionality of the high dimensional datasetpublic void postOpenInit()
public void addDatapoint(DataPointColored point)
point
- the upstairs point to addpublic void setProjectionMethod(ProjectionMethod method)
method
- the new projection algorithmpublic void setProjectionMethod(java.lang.String projName)
projName
- the name of the projection algorithm to switch topublic void importData(java.io.File theFile)
theFile
- file containing the high-d data, forwarded to a dataset
methodpublic java.lang.String getCurrentMethodString()
public int getDimensions()
public void fireDataPointAdded()
public void fireProjectionMethodChanged()
public void fireProjectorColorsChanged()
public void fireProjectorDataChanged()
public ProjectionMethod getProjectionMethod()
public Dataset getUpstairs()
public Dataset getDownstairs()
public void iterate()
public void reset()
public void resetColors()
public int getNumPoints()
public java.lang.String toString()
toString
in class java.lang.Object
public double getTolerance()
public void setTolerance(double tolerance)
tolerance
- the tolerance to setpublic void randomize(int upperBound)
upperBound
- the upper bound of randomizationpublic DataColoringManager getColorManager()
public boolean compareDatasets()
public java.util.HashMap<java.lang.Class<?>,java.lang.String> getProjectionMethods()
public DataPoint getCurrentPoint()