Vector<Node> distributionParameters = parseParameterArray(distr);
//add the subparameters which are passed to the distribution parameter
distributionParameters.addAll(parseParameterArray(distrPar));
// Gets correct instance of distribution
Distribution dist = engineToGuiDistr.get(classname).clone();
Element currpar;
String param_name;
for (int i = 0; i < distributionParameters.size(); i++) {
currpar = (Element) distributionParameters.get(i);
param_name = currpar.getAttribute(XML_A_SUBPARAMETER_NAME);
//if current parameter is a nested Distribution
if (currpar.getAttribute(XML_A_SUBPARAMETER_CLASSPATH).equals(distributionContainer)) {
//parse the currentparameter to get DIRECT subparameters
Vector<Node> nestedDistr = parseParameterArray(currpar);
// If distribution is not set, returns null
Object param_value = null;
if (nestedDistr.size() == 0) {
param_value = null;
} else {
//parse the nested distribution
param_value = parseDistribution((Element) nestedDistr.get(0), (Element) nestedDistr.get(1));
dist.getParameter(param_name).setValue(param_value);
}
} else {
String param_value = findText(currpar.getElementsByTagName(XML_E_SUBPARAMETER_VALUE).item(0));
dist.getParameter(param_name).setValue(param_value);
}
dist.updateCM(); // Updates values of c and mean
}
return dist;
}