Search in sources :

Example 6 with ParameterDomain

use of gov.sandia.n2a.parms.ParameterDomain in project n2a by frothga.

the class XyceBackend method getSimulatorParameters.

@Override
public ParameterDomain getSimulatorParameters() {
    ParameterDomain inputs = new ParameterDomain();
    // TODO:  add real integration options, etc. - also need code to make sure they get in netlist!
    inputs.addParameter(new Parameter("duration", 1.0));
    inputs.addParameter(new Parameter("seed", 0));
    inputs.addParameter(new Parameter("xyce.integrator", "trapezoid"));
    return inputs;
}
Also used : ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) Parameter(gov.sandia.n2a.parms.Parameter)

Example 7 with ParameterDomain

use of gov.sandia.n2a.parms.ParameterDomain in project n2a by frothga.

the class InternalBackend method getSimulatorParameters.

@Override
public ParameterDomain getSimulatorParameters() {
    ParameterDomain result = new ParameterDomain();
    // default is 1 second
    result.addParameter(new Parameter("duration", "1.0"));
    // alt is "RungeKutta"
    result.addParameter(new Parameter("internal.integrator", "Euler"));
    return result;
}
Also used : ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) Parameter(gov.sandia.n2a.parms.Parameter)

Example 8 with ParameterDomain

use of gov.sandia.n2a.parms.ParameterDomain in project n2a by frothga.

the class BackendC method getSimulatorParameters.

@Override
public ParameterDomain getSimulatorParameters() {
    ParameterDomain result = new ParameterDomain();
    // default is 1 second
    result.addParameter(new Parameter("duration", "1.0"));
    // alt is "RungeKutta"
    result.addParameter(new Parameter("c.integrator", "Euler"));
    return result;
}
Also used : ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) Parameter(gov.sandia.n2a.parms.Parameter)

Example 9 with ParameterDomain

use of gov.sandia.n2a.parms.ParameterDomain in project n2a by frothga.

the class FixedParameterSpacePanel method getSelectedParamsAsBundles.

private List<ParameterBundle> getSelectedParamsAsBundles(TreePath[] paths) {
    List<ParameterBundle> bundles = new ArrayList<ParameterBundle>();
    for (TreePath path : paths) {
        List<ParameterDomain> domains = new ArrayList<ParameterDomain>();
        if (tabParamDomains.getSelectedIndex() == 0) {
            domains.add(new ParameterDomain("Model"));
        } else {
            domains.add(new ParameterDomain("Simulator"));
        }
        for (int p = 0; p < path.getPathCount(); p++) {
            Object u = ((TNode) path.getPathComponent(p)).getObject();
            if (u instanceof NodeSubdomain) {
                domains.add(((NodeSubdomain) u).getSubdomain());
            }
        }
        NodeBase uLeaf = ((TNode) path.getLastPathComponent()).getObject();
        if (uLeaf instanceof NodeParameter) {
            NodeParameter p = (NodeParameter) uLeaf;
            bundles.add(new ParameterBundle(domains, p.getParameter()));
        } else {
            // TODO: add all children?
            return null;
        }
    }
    return bundles;
}
Also used : NodeSubdomain(gov.sandia.umf.platform.ui.ensemble.tree.NodeSubdomain) NodeBase(replete.gui.controls.simpletree.NodeBase) TNode(replete.gui.controls.simpletree.TNode) TreePath(javax.swing.tree.TreePath) NodeParameter(gov.sandia.umf.platform.ui.ensemble.tree.NodeParameter) ArrayList(java.util.ArrayList) ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) ParameterBundle(gov.sandia.n2a.parms.ParameterBundle)

Example 10 with ParameterDomain

use of gov.sandia.n2a.parms.ParameterDomain in project n2a by frothga.

the class FixedParameterSpacePanel method constructDVGroup.

private void constructDVGroup() {
    allDomains = new ParameterDomain();
    if (modelDomain != null) {
        allDomains.addSubdomain(modelDomain);
    }
    if (simDomain != null) {
        allDomains.addSubdomain(simDomain);
    }
    defaultValueGroup = new ConstantParameterSpecGroup();
    Map<Object, Object> flat = ParameterDomain.flattenDomains(allDomains);
    for (Object paramKey : flat.keySet()) {
        defaultValueGroup.addConstParameter(paramKey, flat.get(paramKey));
    }
}
Also used : ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) ConstantParameterSpecGroup(gov.sandia.umf.platform.ensemble.params.groups.ConstantParameterSpecGroup)

Aggregations

ParameterDomain (gov.sandia.n2a.parms.ParameterDomain)13 Parameter (gov.sandia.n2a.parms.Parameter)7 NodeParameter (gov.sandia.umf.platform.ui.ensemble.tree.NodeParameter)4 NodeSubdomain (gov.sandia.umf.platform.ui.ensemble.tree.NodeSubdomain)4 TNode (replete.gui.controls.simpletree.TNode)4 ParameterBundle (gov.sandia.n2a.parms.ParameterBundle)3 ArrayList (java.util.ArrayList)3 ParameterKeyPath (gov.sandia.n2a.parms.ParameterKeyPath)2 ParameterSpecification (gov.sandia.n2a.parms.ParameterSpecification)2 ConstantParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.ConstantParameterSpecification)2 EvenSpacingParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.EvenSpacingParameterSpecification)2 UniformParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.UniformParameterSpecification)2 TreePath (javax.swing.tree.TreePath)2 NodeBase (replete.gui.controls.simpletree.NodeBase)2 AccessVariable (gov.sandia.n2a.language.AccessVariable)1 ConstantParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.ConstantParameterSpecGroup)1 ParameterSpecGroup (gov.sandia.umf.platform.ensemble.params.groups.ParameterSpecGroup)1 TransferableParameterBundles (gov.sandia.umf.platform.ui.ensemble.TransferableParameterBundles)1 Cursor (java.awt.Cursor)1 ImageIcon (javax.swing.ImageIcon)1