setOffset() public method

public setOffset ( double value ) : int
value double
return int
Exemplo n.º 1
0
 public void test_Unit_setOffset2()
 {
     Unit U1 = new  Unit(2,1);
       int i = U1.setOffset(2.0);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( U1.getOffset() == 2 );
 }
 public void test_internal_consistency_check_99925()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Unit u = new Unit(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("cc");
       UnitDefinition ud = m.createUnitDefinition();
       ud.setId("ud");
       u.setKind(libsbml.UNIT_KIND_MOLE);
       u.setOffset(9);
       ud.addUnit(u);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
Exemplo n.º 3
0
 public void test_SBMLDocument_setLevelAndVersion_Error()
 {
     SBMLDocument d = new  SBMLDocument();
       d.setLevelAndVersion(2,1,true);
       Model m1 = new  Model(2,1);
       Unit u = new  Unit(2,1);
       u.setKind(libsbml.UnitKind_forName("mole"));
       u.setOffset(3.2);
       UnitDefinition ud = new  UnitDefinition(2,1);
       ud.setId( "ud");
       ud.addUnit(u);
       m1.addUnitDefinition(ud);
       d.setModel(m1);
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.setLevelAndVersion(1,2,true) == false );
       assertTrue( d.setLevelAndVersion(1,1,true) == false );
       d = null;
 }