Package org.sbml.jsbml

Examples of org.sbml.jsbml.Compartment


    assertEquals(M.getRule(0), ar);
  }

  @Test
  public void test_Model_createCompartment() {
    Compartment c = M.createCompartment();
    assertTrue(c != null);
    assertTrue(M.getCompartmentCount() == 1);
    assertTrue(c.equals(c));
    assertTrue(M.getCompartment(0).equals(c)); // TODO: check why this is failing
  }
View Full Code Here


   * object.getNamespaces().getLength() == 2 ); object = null; }
   */

  @Test
  public void test_Model_getCompartment() {
    Compartment c1 = new Compartment(2, 4);
    Compartment c2 = new Compartment(2, 4);
    c1.setId("A");
    c2.setId("B");
    M.addCompartment(c1);
    M.addCompartment(c2);
    assertTrue(M.getCompartmentCount() == 2);
    c1 = M.getCompartment(0);
    c2 = M.getCompartment(1);
    assertTrue(c1.getId().equals("A"));
    assertTrue(c2.getId().equals("B"));
  }
View Full Code Here

    assertTrue(c2.getId().equals("B"));
  }

  @Test
  public void test_Model_getCompartmentById() {
    Compartment c1 = new Compartment(2, 4);
    Compartment c2 = new Compartment(2, 4);
    c1.setId("A");
    c2.setId("B");
    M.addCompartment(c1);
    M.addCompartment(c2);
    assertTrue(M.getCompartmentCount() == 2);
    // assertTrue(!M.getCompartment("A").equals(c1)); // would be the same in jsbml
    // assertTrue(!M.getCompartment("B").equals(c2));
View Full Code Here

    assertEquals(M.getUnitDefinition("rototillers"), null);
  }

  @Test
  public void test_Model_removeCompartment() {
    Compartment o1, o2, o3;
    o1 = M.createCompartment();
    o2 = M.createCompartment();
    o3 = M.createCompartment();
    o3.setId("test");
    assertTrue(M.removeCompartment(0).equals(o1));
View Full Code Here

   */
  public EventTest() throws ParseException, XMLStreamException, SBMLException {
    SBMLDocument doc = new SBMLDocument(3, 1);
    doc.addTreeNodeChangeListener(this);
    Model model = doc.createModel("event_model");
    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),
View Full Code Here

          }
        }
      }
      if (model.isSetListOfCompartments()) {
        for (int i = 0; i < model.getCompartmentCount(); i++) {
          Compartment compartment = model.getCompartment(i);

          setCompartmentCompartmentType(compartment, model);
          setCompartmentOutside(compartment, model);
          setCompartmentUnits(compartment, model);
        }
View Full Code Here

              return unitDefinition;
            } else if (elementName.equals("compartment")
                && list.getSBaseListType().equals(
                    ListOf.Type.listOfCompartments)) {
              Compartment compartment = (Compartment) newContextObject;
              model.addCompartment(compartment);

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

  private void setAssignmentRuleVariable(AssignmentRule rule, Model model) {

    if (rule.isSetVariable()) {
      String variableID = rule.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
View Full Code Here

  private void setCompartmentOutside(Compartment compartment, Model model) {

    if (compartment.isSetOutside()) {
      String outsideID = compartment.getOutside();

      Compartment outside = model.getCompartment(outsideID);

      if (outside != null) {
        compartment.setOutside(outside);
      } else {
        // TODO: the compartment ID doesn't match a compartment, throw
View Full Code Here

      Model model) {

    if (eventAssignment.isSetVariable()) {
      String variableID = eventAssignment.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.Compartment

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.