/** * Returns {@code true} if this model contains a reference to a * {@link FunctionDefinition} with the given identifier. * * @param id the id to search for * @return {@code true} if this model contains a reference to a * {@link FunctionDefinition} with the given identifier. */ public boolean containsFunctionDefinition(String id) { return getFunctionDefinition(id) != null; }
FunctionDefinition def = m.getFunctionDefinition(i);
@Override public ASTNodeValue function(String functionDefinitionName, List<ASTNode> args) throws SBMLException { FunctionDefinition func = model.getFunctionDefinition(functionDefinitionName); if (func == null) { throw new SBMLException("FunctionDefinition with id ' " + functionDefinitionName + "' cannot be found in the model."); } function(func, args); return dummy; }
/** * Returns the variable ({@link FunctionDefinition}) of this {@link ASTCiFunctionNode}. * * @return the variable of this node */ public FunctionDefinition getReferenceInstance() { FunctionDefinition function = null; Model m = isSetParentSBMLObject() ? getParentSBMLObject().getModel() : null; if (m != null) { function = isSetRefId() ? m.getFunctionDefinition(getRefId()) : null; if (function == null) { logger.debug(MessageFormat.format( "Cannot find any element with id \"{0}\" in the model.", isSetRefId() ? getRefId() : null)); } } else { logger.debug(MessageFormat.format( "This ASTCiFunctionNode is not yet linked to a model. " + "No element with id \"{0}\" could be found.", isSetRefId() ? getRefId() : null)); } return function; }
FunctionDefinition def = m.getFunctionDefinition(node.getName());
functionDef = astNode.getParentSBMLObject().getModel().getFunctionDefinition(characters.trim()); } catch(NullPointerException e) {
@Override public boolean check(ValidationContext ctx, LocalParameter lp) { Model m = lp.getModel(); if (m != null) { String id = lp.getId(); // ID should't be used by anything else return m.getFunctionDefinition(id) == null && m.getCompartment(id) == null && m.getSpecies(id) == null && m.getParameter(id) == null && m.getReaction(id) == null; } return true; } };
@Override public boolean check(ValidationContext ctx, ASTNode node) { ASTNode.Type type = node.getType(); if (type == Type.FUNCTION) { // System.out.println("10219 - Found a FUNCTION " + " - " + node.getName()); Model m = node.getParentSBMLObject().getModel(); if (m != null) { FunctionDefinition fd = m.getFunctionDefinition(node.getName()); if (fd != null) { // TODO - for L3V2, we can have no bvar defined !! // System.out.println("10219 - " + node.getNumChildren() + " - " + fd.getArgumentCount()); return node.getNumChildren() == fd.getArgumentCount(); } else { // System.out.println("10219 - fd is null"); } } else { // System.out.println("10219 - Model is null"); } } return true; }
FunctionDefinition fd = m.getFunctionDefinition(sid);
@Override public boolean check(ValidationContext ctx, ASTNode node) { // If is a function if (node.getType() == Type.FUNCTION) { Model m = node.getParentSBMLObject().getModel(); if (m != null) { FunctionDefinition f = m.getFunctionDefinition(node.getName()); if (f == null) { // TODO - for the second parameter, we should print something more complete so that the element could be identified easily ValidationConstraint.logError(ctx, CORE_10214, node.getParentSBMLObject(), ValidationTools.printASTNodeAsFormula(node.getParentSBMLObject().getMath()), node.getParentSBMLObject().getElementName(), node.getName()); return false; } } } return true; }
FunctionDefinition func = model.getFunctionDefinition(functionDefinitionId); getRelatedFunctionsId(relatedFunctionsIdSet, allFunctionsIdSet, func.getMath()); subModel.addFunctionDefinition(model.getFunctionDefinition(functionDefinitionId).clone());
FunctionDefinition fd = m.getFunctionDefinition(node.getName());