Package org.sbml.jsbml

Examples of org.sbml.jsbml.ASTNode


  }
*/
 
  @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

    assertTrue(M.getNumSpecies() == 1);
  }

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

        // "lambda(2)",
        // "lambda(x, x+2)",
        "1" };

    for (String formula : formulae) {
      ASTNode testNode = ASTNode.parseFormula(formula);

      System.out.println("===================");
      System.out.printf("[IN]:\t%s\n", formula);
      System.out.printf("[OUT]:\t%s\n", testNode.toFormula());
      System.out.printf("[LTX]:\t%s\n", testNode.toLaTeX());

//      AssignmentRule as = new AssignmentRule(2, 4);
      Model m = new Model(2, 4);
      FunctionDefinition fd = new FunctionDefinition("f", 2, 4);
      m.addFunctionDefinition(fd);
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

   */
  public ASTNode readMathML(String mathML, TreeNodeChangeListener listener)
    throws XMLStreamException  {
    Object object = readXMLFromString(mathML, listener);   
    if (object != null && object instanceof Constraint) {
      ASTNode math = ((Constraint) object).getMath();     
      if (math != null) {
        return math;
      }
    }   
    return null;
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.