setConstant() public method

public setConstant ( bool value ) : int
value bool
return int
Beispiel #1
0
 public void test_L3_Species_hasRequiredAttributes()
 {
     Species s = new  Species(3,1);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setId( "id");
       assertEquals( false, s.hasRequiredAttributes() );
       s.setCompartment( "cell");
       assertEquals( false, s.hasRequiredAttributes() );
       s.setHasOnlySubstanceUnits(false);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setBoundaryCondition(false);
       assertEquals( false, s.hasRequiredAttributes() );
       s.setConstant(false);
       assertEquals( true, s.hasRequiredAttributes() );
       s = null;
 }
 public void test_internal_consistency_check_99916_reaction()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Species s = new Species(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       Reaction r = m.createReaction();
       r.setId("r");
       SpeciesReference sr = r.createReactant();
       s.setId("s");
       s.setCompartment("c");
       s.setConstant(true);
       sr.setSpecies("s");
       m.addSpecies(s);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
 public void test_internal_consistency_check_99916_rule()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Species s = new Species(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       s.setId("s");
       s.setCompartment("c");
       s.setConstant(true);
       m.addSpecies(s);
       Rule r = m.createAssignmentRule();
       r.setVariable("s");
       r.setFormula("2");
       errors = d.checkInternalConsistency();
       assertTrue( errors == 2 );
       d = null;
 }
 public void test_Species_setConstant2()
 {
     Species c = new  Species(2,2);
       int i = c.setConstant(true);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( c.getConstant() == true );
       c = null;
 }