|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.problem.dataset.DataSetBuilder net.sourceforge.cilib.problem.dataset.AssociatedPairDataSetBuilder
public class AssociatedPairDataSetBuilder
This class "collects" and holds all the patterns of the DataSet
s specified
through the addDataSet(DataSet)
method. The name is no longer relevant, because
this class no longer keeps track of cluster assignments. That is now the job of the
ClusteringUtils
class. Therefore, this class' name will probably change to
something like ClusterableDataSetBuilder.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sourceforge.cilib.problem.dataset.ClusterableDataSet |
---|
ClusterableDataSet.Pattern |
Field Summary | |
---|---|
protected ArrayList<ClusterableDataSet.Pattern> |
patterns
|
Fields inherited from class net.sourceforge.cilib.problem.dataset.DataSetBuilder |
---|
dataSets |
Constructor Summary | |
---|---|
AssociatedPairDataSetBuilder()
Initialise the patterns data structure and set the identifier to be blank. |
|
AssociatedPairDataSetBuilder(AssociatedPairDataSetBuilder rhs)
|
Method Summary | |
---|---|
void |
addDataSet(DataSet ds)
This method overrides DataSetBuilder.addDataSet(DataSet) because it works
completely different than a normal DataSetBuilder . |
double |
getCachedDistance(int x,
int y)
Retrieve the cached distance between the given patterns. |
AssociatedPairDataSetBuilder |
getClone()
Create a cloned copy of the current object and return it. |
String |
getIdentifier()
Get the identifier that uniquely identifies this constructed/combined/built dataset. |
Vector |
getMean()
Get the cached mean Vector . |
int |
getNumberOfPatterns()
Determine how many patterns are in this constructed/combined/built dataset. |
ClusterableDataSet.Pattern |
getPattern(int i)
Get the pattern that is represented by the given index. |
ArrayList<ClusterableDataSet.Pattern> |
getPatterns()
Get all the patterns in this constructed/combined/built dataset. |
double |
getVariance()
Get the cached variance (scalar). |
void |
initialise()
By now, all the needed DataSet s should have been parsed and added to
patterns . |
Methods inherited from class net.sourceforge.cilib.problem.dataset.DataSetBuilder |
---|
getDataSet, iterator, uninitialise |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ArrayList<ClusterableDataSet.Pattern> patterns
Constructor Detail |
---|
public AssociatedPairDataSetBuilder()
public AssociatedPairDataSetBuilder(AssociatedPairDataSetBuilder rhs)
Method Detail |
---|
public AssociatedPairDataSetBuilder getClone()
Cloneable
getClone
in interface Cloneable
getClone
in class DataSetBuilder
Object.clone()
public void addDataSet(DataSet ds)
DataSetBuilder.addDataSet(DataSet)
because it works
completely different than a normal DataSetBuilder
. It takes the fact that
datasets may already have been parsed by other simulations,
problems or
threads into account. It relies on the DataSetManager
singleton to
parse and/or retrieve the patterns of the given DataSet
. Then it adds these
retrieved patterns to the current patterns
list. This method also builds up
the identifier
that uniquely identifies this dataset builder. This identifier
is used by the DataSetManager
to keep track of this built-up dataset, because
it might be used by other Simulation
s, Problem
s or Thread
s
as well.
addDataSet
in class DataSetBuilder
ds
- the DataSet
that represents a dataset that should be used when
building up the list of patterns that should be clustered
IllegalArgumentException
- when the given DataSet
is not a
LocalDataSet
. This is only temporary, because I didn't want to change
the more generic DataSet
too much.
IllegalArgumentException
- when the patterns that are currently being added have
different dimensions than the patterns that have already been collected/built
(those in patterns
).public void initialise()
DataSet
s should have been parsed and added to
patterns
. All that needs to be done is to cache the mean, the variance and
the distances between all patterns of this constructed/combined/built dataset.
initialise
in interface ClusterableDataSet
initialise
in class DataSetBuilder
public Vector getMean()
Vector
.
getMean
in interface ClusterableDataSet
cachedMean
public double getVariance()
getVariance
in interface ClusterableDataSet
cachedVariance
public double getCachedDistance(int x, int y)
getCachedDistance
in interface ClusterableDataSet
x
- index of the one patterny
- index of the other pattern
IllegalArgumentException
- when either x
or y
is
negative.public ArrayList<ClusterableDataSet.Pattern> getPatterns()
getPatterns
in interface ClusterableDataSet
patterns
listpublic ClusterableDataSet.Pattern getPattern(int i)
getPattern
in interface ClusterableDataSet
i
- the index representing a pattern in the patterns
patterns
public int getNumberOfPatterns()
getNumberOfPatterns
in interface ClusterableDataSet
patterns
public String getIdentifier()
identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |