Search in sources :

Example 1 with IIdentifiable

use of org.jlibsedml.IIdentifiable in project vcell by virtualcell.

the class MathMLValidator method checkFunctions.

private List<SedMLError> checkFunctions() {
    List<SedMLError> errors = new ArrayList<SedMLError>();
    ASTNode node = mathContainer.getMath();
    EvaluationContext cont = new EvaluationContext();
    for (IIdentifiable id : mathContainer.getListOfParameters()) {
        cont.setValueFor(id.getId(), 0.0);
    }
    for (IIdentifiable id : mathContainer.getListOfVariables()) {
        cont.setValueFor(id.getId(), 0.0);
    }
    if (!node.canEvaluate(cont)) {
        errors.add(new SedMLError(0, "This node [" + node.getName() + "] cannot be evaluated", ERROR_SEVERITY.WARNING));
    }
    return errors;
}
Also used : SedMLError(org.jlibsedml.SedMLError) ArrayList(java.util.ArrayList) ASTNode(org.jmathml.ASTNode) IIdentifiable(org.jlibsedml.IIdentifiable) EvaluationContext(org.jmathml.EvaluationContext)

Aggregations

ArrayList (java.util.ArrayList)1 IIdentifiable (org.jlibsedml.IIdentifiable)1 SedMLError (org.jlibsedml.SedMLError)1 ASTNode (org.jmathml.ASTNode)1 EvaluationContext (org.jmathml.EvaluationContext)1