setCompartment() публичный Метод

public setCompartment ( string sid ) : int
sid string
Результат int
Пример #1
0
 public void test_L3_Species_hasRequiredAttributes()
 {
     Species s = new  Species(3,1);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setId( "id");
       assertEquals( false, s.hasRequiredAttributes() );
       s.setCompartment( "cell");
       assertEquals( false, s.hasRequiredAttributes() );
       s.setHasOnlySubstanceUnits(false);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setBoundaryCondition(false);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setConstant(false);
       assertEquals( true, s.hasRequiredAttributes() );
       s = null;
 }
Пример #2
0
 public void test_Model_addSpecies3()
 {
     Model m = new  Model(2,2);
       Species s = new  Species(1,2);
       s.setId( "s");
       s.setCompartment( "c");
       s.setInitialAmount(2);
       int i = m.addSpecies(s);
       assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH );
       assertTrue( m.getNumSpecies() == 0 );
       s = null;
       m = null;
 }
Пример #3
0
 public void test_Model_addSpecies5()
 {
     Model m = new  Model(2,2);
       Species s = new  Species(2,2);
       s.setId( "s");
       s.setCompartment( "c");
       Species s1 = new  Species(2,2);
       s1.setId( "s");
       s1.setCompartment( "c");
       int i = m.addSpecies(s);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumSpecies() == 1 );
       i = m.addSpecies(s1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumSpecies() == 1 );
       s = null;
       s1 = null;
       m = null;
 }
 public void test_internal_consistency_check_99919()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Species s = new Species(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       s.setId("s");
       s.setCompartment("c");
       s.setHasOnlySubstanceUnits(true);
       m.addSpecies(s);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Пример #5
0
 public void test_Model_addSpecies2()
 {
     Model m = new  Model(2,2);
       Species s = new  Species(2,1);
       s.setId( "s");
       s.setCompartment( "c");
       int i = m.addSpecies(s);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumSpecies() == 0 );
       s = null;
       m = null;
 }
 public void test_internal_consistency_check_99916_reaction()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Species s = new Species(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       Reaction r = m.createReaction();
       r.setId("r");
       SpeciesReference sr = r.createReactant();
       s.setId("s");
       s.setCompartment("c");
       s.setConstant(true);
       sr.setSpecies("s");
       m.addSpecies(s);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
 public void test_internal_consistency_check_99916_rule()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Species s = new Species(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       s.setId("s");
       s.setCompartment("c");
       s.setConstant(true);
       m.addSpecies(s);
       Rule r = m.createAssignmentRule();
       r.setVariable("s");
       r.setFormula("2");
       errors = d.checkInternalConsistency();
       assertTrue( errors == 2 );
       d = null;
 }
Пример #8
0
 public void test_SBMLConvert_convertToL1_Species_Amount()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       Model m = d.createModel();
       string sid =  "C";
       Compartment c = new  Compartment(2,4);
       Species s = new  Species(2,4);
       c.setId(sid);
       m.addCompartment(c);
       s.setCompartment(sid);
       s.setInitialAmount(2.34);
       m.addSpecies(s);
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( s.getInitialAmount() == 2.34 );
       d = null;
 }
Пример #9
0
 public void test_SBMLConvert_convertToL1_Species_Concentration()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       Model m = d.createModel();
       string sid =  "C";
       Compartment c = new  Compartment(2,1);
       Species s = new  Species(2,1);
       c.setId(sid);
       c.setSize(1.2);
       m.addCompartment(c);
       s.setId( "s"  );
       s.setCompartment(sid);
       s.setInitialConcentration(2.34);
       m.addSpecies(s);
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       Species s1 = m.getSpecies(0);
       assertTrue( s1 != null );
       assertTrue((  "C" == s1.getCompartment() ));
       assertTrue( m.getCompartment( "C").getSize() == 1.2 );
       assertTrue( s1.getInitialConcentration() == 2.34 );
       assertTrue( s1.isSetInitialConcentration() == true );
       d = null;
 }
Пример #10
0
 public void test_Model_getSpecies()
 {
     Species s1 = new  Species(2,4);
       Species s2 = new  Species(2,4);
       s1.setId( "Glucose"     );
       s2.setId( "Glucose_6_P" );
       s1.setCompartment( "c");
       s2.setCompartment( "c");
       M.addSpecies(s1);
       M.addSpecies(s2);
       assertTrue( M.getNumSpecies() == 2 );
       s1 = M.getSpecies(0);
       s2 = M.getSpecies(1);
       assertTrue((  "Glucose"      == s1.getId() ));
       assertTrue((  "Glucose_6_P"  == s2.getId() ));
 }
Пример #11
0
 public void test_Model_getSpeciesById()
 {
     Species s1 = new  Species(2,4);
       Species s2 = new  Species(2,4);
       s1.setId( "Glucose"     );
       s2.setId( "Glucose_6_P" );
       s1.setCompartment( "c");
       s2.setCompartment( "c");
       M.addSpecies(s1);
       M.addSpecies(s2);
       assertTrue( M.getNumSpecies() == 2 );
       assertTrue( M.getSpecies( "Glucose"    ) != s1 );
       assertTrue( M.getSpecies( "Glucose_6_P") != s2 );
       assertTrue( M.getSpecies( "Glucose2"   ) == null );
 }
Пример #12
0
 public void test_Model_getNumSpeciesWithBoundaryCondition()
 {
     Species s1 = new  Species(2,4);
       Species s2 = new  Species(2,4);
       Species s3 = new  Species(2,4);
       s1.setId( "s1");
       s2.setId( "s2");
       s3.setId( "s3");
       s1.setCompartment( "c1");
       s2.setCompartment( "c2");
       s3.setCompartment( "c3");
       s1.setBoundaryCondition(true);
       s2.setBoundaryCondition(false);
       s3.setBoundaryCondition(true);
       assertTrue( M.getNumSpecies() == 0 );
       assertTrue( M.getNumSpeciesWithBoundaryCondition() == 0 );
       M.addSpecies(s1);
       assertTrue( M.getNumSpecies() == 1 );
       assertTrue( M.getNumSpeciesWithBoundaryCondition() == 1 );
       M.addSpecies(s2);
       assertTrue( M.getNumSpecies() == 2 );
       assertTrue( M.getNumSpeciesWithBoundaryCondition() == 1 );
       M.addSpecies(s3);
       assertTrue( M.getNumSpecies() == 3 );
       assertTrue( M.getNumSpeciesWithBoundaryCondition() == 2 );
 }
Пример #13
0
 public void test_Model_addSpecies()
 {
     Species s = new  Species(2,4);
       s.setId( "s");
       s.setCompartment( "c");
       M.addSpecies(s);
       assertTrue( M.getNumSpecies() == 1 );
 }
Пример #14
0
 public void test_Species_parent_add()
 {
     Species ia = new Species(2,4);
       ia.setId("s");
       ia.setCompartment("c");
       Model m = new Model(2,4);
       m.addSpecies(ia);
       ia = null;
       ListOf lo = m.getListOfSpecies();
       assertTrue( lo == m.getSpecies(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
Пример #15
0
 public void test_Species_L1()
 {
     Species s = new Species(1,2);
       assertEquals( false, (s.hasRequiredAttributes()) );
       s.setId("s");
       assertEquals( false, (s.hasRequiredAttributes()) );
       s.setCompartment("c");
       assertEquals( false, (s.hasRequiredAttributes()) );
       s.setInitialAmount(2);
       assertEquals( true, s.hasRequiredAttributes() );
       s = null;
 }
Пример #16
0
 public void test_Species_ancestor_add()
 {
     Species ia = new Species(2,4);
       Model m = new Model(2,4);
       ia.setId("s");
       ia.setCompartment("c");
       m.addSpecies(ia);
       ia = null;
       ListOf lo = m.getListOfSpecies();
       Species obj = m.getSpecies(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
 }