|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorSingleCluster
public class GeneratorSingleCluster
Class to generate a single cluster according to a model as well as getting the density of a given model at that point (to evaluate generated points according to the same model)
Field Summary | |
---|---|
private LinkedList<Distribution> |
axes
The distribution generators for each axis |
private Vector |
clipmax
|
private Vector |
clipmin
Clipping vectors. |
private double |
densitycorrection
Correction factor for probability computation |
private int |
dim
The dimensionality |
private int |
discarded
Discarded count |
private String |
name
Cluster name |
LinkedList<Vector> |
points
The generated cluster points. |
private Random |
random
Random generator (used for initializing random generators) |
private int |
retries
Retry count |
private int |
size
Number of points in the cluster (-> density) |
private AffineTransformation |
trans
The transformation matrix |
Constructor Summary | |
---|---|
GeneratorSingleCluster(String name,
int size,
double densitycorrection,
Random random)
Generator (without axes) |
Method Summary | |
---|---|
void |
addDiscarded(int discarded)
Increase number of discarded points |
void |
addGenerator(Distribution gen)
Add a new generator to the cluster. |
void |
addRotation(int axis1,
int axis2,
double angle)
Apply a rotation to the generator |
void |
addTranslation(Vector v)
Add a translation to the generator |
LinkedList<Vector> |
generate(int count)
Generate the given number of additional points. |
LinkedList<Distribution> |
getAxes()
Get axis generators. |
Vector |
getClipmax()
Return a copy of the 'clipping maximum' vector |
Vector |
getClipmin()
Return a copy of the 'clipping minimum' vector. |
double |
getDensity(Vector p)
Compute density for cluster model at given vector p- |
double |
getDensityCorrection()
Return density correction factor |
int |
getDim()
Get the cluster dimensionality |
int |
getDiscarded()
Get number of discarded points |
String |
getName()
Get cluster name. |
Random |
getNewRandomGenerator()
Create a new random generator (reproducible) |
LinkedList<Vector> |
getPoints()
Return the list of points (no copy) |
int |
getRetries()
Return number of remaining retries. |
int |
getSize()
Return the size |
AffineTransformation |
getTrans()
Get transformation |
void |
setClipping(Vector min,
Vector max)
Set a clipping box. min needs to be smaller than max in each component. |
void |
setDensityCorrection(double densitycorrection)
Set density correction factor. |
void |
setPoints(LinkedList<Vector> points)
Set the list of points in the cluster |
private boolean |
testClipping(Vector p)
Test if a point is to be clipped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private LinkedList<Distribution> axes
private AffineTransformation trans
private int dim
private Vector clipmin
private Vector clipmax
private double densitycorrection
private int size
private String name
private int retries
private int discarded
public LinkedList<Vector> points
private Random random
Constructor Detail |
---|
public GeneratorSingleCluster(String name, int size, double densitycorrection, Random random)
name
- Cluster namesize
- Cluster sizedensitycorrection
- Density correction factorrandom
- Random number generatorMethod Detail |
---|
public void addGenerator(Distribution gen) throws UnableToComplyException
gen
- Distribution generator
UnableToComplyException
- thrown when no new generators may be added anymorepublic void addRotation(int axis1, int axis2, double angle)
axis1
- First axis (0 <= axis1 < dim)axis2
- Second axis (0 <= axis2 < dim)angle
- Angle in Radianspublic void addTranslation(Vector v)
v
- translation vectorpublic void setClipping(Vector min, Vector max) throws UnableToComplyException
min
- Minimum values for clippingmax
- Maximum values for clipping
UnableToComplyException
- thrown when invalid vectors were given.public int getDim()
getDim
in interface GeneratorInterface
private boolean testClipping(Vector p)
p
- point
public LinkedList<Vector> generate(int count) throws UnableToComplyException
generate
in interface GeneratorInterface
count
- Number of points to generate
UnableToComplyException
- when generation failsGeneratorInterface.generate(int)
public double getDensity(Vector p)
getDensity
in interface GeneratorInterface
p
- vector
GeneratorInterface.getDensity(de.lmu.ifi.dbs.elki.math.linearalgebra.Vector)
public LinkedList<Distribution> getAxes()
public AffineTransformation getTrans()
public Vector getClipmin()
public Vector getClipmax()
public LinkedList<Vector> getPoints()
getPoints
in interface GeneratorInterface
public void setPoints(LinkedList<Vector> points)
points
- New list of points in this cluster.public int getSize()
getSize
in interface GeneratorInterface
public String getName()
getName
in interface GeneratorInterface
public int getDiscarded()
getDiscarded
in interface GeneratorInterfaceDynamic
public void addDiscarded(int discarded)
addDiscarded
in interface GeneratorInterfaceDynamic
discarded
- number of points discarded.public int getRetries()
getRetries
in interface GeneratorInterfaceDynamic
public double getDensityCorrection()
public void setDensityCorrection(double densitycorrection)
densitycorrection
- new density correction factor.public Random getNewRandomGenerator()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |