use of de.lmu.ifi.dbs.elki.math.statistics.distribution.HaltonUniformDistribution in project elki by elki-project.
the class GeneratorXMLDatabaseConnection method processElementHalton.
/**
* Process a 'halton' Element in the XML stream.
*
* @param cluster
* @param cur Current document nod
*/
private void processElementHalton(GeneratorSingleCluster cluster, Node cur) {
double min = 0.0;
double max = 1.0;
String minstr = ((Element) cur).getAttribute(ATTR_MIN);
if (minstr != null && minstr.length() > 0) {
min = ParseUtil.parseDouble(minstr);
}
String maxstr = ((Element) cur).getAttribute(ATTR_MAX);
if (maxstr != null && maxstr.length() > 0) {
max = ParseUtil.parseDouble(maxstr);
}
// *** new uniform generator
Random random = cluster.getNewRandomGenerator();
Distribution generator = new HaltonUniformDistribution(min, max, random);
cluster.addGenerator(generator);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while (iter.hasNext()) {
Node child = iter.next();
if (child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
}
Aggregations