Package org.sbml.jsbml

Examples of org.sbml.jsbml.ASTNode


    Compartment c = model.createCompartment("compartment");
    model.createSpecies("s1", c);
    model.createSpecies("s2", c);
    Event ev = model.createEvent();
    Trigger trigger = ev.createTrigger(false, true, ASTNode.parseFormula("3 >= 2"));
    trigger.setMath(ASTNode.geq(new ASTNode(ASTNode.Type.NAME_TIME),
        new ASTNode(10)));
    ev.createPriority(ASTNode.parseFormula("25"));
    ev.createDelay(ASTNode.parseFormula("2"));
    ev.createEventAssignment("s1", ASTNode.parseFormula("s2"));
    System.out.println("==================================");
    new SBMLWriter().write(doc, System.out);
View Full Code Here


   * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#times(java.util.List)
   */
  public ASTNodeValue times(List<ASTNode> nodes) throws SBMLException {
    Object n[] = new ASTNodeValue[nodes.size()];
    for (int i = 0; i < nodes.size(); i++) {
      ASTNode ast = nodes.get(i);
      n[i] = new ASTNodeValue(checkBrackets(ast).toString(), this);
    }
    return new ASTNodeValue(times(n).toString(), this);
  }
View Full Code Here

     
    }
   
    @Test public void test_Event_setDelayCopy()
    {
      ASTNode math1 = null;
    try {
      math1 = ASTNode.parseFormula("0");
    } catch (ParseException e) {
      assertTrue(false);
    }
View Full Code Here

      }
    }

    @Test public void test_Event_setTriggerCopy()
    {
      ASTNode math1 = null;
      try {
        math1 = ASTNode.parseFormula("0");
      } catch (ParseException e) {
        assertTrue(false);
      }
View Full Code Here

      }
    }

    @Test public void test_FormulaOutput()
    {
      ASTNode math = null;
      try {
        math = ASTNode.parseFormula("k1 * S1");
      } catch (ParseException e) {
        assertTrue(false);
      }

      try {
      assertTrue(math.toFormula().equals("k1*S1"));
      assertTrue(math.toFormula().equals("k1 * S1")); // We are not putting the same space in the formula

    } catch (SBMLException e) {
      assertTrue(false);    }
     
    }
View Full Code Here

  }
*/
 
  @Test public void test_Event_full() throws ParseException
  {
    ASTNode math1 = ASTNode.parseFormula("0");
    Trigger trigger = new  Trigger(2,4);
    ASTNode math = ASTNode.parseFormula("0");
    Event e = new  Event(2,4);
    EventAssignment ea = new  EventAssignment(2,4);
    ea.setVariable( "k");
    ea.setMath(math);
    trigger.setMath(math1);
View Full Code Here

  }

  @Test public void test_Event_removeEventAssignment()
  {
    EventAssignment o1,o2,o3;
    ASTNode math = null;
    try {
    math = ASTNode.parseFormula("0");
  } catch (ParseException e) {
    assertTrue(false);
  }
View Full Code Here

    o3 = null;
  }

  @Test public void test_Event_setDelay() throws ParseException
  {
    ASTNode math1 = ASTNode.parseFormula("0");
    Delay delay = new  Delay(2,4);
    delay.setMath(math1);
    E.setDelay(delay);
    assertTrue(E.getDelay() != null);
    assertEquals( true, E.isSetDelay() );
View Full Code Here

    E1 = null;
  }

  @Test public void test_Event_setTrigger() throws ParseException
  {
    ASTNode math1 =  ASTNode.parseFormula("0");
    Trigger trigger = new  Trigger(2,4);
    trigger.setMath(math1);
    E.setTrigger(trigger);
    assertTrue(E.getTrigger() != null);
    assertEquals( true, E.isSetTrigger() );
View Full Code Here

   */
  @Override
  public ASTNodeValue root(double rootExponent, ASTNode radiant)
      throws SBMLException  
  {
    return function("root", new ASTNode(rootExponent), radiant);
  }
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.ASTNode

Copyright © 2018 www.massapicom. 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.