use of de.lmu.ifi.dbs.elki.utilities.random.RandomFactory in project elki by elki-project.
the class GeneratorXMLDatabaseConnection method processElementDataset.
/**
* Process a 'dataset' Element in the XML stream.
*
* @param gen Generator
* @param cur Current document nod
*/
private void processElementDataset(GeneratorMain gen, Node cur) {
// *** get parameters
String seedstr = ((Element) cur).getAttribute(ATTR_SEED);
if (clusterRandom != RandomFactory.DEFAULT && seedstr != null && seedstr.length() > 0) {
clusterRandom = new RandomFactory((long) (ParseUtil.parseIntBase10(seedstr) * sizescale));
}
String testmod = ((Element) cur).getAttribute(ATTR_TEST);
if (testmod != null && testmod.length() > 0) {
testAgainstModel = Boolean.valueOf(ParseUtil.parseIntBase10(testmod) != 0);
}
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while (iter.hasNext()) {
Node child = iter.next();
if (TAG_CLUSTER.equals(child.getNodeName())) {
processElementCluster(gen, child);
} else if (TAG_STATIC.equals(child.getNodeName())) {
processElementStatic(gen, child);
} else if (child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
}
Aggregations