Package org.sbml.jsbml

Examples of org.sbml.jsbml.Compartment


  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

   */
  private void setRateRuleVariable(RateRule 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 setReactionCompartment(Reaction reaction, Model model) {

    if (reaction.isSetCompartment()) {
      String compartmentID = reaction.getCompartment();

      Compartment compartment = model.getCompartment(compartmentID);

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

  private void setSpeciesCompartment(Species species, Model model) {

    if (species.isSetCompartment()) {
      String compartmentID = species.getCompartment();

      Compartment compartment = model.getCompartment(compartmentID);

      if (compartment != null) {
        species.setCompartment(compartment);
      } else {
        // TODO : the compartment ID doesn't match a compartment, throw
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

    assertTrue(doc.getLevel() == 2 && doc.getVersion() == 4);
   
    assertTrue(model.getId().equals(""));
    assertTrue(model.getName().equals("Swat2004_Mammalian_G1_S_Transition"));

    Compartment cell = model.getCompartment(0);
   
    assertTrue(cell.getSize() == 1);
   
    assertTrue(model.getListOfUnitDefinitions().size() == 3);   
    assertTrue(model.getListOfUnitDefinitions().get(1).getMetaId().equals("metaid_0000004"));
   
    Species pRBp = model.getSpecies("pRBp");
View Full Code Here

  @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

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.