Search in sources :

Example 1 with ParameterSetList

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);
    }
}
Also used : ParameterSet(gov.sandia.n2a.parms.ParameterSet) ParameterSetList(gov.sandia.umf.platform.ensemble.params.ParameterSetList)

Example 2 with ParameterSetList

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;
}
Also used : ParameterSet(gov.sandia.n2a.parms.ParameterSet) ParameterSetList(gov.sandia.umf.platform.ensemble.params.ParameterSetList) ConstantParameterSpecGroup(gov.sandia.umf.platform.ensemble.params.groups.ConstantParameterSpecGroup) LatinHypercubeParameterSpecGroup(gov.sandia.umf.platform.ensemble.params.groups.LatinHypercubeParameterSpecGroup) MonteCarloParameterSpecGroup(gov.sandia.umf.platform.ensemble.params.groups.MonteCarloParameterSpecGroup) ParameterSpecGroup(gov.sandia.umf.platform.ensemble.params.groups.ParameterSpecGroup)

Example 3 with ParameterSetList

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);
}
Also used : ParameterSetList(gov.sandia.umf.platform.ensemble.params.ParameterSetList) ParameterSpecGroupSet(gov.sandia.umf.platform.ensemble.params.groupset.ParameterSpecGroupSet)

Aggregations

ParameterSetList (gov.sandia.umf.platform.ensemble.params.ParameterSetList)3 ParameterSet (gov.sandia.n2a.parms.ParameterSet)2 ConstantParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.ConstantParameterSpecGroup)1 LatinHypercubeParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.LatinHypercubeParameterSpecGroup)1 MonteCarloParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.MonteCarloParameterSpecGroup)1 ParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.ParameterSpecGroup)1 ParameterSpecGroupSet (gov.sandia.umf.platform.ensemble.params.groupset.ParameterSpecGroupSet)1