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


C# SBMLDocument.createModel方法代码示例

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


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

示例1: test_SBMLConvertStrict_convertNonStrictSBO

 public void test_SBMLConvertStrict_convertNonStrictSBO()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       c.setConstant(false);
       (c).setSBOTerm(64);
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Compartment c1 = d.getModel().getCompartment(0);
       assertTrue( (c1).getSBOTerm() == -1 );
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       Compartment c2 = d.getModel().getCompartment(0);
       assertTrue( (c2).getSBOTerm() == -1 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:26,代码来源:TestSBMLConvertStrict.cs

示例2: test_internal_consistency_check_99902

 public void test_internal_consistency_check_99902()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Compartment c = new Compartment(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       c.setCompartmentType("hh");
       c.setId("c");
       m.addCompartment(c);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 1 );
       assertTrue( d.getError(0).getErrorId() == 10103 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestInternalConsistencyChecks.cs

示例3: test_SBMLConvert_convertFromL3

 public void test_SBMLConvert_convertFromL3()
 {
     SBMLDocument d = new  SBMLDocument(3,1);
       Model m = d.createModel();
       string sid =  "C";
       Compartment c = m.createCompartment();
       c.setId(sid);
       c.setSize(1.2);
       c.setUnits( "volume");
       assertTrue( d.setLevelAndVersion(1,1,true) == false );
       assertTrue( d.setLevelAndVersion(1,2,true) == false );
       assertTrue( d.setLevelAndVersion(2,1,true) == false );
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.setLevelAndVersion(2,4,true) == false );
       assertTrue( d.setLevelAndVersion(3,1,true) == true );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestSBMLConvert.cs

示例4: test_internal_consistency_check_99903

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

示例5: test_SBMLConvertStrict_convertL1ParamRule

 public void test_SBMLConvertStrict_convertL1ParamRule()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       Parameter p = m.createParameter();
       p.setId( "p");
       Parameter p1 = m.createParameter();
       p1.setId( "p1");
       ASTNode math = libsbml.parseFormula("p");
       Rule ar = m.createAssignmentRule();
       ar.setVariable( "p1");
       ar.setMath(math);
       ar.setUnits( "mole");
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Rule r1 = d.getModel().getRule(0);
       assertTrue( r1.getUnits() == "" );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:22,代码来源:TestSBMLConvertStrict.cs

示例6: test_SBMLConvert_addModifiersToReaction

 public void test_SBMLConvert_addModifiersToReaction()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Reaction r = m.createReaction();
       KineticLaw kl = r.createKineticLaw();
       kl.setFormula( "k1*S1*S2*S3*S4*S5");
       SimpleSpeciesReference ssr1;
       SimpleSpeciesReference ssr2;
       Species s1 = m.createSpecies();
       s1.setId( "S1" );
       Species s2 = m.createSpecies();
       s2.setId( "S2");
       Species s3 = m.createSpecies();
       s3.setId( "S3");
       Species s4 = m.createSpecies();
       s4.setId( "S4");
       Species s5 = m.createSpecies();
       s5.setId( "S5");
       SpeciesReference sr1 = r.createReactant();
       SpeciesReference sr2 = r.createReactant();
       SpeciesReference sr3 = r.createProduct();
       sr1.setSpecies( "S1");
       sr2.setSpecies( "S2");
       sr3.setSpecies( "S5");
       assertTrue( r.getNumModifiers() == 0 );
       assertTrue( d.setLevelAndVersion(2,1,false) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       assertTrue( m.getReaction(0).getNumModifiers() == 2 );
       ssr1 = m.getReaction(0).getModifier(0);
       ssr2 = m.getReaction(0).getModifier(1);
       assertTrue((  "S3" == ssr1.getSpecies() ));
       assertTrue((  "S4" == ssr2.getSpecies() ));
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:36,代码来源:TestSBMLConvert.cs

示例7: test_internal_consistency_check_99911_react

 public void test_internal_consistency_check_99911_react()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Model m = d.createModel();
       Reaction r = new Reaction(2,4);
       d.setLevelAndVersion(2,1,false);
       r.setId("r");
       r.setSBOTerm(2);
       m.addReaction(r);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:14,代码来源:TestInternalConsistencyChecks.cs

示例8: test_internal_consistency_check_99911_param

 public void test_internal_consistency_check_99911_param()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Model m = d.createModel();
       Parameter p = new Parameter(2,4);
       d.setLevelAndVersion(2,1,false);
       p.setId("p");
       p.setSBOTerm(2);
       m.addParameter(p);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:14,代码来源:TestInternalConsistencyChecks.cs

示例9: 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:mgaldzic,项目名称:copasi_api,代码行数:18,代码来源:TestInternalConsistencyChecks.cs

示例10: 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 == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:21,代码来源:TestInternalConsistencyChecks.cs

示例11: test_internal_consistency_check_99919

 public void test_internal_consistency_check_99919()
 {
     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.setHasOnlySubstanceUnits(true);
       m.addSpecies(s);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestInternalConsistencyChecks.cs

示例12: test_internal_consistency_check_99915_alg

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

示例13: test_internal_consistency_check_99912

 public void test_internal_consistency_check_99912()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       FunctionDefinition fd = new FunctionDefinition(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(1,2,false);
       Compartment c = m.createCompartment();
       c.setId("cc");
       c.setConstant(false);
       m.addFunctionDefinition(fd);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestInternalConsistencyChecks.cs

示例14: test_internal_consistency_check_99909

 public void test_internal_consistency_check_99909()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       Constraint ct = new Constraint(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(2,1,false);
       m.addConstraint(ct);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:12,代码来源:TestInternalConsistencyChecks.cs

示例15: test_internal_consistency_check_99905_unitdef

 public void test_internal_consistency_check_99905_unitdef()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       UnitDefinition u = new UnitDefinition(2,4);
       d.setLevelAndVersion(2,2,false);
       Model m = d.createModel();
       u.setId("ud");
       u.setSBOTerm(9);
       u.createUnit();
       m.addUnitDefinition(u);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestInternalConsistencyChecks.cs


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