getNumParameters() public method

public getNumParameters ( ) : long
return long
 public void test_Model_createParameter()
 {
     Model m = new  Model(2,2);
       Parameter p = m.createParameter();
       assertTrue( m.getNumParameters() == 1 );
       assertTrue( (p).getLevel() == 2 );
       assertTrue( (p).getVersion() == 2 );
       m = null;
 }
 public void test_Model_addParameter4()
 {
     Model m = new  Model(2,2);
       Parameter p = null;
       int i = m.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumParameters() == 0 );
       m = null;
 }
 public void test_Model_addParameter5()
 {
     Model m = new  Model(2,2);
       Parameter p = new  Parameter(2,2);
       p.setId( "p");
       Parameter p1 = new  Parameter(2,2);
       p1.setId( "p");
       int i = m.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumParameters() == 1 );
       i = m.addParameter(p1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumParameters() == 1 );
       p = null;
       p1 = null;
       m = null;
 }
 public void test_Model_addParameter3()
 {
     Model m = new  Model(2,2);
       Parameter p = new  Parameter(1,2);
       p.setId( "p");
       int i = m.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH );
       assertTrue( m.getNumParameters() == 0 );
       p = null;
       m = null;
 }
 public void test_Model_addParameter1()
 {
     Model m = new  Model(2,2);
       Parameter p = new  Parameter(2,2);
       int i = m.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       p.setId( "p");
       i = m.addParameter(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumParameters() == 1 );
       p = null;
       m = null;
 }
Beispiel #6
0
 public void test_ReadSBML_Parameter()
 {
     Parameter p;
       string s = wrapSBML_L1v2("<listOfParameters>" +
     "  <parameter name='Km1' value='2.3' units='second'/>" +
     "</listOfParameters>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertTrue((  "Km1"     == p.getId() ));
       assertTrue((  "second"  == p.getUnits() ));
       assertTrue( p.getValue() == 2.3 );
       assertTrue( p.isSetValue() == true );
 }
Beispiel #7
0
 public void test_ReadSBML_Parameter_L2_defaults()
 {
     Parameter p;
       string s = wrapSBML_L2v1("<listOfParameters> <parameter id='x'/> </listOfParameters>"
     );
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertEquals( true, p.isSetId() );
       assertEquals( false, p.isSetName() );
       assertEquals( false, p.isSetValue() );
       assertEquals( false, p.isSetUnits() );
       assertTrue((  "x" == p.getId() ));
       assertTrue( p.getConstant() == true );
 }
Beispiel #8
0
 public void test_ReadSBML_Parameter_L2()
 {
     Parameter p;
       string s = wrapSBML_L2v1("<listOfParameters>" +
     "  <parameter id='T' value='4.6' units='Celsius' constant='false'/>" +
     "</listOfParameters>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertEquals( true, p.isSetId() );
       assertEquals( false, p.isSetName() );
       assertEquals( true, p.isSetValue() );
       assertEquals( true, p.isSetUnits() );
       assertTrue((  "T"        == p.getId() ));
       assertTrue((  "Celsius"  == p.getUnits() ));
       assertTrue( p.getValue() == 4.6 );
       assertTrue( p.getConstant() == false );
 }