Examples of FunctionDefinition


Examples of org.sbml.jsbml.FunctionDefinition

  public MathMLTest() {
    int level = 3;
    int version = 1;
    SBMLDocument doc = new SBMLDocument(level, 1);
    Model m = doc.createModel("id");
    FunctionDefinition fd = m.createFunctionDefinition("fd");
    ASTNode math = new ASTNode(Type.LAMBDA, fd);
    math.addChild(new ASTNode("x", fd));
    ASTNode pieces = ASTNode.piecewise(new ASTNode(3, fd), ASTNode.lt("x",
        ASTNode.abs(Double.NEGATIVE_INFINITY, fd)), ASTNode.times(
        new ASTNode(5.3, fd), ASTNode.log(new ASTNode(8, fd))));
    pieces = ASTNode.times(pieces, ASTNode.root(new ASTNode(2, fd),
        new ASTNode(16, fd)));
    math.addChild(pieces);
    fd.setMath(math);
    System.out.println(math.toMathML());
   
    Species species = m.createSpecies("spec");
    Reaction r = m.createReaction("r");
    r.addReactant(new SpeciesReference(species));
View Full Code Here

Examples of org.sbml.jsbml.FunctionDefinition

  /**
   * Test method for {@link org.sbml.jsbml.Model#removeFunctionDefinition(java.lang.String)}.
   */
  @Test
  public void testRemoveFunctionDefinitionString() {
    FunctionDefinition r = modelL3.createFunctionDefinition("fd1");
    assertTrue(modelL3.getFunctionDefinition(r.getId()) != null);

    modelL3.removeFunctionDefinition(r.getId());
    assertTrue(modelL3.getFunctionDefinition(r.getId()) == null);
  }
View Full Code Here

Examples of org.sbml.jsbml.FunctionDefinition

            Model model = (Model) list.getParentSBMLObject();
            if (elementName.equals("functionDefinition")
                && list.getSBaseListType().equals(
                    ListOf.Type.listOfFunctionDefinitions)
                && model.getLevel() > 1) {
              FunctionDefinition functionDefinition = (FunctionDefinition) newContextObject;
              model.addFunctionDefinition(functionDefinition);

              return functionDefinition;
            } else if (elementName.equals("unitDefinition")
                && list.getSBaseListType().equals(
View Full Code Here

Examples of org.sbml.libsbml.FunctionDefinition

      public void testEvaluateLightFunction() throws IOException {
          SBMLDocument light = libsbml.readSBML(Light.getAbsolutePath());
          Model m = light.getModel();
          ListOfFunctionDefinitions lofd = m.getListOfFunctionDefinitions();
          for (long i = 0; i < lofd.size(); i++) {
              FunctionDefinition fd = lofd.get(i);
            
              ASTNode root = convertSBMLMathToJavaMath(fd.getMath());
             
              System.err.println(new FormulaFormatter().formulaToString(root));

              // over each timestep
              for (double step = 0.1; step < 100; step += 0.5) {
View Full Code Here

Examples of org.springmodules.validation.valang.functions.FunctionDefinition

        if (applicationContext == null) {
            return functionByName;
        }
        String[] names = applicationContext.getBeanNamesForType(FunctionDefinition.class);
        for (int i = 0; i < names.length; i++) {
            FunctionDefinition def = (FunctionDefinition) applicationContext.getBean(names[i]);
            functionByName.put(def.getName(), def.getClassName());
        }
        return functionByName;
    }
View Full Code Here

Examples of org.zkoss.zuss.metainfo.FunctionDefinition

            nextAndCheck(ctx, ';', true);

            final Method mtd = Classes.getMethod(
              ((Other)t0).getValue(), name, adefs.length,
              getFilename(), t0.getLine());
            new FunctionDefinition(
              ctx.block.owner, name, adefs, mtd, lineno);
            return;
          } else {
            putback(t1);
            final Expression expr = new Expression(t0.getLine());
              //note: expr is NOT a child of any node but part of VariableDefinition below
            parseExpression(ctx, expr, ';');
            new FunctionDefinition(
              ctx.block.owner, name, adefs, expr, lineno);
            return;
          }
        } else if (symbol == '{') { //mixin
          newBlock(ctx, new MixinDefinition(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.