setSize() public method

public setSize ( double value ) : int
value double
return int
Ejemplo n.º 1
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;
 }
 public void test_Compartment_setSize2()
 {
     Compartment c = new  Compartment(2,2);
       int i = c.setSize(4);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( c.getSize() == 4 );
       assertEquals( true, c.isSetSize() );
       i = c.unsetSize();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, c.isSetSize() );
       c = null;
 }
Ejemplo n.º 3
0
        public void TestGetCompartmentSize()
        {
            Compartment c = new Compartment(2, 3);
            double value;
            value = SbmlFunctions.GetCompartmentSize(c);
            Assert.AreEqual(double.NaN, value, "GetCompartmentSize returns unexpected value.");

            c.setSize(2.0);
            value = SbmlFunctions.GetCompartmentSize(c);
            Assert.AreEqual(2.0, value, "GetCompartmentSize returns unexpected value.");
        }