Package org.sbml.jsbml

Examples of org.sbml.jsbml.EventAssignment


    Event e = model.createEvent("e1");
    Priority prior = e.createPriority();
    prior.setMath(new ASTNode(1));
    Trigger t = e.createTrigger();
    t.setFormula("time == 1");
    EventAssignment ea = e.createEventAssignment(p, ASTNode
        .parseFormula("3"));
    e.addEventAssignment(ea);
    System.out.println((new SBMLWriter()).writeSBMLToString(doc));
  }
View Full Code Here


  }

  @Test
  public void test_Model_createEventAssignment() {
    Event e;
    EventAssignment ea;
    M.createEvent();
    M.createEvent();
    ea = M.createEventAssignment();
    assertTrue(ea != null);
    assertTrue(M.getEventCount() == 2);
View Full Code Here

          setEventTimeUnits(event, model);

          if (event.isSetListOfEventAssignments()) {

            for (int j = 0; j < event.getEventAssignmentCount(); j++) {
              EventAssignment eventAssignment = event
                  .getEventAssignment(j);

              setEventAssignmentVariable(eventAssignment, model);
            }
          }
View Full Code Here

  {
    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);
    e.setTrigger(trigger);
    e.setId( "e1");
    e.setName( "Set k2 to zero when P1 <= t");
    e.addEventAssignment(ea);
View Full Code Here

    e = null;
  }

  @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

      p = null;
    }

    @Test public void test_Event_addIdenticalObjectToAListOf()
    {
      @SuppressWarnings("unused")
    EventAssignment o1,o2,o3;
      o1 = E.createEventAssignment(); // We cannot add several time the same element to a list of anything
      o2 = E.createEventAssignment();
      o3 = E.createEventAssignment();
      o3.setVariable("test");
View Full Code Here

          }

          if (event.isSetListOfEventAssignments()) {

            for (int j = 0; j < event.getEventAssignmentCount(); j++) {
              EventAssignment eventAssignment = event
                  .getEventAssignment(j);

              if (eventAssignment.isSetVariable()
                  && !eventAssignment.isSetVariableInstance()) {
                log4jLogger.warn("No Symbol matches the variableID of eventAssignment.");
              }
            }
          }
        }
View Full Code Here

            if (elementName.equals("eventAssignment")
                && list.getSBaseListType().equals(
                    ListOf.Type.listOfEventAssignments)
                && event.getLevel() > 1) {
              EventAssignment eventAssignment = (EventAssignment) newContextObject;
              event.addEventAssignment(eventAssignment);

              return eventAssignment;
            } else {
              log4jLogger.warn("The element " + elementName + " is not recognized");
View Full Code Here

    Trigger trigger = event.createTrigger();
//    trigger.setMath(ASTNode.geq(new ASTNode(ASTNode.Type.NAME_TIME),
//        new ASTNode(10)));
    trigger.setMath(ASTNode.parseFormula("time >= 10"));
   
    EventAssignment assignment1 = event.createEventAssignment();
    assignment1.setVariable(k1);
    assignment1.setMath(new ASTNode(34));
   
    EventAssignment assignment2 = event.createEventAssignment();
    assignment2.setVariable(k2);
    assignment2.setMath(new ASTNode(k1));
   
    new SBMLWriter().write(doc, System.out);
  }
View Full Code Here

  {
    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);
    e.setTrigger(trigger);
    e.setId( "e1");
    e.setName( "Set k2 to zero when P1 <= t");
    e.addEventAssignment(ea);
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.EventAssignment

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.