Package org.sbml.jsbml

Examples of org.sbml.jsbml.Compartment


  @SuppressWarnings("deprecation")
  @Test
  public void test_read_l1v1_branch() throws XMLStreamException, InvalidPropertiesFormatException, IOException, ClassNotFoundException {
    SBMLDocument d;
    Model m;
    Compartment c;
    KineticLaw kl;
    LocalParameter p;
    Reaction r;
    Species s;
    SpeciesReference sr;
    UnitDefinition ud;
    String filename = DATA_FOLDER + "/libsbml-test-data/l1v1-branch.xml";
    d = new SBMLReader().readSBML(filename);
    if (d == null)
      ;
    {
    }
    assertTrue(d.getLevel() == 1);
    assertTrue(d.getVersion() == 1);
    m = d.getModel();
    assertTrue(m.getName().equals("Branch"));
    assertTrue(m.getNumCompartments() == 1);
    c = m.getCompartment(0);
    assertTrue(c.getName().equals("compartmentOne"));
    assertTrue(c.getVolume() == 1);
    ud = c.getDerivedUnitDefinition();
    assertTrue(ud.getNumUnits() == 1);

    // assertTrue(ud.getUnit(0).getKind() == Unit.Kind.LITRE); // getDerivedUnitDefinition not working properly
    assertTrue(m.getNumSpecies() == 4);
    s = m.getSpecies(0);
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

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

  @Test
  public void test_Model_createCompartment() {
    Compartment c = M.createCompartment();
    assertTrue(c != null);
    assertTrue(M.getNumCompartments() == 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.getNumCompartments() == 2);
    c1 = M.getCompartment(0);
    c2 = M.getCompartment(1);
    assertTrue(c1.getId().equals("A"));
    assertTrue(c2.getId().equals("B"));
  }
View Full Code Here

          }
        }
      }
      if (model.isSetListOfCompartments()) {
        for (int i = 0; i < model.getNumCompartments(); 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

      InitialAssignment initialAssignment, Model model) {

    if (initialAssignment.isSetVariable()) {
      String variableID = initialAssignment.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.