AlgebraicRule clone() { IntPtr cPtr = libsbmlPINVOKE.AlgebraicRule_clone(swigCPtr); AlgebraicRule ret = (cPtr == IntPtr.Zero) ? null : new AlgebraicRule(cPtr, true); return(ret); }
public void test_AlgebraicRule() { AlgebraicRule ar = new AlgebraicRule(2,4); assertEquals( false, (ar.hasRequiredElements()) ); ar.setMath(libsbml.parseFormula("ar")); assertEquals( true, ar.hasRequiredElements() ); ar = null; }
public void test_AlgebraicRule_L1() { AlgebraicRule ar = new AlgebraicRule(1,2); assertEquals( false, (ar.hasRequiredAttributes()) ); ar.setFormula("ar"); assertEquals( true, ar.hasRequiredAttributes() ); ar = null; }
internal static HandleRef getCPtrAndDisown(AlgebraicRule obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return(ptr); }
public void test_AlgebraicRule_constructor() { SBase s; try { s = new AlgebraicRule(1,1); s = new AlgebraicRule(1,2); s = new AlgebraicRule(2,1); s = new AlgebraicRule(2,2); s = new AlgebraicRule(2,3); s = new AlgebraicRule(2,4); s = new AlgebraicRule(3,1); s = new AlgebraicRule(SN11); s = new AlgebraicRule(SN12); s = new AlgebraicRule(SN21); s = new AlgebraicRule(SN22); s = new AlgebraicRule(SN23); s = new AlgebraicRule(SN24); s = new AlgebraicRule(SN31); } catch (SBMLConstructorException e) { s = null; } assertTrue(s != null); string msg = ""; try { s = new AlgebraicRule(9,9); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new AlgebraicRule(SN99); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); }
public void test_AlgebraicRule_createWithFormula() { ASTNode math; string formula; Rule ar = new AlgebraicRule(2,4); ar.setFormula( "1 + 1"); assertTrue( ar.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE ); assertTrue( ar.getMetaId() == "" ); math = ar.getMath(); assertTrue( math != null ); formula = libsbml.formulaToString(math); assertTrue( formula != null ); assertTrue(( "1 + 1" == formula )); assertTrue(( formula == ar.getFormula() )); ar = null; }
internal static HandleRef getCPtr(AlgebraicRule obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtrAndDisown(AlgebraicRule obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
internal static HandleRef getCPtr(AlgebraicRule obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public void test_Model_getRules() { Rule ar = new AlgebraicRule(2,4); Rule scr = new AssignmentRule(2,4); Rule cvr = new AssignmentRule(2,4); Rule pr = new AssignmentRule(2,4); scr.setVariable( "r2"); cvr.setVariable( "r3"); pr.setVariable( "r4"); ar.setFormula( "x + 1" ); scr.setFormula( "k * t/(1 + k)" ); cvr.setFormula( "0.10 * t" ); pr.setFormula( "k3/k2" ); M.addRule(ar); M.addRule(scr); M.addRule(cvr); M.addRule(pr); assertTrue( M.getNumRules() == 4 ); ar = M.getRule(0); scr = M.getRule(1); cvr = M.getRule(2); pr = M.getRule(3); assertTrue(( "x + 1" == ar.getFormula() )); assertTrue(( "k * t/(1 + k)" == scr.getFormula() )); assertTrue(( "0.10 * t" == cvr.getFormula() )); assertTrue(( "k3/k2" == pr.getFormula() )); }
public void test_internal_consistency_check_99904_rule_alg() { SBMLDocument d = new SBMLDocument(2,4); long errors; Rule r = new AlgebraicRule(2,4); d.setLevelAndVersion(1,2,false); Model m = d.createModel(); Compartment c = m.createCompartment(); c.setId("cc"); r.setMetaId("mmm"); r.setFormula("2"); m.addRule(r); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_internal_consistency_check_99915_alg() { SBMLDocument d = new SBMLDocument(2,4); long errors; Model m = d.createModel(); Rule r = new AlgebraicRule(2,4); d.setLevelAndVersion(2,1,false); r.setUnits("kk"); m.addRule(r); errors = d.checkInternalConsistency(); assertTrue( errors == 0 ); d = null; }
public void test_AlgebraicRule() { AlgebraicRule ar = new AlgebraicRule(2,4); assertEquals( true, ar.hasRequiredAttributes() ); ar = null; }
public void test_Rule_setVariable3() { Rule R1 = new AlgebraicRule(1,2); int i = R1.setVariable( "r"); assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE ); assertEquals( false, R1.isSetVariable() ); R1 = null; }
public void test_AlgebraicRule_createWithMath() { ASTNode math = libsbml.parseFormula("1 + 1"); Rule ar = new AlgebraicRule(2,4); ar.setMath(math); assertTrue( ar.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE ); assertTrue( ar.getMetaId() == "" ); assertTrue(( "1 + 1" == ar.getFormula() )); assertTrue( ar.getMath() != math ); ar = null; }
public void test_Model_addRules() { Rule r1 = new AlgebraicRule(2,4); Rule r2 = new AssignmentRule(2,4); Rule r3 = new RateRule(2,4); r2.setVariable( "r2"); r3.setVariable( "r3"); r1.setMath(libsbml.parseFormula("2")); r2.setMath(libsbml.parseFormula("2")); r3.setMath(libsbml.parseFormula("2")); M.addRule(r1); M.addRule(r2); M.addRule(r3); assertTrue( M.getNumRules() == 3 ); }
public void test_AlgebraicRule_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,3); sbmlns.addNamespaces(xmlns); Rule r = new AlgebraicRule(sbmlns); assertTrue( r.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE ); assertTrue( r.getMetaId() == "" ); assertTrue( r.getNotes() == null ); assertTrue( r.getAnnotation() == null ); assertTrue( r.getLevel() == 2 ); assertTrue( r.getVersion() == 3 ); assertTrue( r.getNamespaces() != null ); assertTrue( r.getNamespaces().getLength() == 2 ); r = null; }