当前位置: 首页>>代码示例>>C#>>正文


C# SBMLDocument.checkInternalConsistency方法代码示例

本文整理汇总了C#中libsbmlcs.SBMLDocument.checkInternalConsistency方法的典型用法代码示例。如果您正苦于以下问题:C# SBMLDocument.checkInternalConsistency方法的具体用法?C# SBMLDocument.checkInternalConsistency怎么用?C# SBMLDocument.checkInternalConsistency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbmlcs.SBMLDocument的用法示例。


在下文中一共展示了SBMLDocument.checkInternalConsistency方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_internal_consistency_check_20306

 public void test_internal_consistency_check_20306()
 {
     SBMLDocument d = new SBMLDocument(3,1);
       long errors;
       Model m = d.createModel();
       FunctionDefinition fd = m.createFunctionDefinition();
       fd.setId("fd");
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 20306 );
       ASTNode ast = libsbml.parseFormula("lambda(x, 2*x)");
       fd.setMath(ast);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:16,代码来源:TestInternalConsistencyChecks.cs

示例2: test_internal_consistency_check_20419

 public void test_internal_consistency_check_20419()
 {
     SBMLDocument d = new SBMLDocument(3,1);
       long errors;
       Model m = d.createModel();
       UnitDefinition ud = m.createUnitDefinition();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 20419 );
       ud.setId("ud");
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:15,代码来源:TestInternalConsistencyChecks.cs

示例3: test_internal_consistency_check_20623

 public void test_internal_consistency_check_20623()
 {
     SBMLDocument d = new SBMLDocument(3,1);
       long errors;
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       c.setConstant(true);
       Species s = m.createSpecies();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 5 );
       assertTrue( d.getError(0).getErrorId() == 20623 );
       assertTrue( d.getError(1).getErrorId() == 20614 );
       assertTrue( d.getError(2).getErrorId() == 20623 );
       assertTrue( d.getError(3).getErrorId() == 20623 );
       assertTrue( d.getError(4).getErrorId() == 20623 );
       s.setId("s");
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 4 );
       assertTrue( d.getError(0).getErrorId() == 20614 );
       assertTrue( d.getError(1).getErrorId() == 20623 );
       assertTrue( d.getError(2).getErrorId() == 20623 );
       assertTrue( d.getError(3).getErrorId() == 20623 );
       s.setCompartment("c");
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 3 );
       assertTrue( d.getError(0).getErrorId() == 20623 );
       assertTrue( d.getError(1).getErrorId() == 20623 );
       assertTrue( d.getError(2).getErrorId() == 20623 );
       s.setHasOnlySubstanceUnits(true);
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 2 );
       assertTrue( d.getError(0).getErrorId() == 20623 );
       assertTrue( d.getError(1).getErrorId() == 20623 );
       s.setBoundaryCondition(true);
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 20623 );
       s.setConstant(true);
       d.getErrorLog().clearLog();
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:48,代码来源:TestInternalConsistencyChecks.cs

示例4: test_ReadSBML_FunctionDefinition_OnlyBVars

 public void test_ReadSBML_FunctionDefinition_OnlyBVars()
 {
     FunctionDefinition fd;
       SBMLError error;
       int numErrors;
       ASTNode math;
       string formula;
       string s = wrapSBML_L2v1("<listOfFunctionDefinitions>" +
     "  <functionDefinition id='invalid'>" +
     "    <math xmlns='http://www.w3.org/1998/Math/MathML'>" +
     "      <lambda>" +
     "        <bvar><ci> x </ci></bvar>" +
     "        <bvar><ci> y </ci></bvar>" +
     "        <bvar><ci> z </ci></bvar>" +
     "      </lambda>" +
     "    </math>" +
     "  </functionDefinition>" +
     "</listOfFunctionDefinitions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       D.checkInternalConsistency();
       D.checkConsistency();
       numErrors = (int)D.getNumErrors();
       assertTrue( numErrors == 1 );
       error = D.getError(0);
       int errorId = (int)error.getErrorId();
       assertTrue( errorId == libsbml.NoBodyInFunctionDef );
       assertTrue( M.getNumFunctionDefinitions() == 1 );
       fd = M.getFunctionDefinition(0);
       assertTrue( fd != null );
       assertEquals( true, fd.isSetId() );
       assertEquals( false, fd.isSetName() );
       assertTrue((  "invalid"   == fd.getId() ));
       assertTrue( fd.getBody() == null );
       assertEquals( true, fd.isSetMath() );
       math = fd.getMath();
       formula = libsbml.formulaToString(math);
       assertTrue( formula != null );
       assertTrue((  "lambda(x, y, z)" == formula ));
 }
开发者ID:yarden,项目名称:roadrunner,代码行数:40,代码来源:TestReadSBML.cs

示例5: test_internal_consistency_check_99904_rule_rate

 public void test_internal_consistency_check_99904_rule_rate()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Rule r = new RateRule(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("cc");
       c.setConstant(false);
       r.setVariable("cc");
       r.setFormula("2");
       r.setMetaId("mmm");
       m.addRule(r);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:18,代码来源:TestInternalConsistencyChecks.cs

示例6: test_internal_consistency_check_99904_react

 public void test_internal_consistency_check_99904_react()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Reaction r = new Reaction(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("cc");
       r.setId("r");
       r.setMetaId("mmm");
       m.addReaction(r);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:16,代码来源:TestInternalConsistencyChecks.cs

示例7: test_internal_consistency_check_99904_model

 public void test_internal_consistency_check_99904_model()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       d.setLevelAndVersion(1,2,false);
       Model m = new Model(2,4);
       Compartment c = m.createCompartment();
       c.setId("cc");
       m.setMetaId("mmm");
       d.setModel(m);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 20201 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:15,代码来源:TestInternalConsistencyChecks.cs

示例8: test_internal_consistency_check_99903_param

 public void test_internal_consistency_check_99903_param()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Parameter p = new Parameter(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("cc");
       p.setConstant(true);
       p.setId("c");
       m.addParameter(p);
       Rule r = m.createAssignmentRule();
       r.setVariable("c");
       r.setFormula("2*3");
       errors = d.checkInternalConsistency();
       assertTrue( errors == 2 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:19,代码来源:TestInternalConsistencyChecks.cs

示例9: test_internal_consistency_check_99925

 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;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:18,代码来源:TestInternalConsistencyChecks.cs

示例10: test_internal_consistency_check_99923

 public void test_internal_consistency_check_99923()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       StoichiometryMath sm = new StoichiometryMath(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(1,2,false);
       Species s = m.createSpecies();
       s.setId("s");
       Compartment c = m.createCompartment();
       c.setId("c");
       s.setCompartment("c");
       Reaction r = m.createReaction();
       r.setId("r");
       SpeciesReference sr = r.createProduct();
       sr.setSpecies("s");
       sr.setStoichiometryMath(sm);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:21,代码来源:TestInternalConsistencyChecks.cs

示例11: test_internal_consistency_check_99922

 public void test_internal_consistency_check_99922()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       SpeciesType ct = new SpeciesType(2,4);
       Model m = d.createModel();
       ct.setId("st");
       d.setLevelAndVersion(2,1,false);
       m.addSpeciesType(ct);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:13,代码来源:TestInternalConsistencyChecks.cs

示例12: test_internal_consistency_check_99921

 public void test_internal_consistency_check_99921()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       SpeciesReference sr = new SpeciesReference(2,4);
       d.setLevelAndVersion(2,1,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       Species s = m.createSpecies();
       s.setId("s");
       Reaction r = m.createReaction();
       r.setId("r");
       s.setCompartment("c");
       sr.setSpecies("s");
       sr.setName("mmm");
       r.addReactant(sr);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 21101 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:22,代码来源:TestInternalConsistencyChecks.cs

示例13: test_internal_consistency_check_99916_rule

 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;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:20,代码来源:TestInternalConsistencyChecks.cs

示例14: test_internal_consistency_check_99916_reaction

 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;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:21,代码来源:TestInternalConsistencyChecks.cs

示例15: test_internal_consistency_check_99915_rate

 public void test_internal_consistency_check_99915_rate()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       c.setConstant(false);
       RateRule r = m.createRateRule();
       r.setL1TypeCode(libsbml.SBML_SPECIES_CONCENTRATION_RULE);
       r.setFormula("2");
       r.setVariable("c");
       r.setUnits("mmm");
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:18,代码来源:TestInternalConsistencyChecks.cs


注:本文中的libsbmlcs.SBMLDocument.checkInternalConsistency方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。