Package org.sbml.jsbml

Examples of org.sbml.jsbml.Compartment


  @Before
  public void setUp() throws Exception {
    docL3 = new SBMLDocument(3, 1);
    modelL3 = docL3.createModel("test");
    modelL3.createUnitDefinition("ud1");
    Compartment c = modelL3.createCompartment("comp");
    modelL3.createSpecies("s1", c);
    modelL3.createEvent("event");
   
    docL2V4 = new SBMLDocument(2, 4);
    modelL2V4 = docL2V4.createModel("test");
View Full Code Here


  /**
   * Test method for {@link org.sbml.jsbml.Model#removeCompartment(java.lang.String)}.
   */
  @Test
  public void testRemoveCompartmentString() {
    Compartment c = modelL3.createCompartment("c2");
    assertTrue(modelL3.getCompartment(c.getId()) != null);

    modelL3.removeCompartment(c.getId());
    assertTrue(modelL3.getCompartment(c.getId()) == null);
  }
View Full Code Here

   *
   */
  @Test public void checkHashCode() throws ParseException {
    SBMLDocument doc1 = new SBMLDocument(3, 1);
    Model model = doc1.createModel("test_model");
    Compartment c = model.createCompartment("c1");
    Species s = model.createSpecies("s1", c);
    s.addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001"));
    Rule r = model.createAlgebraicRule();
    r.setMath(ASTNode.parseFormula("sin(3) + 1"));
   
View Full Code Here

          }
        }
      }
      if (model.isSetListOfCompartments()) {
        for (int i = 0; i < model.getCompartmentCount(); i++) {
          Compartment compartment = model.getCompartment(i);
          if (compartment.isSetCompartmentType()
              && !compartment.isSetCompartmentTypeInstance()) {
            log4jLogger.warn("No CompartmentType matches the compartmentTypeID of compartment.");
          }
          if (compartment.isSetOutside()
              && !compartment.isSetOutsideInstance()) {
            log4jLogger.warn("No Compartment matches the outsideID of compartment.");
          }
          if (compartment.isSetUnits()
              && !compartment.isSetUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the unitsID of compartment.");
          }
        }
      }
      if (model.isSetListOfEvents()) {
View Full Code Here

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

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

   */
  @SuppressWarnings("deprecation")
  public static void main(String args[]) throws ParseException, XMLStreamException, SBMLException {
    SBMLDocument doc = new SBMLDocument(1, 2);
    Model m = doc.createModel();
    Compartment c = m.createCompartment("c1");
    Species s1 = m.createSpecies("s1", c);
    Species s2 = m.createSpecies("s2", c);
    Reaction r = m.createReaction("r1");
    r.createReactant(null, s1);
    r.createProduct(null, s2);
View Full Code Here

public class TestCompartment {
  private Compartment C;

  @Before public void setUp() throws Exception
  {
    C = new  Compartment(2,4);
    if (C == null);
    {
    }
  }
View Full Code Here

    assertEquals( false, C.isSetOutside() );
  }

  @Test public void test_Compartment_createWith()
  {
    Compartment c = new  Compartment(2,4);
    c.setId( "A");
//    assertTrue( c.getTypeCode() == libsbml.SBML_COMPARTMENT );
    assertTrue( c.getMetaId().equals("") == true );
    assertTrue( c.getNotes() == null );
    // assertTrue( c.getAnnotation() == null );
    assertTrue( c.getName().equals("") == true );
    assertTrue( c.getSpatialDimensions() == 3d );
    assertTrue(c.getId().equals( "A"     ));
    assertTrue( c.getConstant() == true );
    assertEquals( true, c.isSetId() );
    assertEquals( false, c.isSetName() );
    c = null;
  }
View Full Code Here

  }

  @SuppressWarnings("deprecation")
@Test public void test_Compartment_initDefaults()
  {
    Compartment c = new  Compartment(2,4);
    c.setId( "A");
    c.initDefaults();
    assertTrue(c.getId().equals( "A"));
    assertTrue( c.getName().equals("") == true );
    assertTrue( c.getUnits().equals("") == true );
    assertTrue( c.getOutside().equals("") == true );
    assertTrue( c.getSpatialDimensions() == 3d );
    // assertTrue( c.getVolume() == 1.0 ); // There is no default for the volume/size in L2 !!
    assertTrue( Double.isNaN(c.getVolume()));
    assertTrue( c.getConstant() == true );
    assertEquals( true, c.isSetId() );
    assertEquals( false, c.isSetName() );
    assertEquals( false, c.isSetSize() );
    assertEquals( false, c.isSetVolume() );
    assertEquals( false, c.isSetUnits() );
    assertEquals( false, c.isSetOutside() );
    c = null;
  }
View Full Code Here

    assertEquals(kl1.getParameter("k3"), null);
  }

  @Test
  public void test_Model_addCompartment() {
    Compartment c = new Compartment(2, 4);
    c.setId("c");
    M.addCompartment(c);
    assertTrue(M.getNumCompartments() == 1);
  }
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.