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;
}
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);
}
}
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);
}
}
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;
}
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;
}
Aggregations