setInitialAmount() public method

public setInitialAmount ( double value ) : int
value double
return int
 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;
 }
Beispiel #2
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;
 }
 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;
 }
 public void test_Species_setInitialAmount2()
 {
     Species c = new  Species(2,2);
       int i = c.setInitialAmount(4);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( c.getInitialAmount() == 4.0 );
       assertEquals( true, c.isSetInitialAmount() );
       i = c.unsetInitialAmount();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, c.isSetInitialAmount() );
       c = null;
 }
Beispiel #5
0
        public void TestGetInitialAmount()
        {
            Species s = new Species(2, 3);
            double value;
            value = SbmlFunctions.GetInitialAmount(s);
            Assert.AreEqual(double.NaN, value, "GetInitialAmount returns unexpected value.");

            s.setInitialAmount(2.0);
            value = SbmlFunctions.GetInitialAmount(s);
            Assert.AreEqual(2.0, value, "GetInitialAmount returns unexpected value.");
        }