Search in sources :

Example 1 with Parameter

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

the class EquationSet method getOutputParameters.

/**
 *        Assembles list of all variables that can be used in an output expression.
 *        Depends on results of: resolveLHS() (optional, enables us to remove "reference" variables)
 */
public ParameterDomain getOutputParameters() {
    ImageIcon icon;
    if (connectionBindings == null) {
        icon = ImageUtil.getImage("layer.gif");
    } else {
        icon = ImageUtil.getImage("bridge.gif");
    }
    // TODO: should we return the empty string, or replace it with something?
    ParameterDomain result = new ParameterDomain(name, icon);
    for (Variable v : variables) {
        if (v.hasAttribute("reference"))
            continue;
        String defaultValue = "";
        if (v.equations.size() > 0)
            defaultValue = v.equations.first().expression.render();
        result.addParameter(new Parameter(v.nameString(), defaultValue));
    }
    for (EquationSet s : parts) {
        result.addSubdomain(s.getOutputParameters());
    }
    return result;
}
Also used : ImageIcon(javax.swing.ImageIcon) AccessVariable(gov.sandia.n2a.language.AccessVariable) ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) Parameter(gov.sandia.n2a.parms.Parameter)

Example 2 with Parameter

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

the class FixedParameterSpacePanel method populate.

// AMap wrap operation
private void populate(TNode nParent, ParameterDomain domain) {
    for (ParameterDomain subdomain : domain.getSubdomains()) {
        TNode nSubdomain = new TNode(new NodeSubdomain(subdomain));
        populate(nSubdomain, subdomain);
        nParent.add(nSubdomain);
    }
    for (Parameter param : domain.getParameters()) {
        TNode nParam = new TNode(new NodeParameter(param));
        nParent.add(nParam);
    }
}
Also used : NodeSubdomain(gov.sandia.umf.platform.ui.ensemble.tree.NodeSubdomain) TNode(replete.gui.controls.simpletree.TNode) NodeParameter(gov.sandia.umf.platform.ui.ensemble.tree.NodeParameter) ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) NodeParameter(gov.sandia.umf.platform.ui.ensemble.tree.NodeParameter) Parameter(gov.sandia.n2a.parms.Parameter)

Example 3 with Parameter

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

the class ParameterSpecGroupPanel method initPanel.

private void initPanel(ParameterSpecGroup group) {
    for (Object key : group.keySet()) {
        ParameterSpecification spec = group.get(key);
        String keyStr = key.toString();
        String[] path = keyStr.split("\\.");
        List<ParameterDomain> d = new ArrayList<ParameterDomain>();
        for (int i = 0; i < path.length - 1; i++) {
            String seg = path[i];
            d.add(new ParameterDomain(seg));
        }
        // , dv, desc,icon);
        Parameter param = new Parameter(path[path.length - 1]);
        ParameterBundle bundle = new ParameterBundle(d, param);
        addParam(bundle, spec);
    }
}
Also used : ConstantParameterSpecification(gov.sandia.umf.platform.ensemble.params.specs.ConstantParameterSpecification) ParameterSpecification(gov.sandia.n2a.parms.ParameterSpecification) UniformParameterSpecification(gov.sandia.umf.platform.ensemble.params.specs.UniformParameterSpecification) EvenSpacingParameterSpecification(gov.sandia.umf.platform.ensemble.params.specs.EvenSpacingParameterSpecification) ParameterDomain(gov.sandia.n2a.parms.ParameterDomain) ArrayList(java.util.ArrayList) Parameter(gov.sandia.n2a.parms.Parameter) ParameterBundle(gov.sandia.n2a.parms.ParameterBundle)

Example 4 with Parameter

use of gov.sandia.n2a.parms.Parameter 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 5 with Parameter

use of gov.sandia.n2a.parms.Parameter 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)

Aggregations

Parameter (gov.sandia.n2a.parms.Parameter)7 ParameterDomain (gov.sandia.n2a.parms.ParameterDomain)7 NodeParameter (gov.sandia.umf.platform.ui.ensemble.tree.NodeParameter)2 NodeSubdomain (gov.sandia.umf.platform.ui.ensemble.tree.NodeSubdomain)2 TNode (replete.gui.controls.simpletree.TNode)2 AccessVariable (gov.sandia.n2a.language.AccessVariable)1 ParameterBundle (gov.sandia.n2a.parms.ParameterBundle)1 ParameterSpecification (gov.sandia.n2a.parms.ParameterSpecification)1 ConstantParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.ConstantParameterSpecification)1 EvenSpacingParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.EvenSpacingParameterSpecification)1 UniformParameterSpecification (gov.sandia.umf.platform.ensemble.params.specs.UniformParameterSpecification)1 ArrayList (java.util.ArrayList)1 ImageIcon (javax.swing.ImageIcon)1