use of gov.sandia.n2a.language.function.Gaussian in project n2a by frothga.
the class XyceRenderer method render.
public boolean render(Operator op) {
if (op instanceof AccessVariable) {
AccessVariable av = (AccessVariable) op;
result.append(change(av.reference));
return true;
}
// IE: they are not an ongoing source of randomness during execution.
if (op instanceof Uniform) {
Uniform u = (Uniform) op;
if (u.operands.length > 0) {
int dimension = (int) Math.round(((Scalar) u.operands[0].eval(pi)).value);
if (dimension != 1)
System.err.println("WARNING: Xyce does not support multivariate form of uniform()");
}
result.append("rand()");
return true;
}
if (op instanceof Gaussian) {
Gaussian g = (Gaussian) op;
if (g.operands.length > 0) {
int dimension = (int) Math.round(((Scalar) g.operands[0].eval(pi)).value);
if (dimension != 1)
System.err.println("WARNING: Xyce does not support multivariate form of gaussian()");
}
result.append("agauss(0,6,6)");
return true;
}
if (op instanceof Power) {
Power p = (Power) op;
result.append("(");
p.operand0.render(this);
result.append(") ** (");
p.operand1.render(this);
result.append(")");
return true;
}
return false;
}
Aggregations