getNumConstraints() 공개 메소드

public getNumConstraints ( ) : long
리턴 long
예제 #1
0
 public void test_Model_createConstraint()
 {
     Model m = new  Model(2,2);
       Constraint p = m.createConstraint();
       assertTrue( m.getNumConstraints() == 1 );
       assertTrue( (p).getLevel() == 2 );
       assertTrue( (p).getVersion() == 2 );
       m = null;
 }
예제 #2
0
 public void test_Model_addConstraint2()
 {
     Model m = new  Model(2,2);
       Constraint c = new  Constraint(2,3);
       c.setMath(libsbml.parseFormula("a+b"));
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumConstraints() == 0 );
       c = null;
       m = null;
 }
예제 #3
0
 public void test_Model_addConstraint3()
 {
     Model m = new  Model(2,2);
       Constraint c = null;
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumConstraints() == 0 );
       m = null;
 }
예제 #4
0
 public void test_Model_addConstraint1()
 {
     Model m = new  Model(2,2);
       Constraint c = new  Constraint(2,2);
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       c.setMath(libsbml.parseFormula("a+b"));
       i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumConstraints() == 1 );
       c = null;
       m = null;
 }