Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data.synthetic.bymodel
Class GeneratorMain

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorMain

public class GeneratorMain
extends Object

Generate a data set according to a given model. Key idea of this generator is to re-generate points if they are more likely to belong to a different cluster than the one they were generated for. The benefit is that we should end up with a data set that follows closely the model that we specified. The drawbacks are that on one hand, specifications might be unsatisfiable. For this a retry count is kept and an UnableToComplyException is thrown when the maximum number of retries is exceeded. On the other hand, the model might not be exactly as specified. When the generator reports an "Density correction factor estimation" that differs from 1.0 this is an indication that the result is not exact. On the third hand, rejecting points introduces effects where one generator can influence others, so random generator results will not be stable with respect to the addition of new dimensions and similar if there are any rejects involved. So this generator is not entirely optimal for generating data sets for scalability tests on the number of dimensions, although if clusters overlap little enough (so that no rejects happen) the results should be as expected.

Author:
Erich Schubert

Field Summary
private  LinkedList<GeneratorInterface> clusters
          List of clusters to generate
static String LINE_SEPARATOR
          Line separator for output
private  boolean testAgainstModel
          Controls whether points are tested against the model during generation
 
Constructor Summary
GeneratorMain()
           
 
Method Summary
 void addCluster(GeneratorInterface c)
          Add a cluster to the cluster list.
 void generate()
          Main loop to generate data set.
 boolean isTestAgainstModel()
          Return value of the testAgainstModel flag
 void setTestAgainstModel(boolean testAgainstModel)
          Set the value of the testAgainstModel flag
 void writeClusters(OutputStreamWriter outStream)
          Write the resulting clusters to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final String LINE_SEPARATOR
Line separator for output


clusters

private LinkedList<GeneratorInterface> clusters
List of clusters to generate


testAgainstModel

private boolean testAgainstModel
Controls whether points are tested against the model during generation

Constructor Detail

GeneratorMain

public GeneratorMain()
Method Detail

addCluster

public void addCluster(GeneratorInterface c)
Add a cluster to the cluster list.

Parameters:
c - cluster to add

generate

public void generate()
              throws UnableToComplyException
Main loop to generate data set.

Throws:
UnableToComplyException - when model not satisfiable or no clusters specified.

writeClusters

public void writeClusters(OutputStreamWriter outStream)
                   throws IOException
Write the resulting clusters to an output stream.

Parameters:
outStream - output stream
Throws:
IOException - thrown on write errors

isTestAgainstModel

public boolean isTestAgainstModel()
Return value of the testAgainstModel flag

Returns:
value of testAgainstModel

setTestAgainstModel

public void setTestAgainstModel(boolean testAgainstModel)
Set the value of the testAgainstModel flag

Parameters:
testAgainstModel - New value

Release 0.3 (2010-03-31_1612)