use of gov.sandia.umf.platform.ensemble.params.ParameterSetList in project n2a by frothga.
the class ParameterSpecGroupSet method printParameterSets.
public void printParameterSets(boolean includeDVGroup) {
ParameterSetList sets = generateAllSetsFromSpecs(includeDVGroup);
System.out.println(sets.size() + " Parameter Set" + StringUtil.s(sets.size()) + ":");
for (ParameterSet set : sets) {
System.out.println(set);
}
}
use of gov.sandia.umf.platform.ensemble.params.ParameterSetList in project n2a by frothga.
the class ParameterSpecGroupSet method generateAllSetsFromSpecs.
public ParameterSetList generateAllSetsFromSpecs(boolean includeDVGroup) throws ParameterSpecGroupSetValidationException {
validate();
Set<Object> skipDVGroupParams = findSkipDVGroupParams();
ParameterSetList sets = new ParameterSetList();
// does return "zero" runs.
if (size() == 1 && get(0) == defaultValueGroup && !includeDVGroup) {
sets.add(new ParameterSet());
return sets;
}
// Make sure that the default value group is applied at the end for
// this process, just to have a nicely-sorted final parameter set,
// and use the sorted copy of this group set
// to access group information from this point forward in
// the method. Wouldn't need this sorted copy if code
// were refactored to not have the DV group as part of the
// actual group list.
ParameterSpecGroupSet sortedCopy = new ParameterSpecGroupSet(this);
sortedCopy.setDefaultValueGroup(defaultValueGroup, sortedCopy.size());
// Get the counts of each group.
Integer[] groupRunCounts = sortedCopy.getGroupRunCounts(includeDVGroup);
for (int[] idxs : new CombinationsIterator(groupRunCounts)) {
ParameterSet set = new ParameterSet();
for (int i = 0, g = 0; i < idxs.length; i++) {
ParameterSpecGroup group = sortedCopy.get(g++);
// Ignore the default values if desired.
if (!includeDVGroup && group == defaultValueGroup) {
// Just leap past this one, move to next.
group = sortedCopy.get(g++);
}
int idx = idxs[i];
addGroupParamsToParamSet(set, group, idx, skipDVGroupParams);
}
// if(includeDVGroup && defaultValueGroup != null) { // If refactored to have DV group separate reference.
// addGroupParamsToParamSet(skipDVGroupParams, set, idx, defaultValueGroup);
// }
sets.add(set);
}
return sets;
}
use of gov.sandia.umf.platform.ensemble.params.ParameterSetList in project n2a by frothga.
the class FixedParameterSpacePanel method updateFromGroups.
protected void updateFromGroups() {
ParameterSpecGroupSet newGroups = pnlGroups.getParameterSpecGroupSet();
newGroups.setDefaultValueGroup(defaultValueGroup);
try {
newGroups.validate();
setError(null);
} catch (Exception e) {
setError(new RuntimeException("There is a problem with your parameterization.", e));
return;
}
groups = newGroups;
ParameterSetList sets = groups.generateAllSetsFromSpecs(chkDV.isSelected());
mdlParamSets.setParameterSetList(sets);
pnlParamDetails.updateRun(sets.getNumSets(), estDuration);
}
Aggregations