createConstraint() public method

public createConstraint ( ) : Constraint
return Constraint
Exemplo n.º 1
0
 public void test_Constraint_ancestor_create()
 {
     Model m = new Model(2,4);
       Constraint ct = m.createConstraint();
       ListOf lo = m.getListOfConstraints();
       assertTrue( ct.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( ct.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( ct.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( ct.getAncestorOfType(libsbml.SBML_EVENT) == null );
       Constraint obj = m.getConstraint(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 );
 }
 public void test_Constraint_parent_create()
 {
     Model m = new Model(2,4);
       Constraint ct = m.createConstraint();
       ListOf lo = m.getListOfConstraints();
       assertTrue( lo == m.getConstraint(0).getParentSBMLObject() );
       assertTrue( lo == ct.getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
Exemplo n.º 3
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;
 }