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


C# Model.getReaction方法代码示例

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


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

示例1: test_Reaction_ancestor_create

 public void test_Reaction_ancestor_create()
 {
     Model m = new Model(2,4);
       Reaction r = m.createReaction();
       ListOf lo = m.getListOfReactions();
       assertTrue( r.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( r.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( r.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( r.getAncestorOfType(libsbml.SBML_EVENT) == null );
       Reaction obj = m.getReaction(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestAncestor.cs

示例2: test_Reaction_parent_add

 public void test_Reaction_parent_add()
 {
     Reaction ia = new Reaction(2,4);
       Model m = new Model(2,4);
       ia.setId("k");
       m.addReaction(ia);
       ia = null;
       ListOf lo = m.getListOfReactions();
       assertTrue( lo == m.getReaction(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:11,代码来源:TestSBMLParentObject.cs

示例3: test_ReadSBML_notes

 public void test_ReadSBML_notes()
 {
     Reaction r;
       KineticLaw kl;
       string s = wrapSBML_L2v3("<listOfReactions>" +
     "<reaction name='J1'>" +
     "  <kineticLaw formula='k1*X0'>" +
     "    <notes>This is a test note.</notes>" +
     "    <listOfParameters>" +
     "      <parameter name='k1' value='0'/>" +
     "    </listOfParameters>" +
     "  </kineticLaw>" +
     "</reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       r = M.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue( kl.getNotes() != null );
       string notes = kl.getNotes().getChild(0).getCharacters();
       assertTrue( (  "This is a test note." != notes ) == false );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:22,代码来源:TestReadSBML.cs

示例4: test_Reaction_ancestor_add

 public void test_Reaction_ancestor_add()
 {
     Reaction ia = new Reaction(2,4);
       Model m = new Model(2,4);
       ia.setId("k");
       m.addReaction(ia);
       ia = null;
       ListOf lo = m.getListOfReactions();
       Reaction obj = m.getReaction(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:14,代码来源:TestAncestor.cs

示例5: test_ReadSBML_metaid

 public void test_ReadSBML_metaid()
 {
     SBase sb;
       string s = wrapSBML_L2v1("<listOfFunctionDefinitions>" +
     "  <functionDefinition metaid='fd'/>" +
     "</listOfFunctionDefinitions>" +
     "<listOfUnitDefinitions>" +
     "  <unitDefinition metaid='ud'/>" +
     "</listOfUnitDefinitions>" +
     "<listOfCompartments>" +
     "  <compartment metaid='c'/>" +
     "</listOfCompartments>" +
     "<listOfSpecies>" +
     "  <species metaid='s'/>" +
     "</listOfSpecies>" +
     "<listOfParameters>" +
     "  <parameter metaid='p'/>" +
     "</listOfParameters>" +
     "<listOfRules>" +
     "  <rateRule metaid='rr'/>" +
     "</listOfRules>" +
     "<listOfReactions>" +
     "  <reaction metaid='rx'/>" +
     "</listOfReactions>" +
     "<listOfEvents>" +
     " <event metaid='e'/>" +
     "</listOfEvents>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       sb = M.getFunctionDefinition(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "fd" == sb.getMetaId() ));
       sb = M.getUnitDefinition(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "ud" == sb.getMetaId() ));
       sb = M.getCompartment(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "c" == sb.getMetaId() ));
       sb = M.getSpecies(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "s" == sb.getMetaId() ));
       sb = M.getParameter(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "p" == sb.getMetaId() ));
       sb = M.getRule(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "rr" == sb.getMetaId() ));
       sb = M.getReaction(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "rx" == sb.getMetaId() ));
       sb = M.getEvent(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "e" == sb.getMetaId() ));
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:55,代码来源:TestReadSBML.cs

示例6: test_ReadSBML_metaid_Reaction

 public void test_ReadSBML_metaid_Reaction()
 {
     SBase sb;
       Reaction r;
       string s = wrapSBML_L2v1("<listOfReactions>" +
     "  <reaction metaid='r'>" +
     "    <listOfReactants metaid='lor'>" +
     "      <speciesReference metaid='sr1'/>" +
     "    </listOfReactants>" +
     "    <listOfProducts metaid='lop'>" +
     "      <speciesReference metaid='sr2'/>" +
     "    </listOfProducts>" +
     "    <listOfModifiers metaid='lom'>" +
     "      <modifierSpeciesReference metaid='msr'/>" +
     "    </listOfModifiers>" +
     "    <kineticLaw metaid='kl'/>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       r = M.getReaction(0);
       sb = r;
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "r" == sb.getMetaId() ));
       sb = r.getListOfReactants();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lor" == sb.getMetaId() ));
       sb = r.getReactant(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "sr1" == sb.getMetaId() ));
       sb = r.getListOfProducts();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lop" == sb.getMetaId() ));
       sb = r.getProduct(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "sr2" == sb.getMetaId() ));
       sb = r.getListOfModifiers();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lom" == sb.getMetaId() ));
       sb = r.getModifier(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "msr" == sb.getMetaId() ));
       sb = r.getKineticLaw();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "kl" == sb.getMetaId() ));
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:47,代码来源:TestReadSBML.cs

示例7: test_ReadSBML_KineticLaw_Parameter

 public void test_ReadSBML_KineticLaw_Parameter()
 {
     Reaction r;
       KineticLaw kl;
       Parameter p;
       string s = wrapSBML_L1v2("<listOfReactions>" +
     "  <reaction name='J1'>" +
     "    <kineticLaw formula='k1*X0'>" +
     "      <listOfParameters>" +
     "        <parameter name='k1' value='0'/>" +
     "      </listOfParameters>" +
     "    </kineticLaw>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue((  "k1*X0" == kl.getFormula() ));
       assertTrue( kl.getNumParameters() == 1 );
       p = kl.getParameter(0);
       assertTrue((  "k1" == p.getId() ));
       assertTrue( p.getValue() == 0 );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:25,代码来源:TestReadSBML.cs

示例8: test_ReadSBML_Reaction_L2_defaults

 public void test_ReadSBML_Reaction_L2_defaults()
 {
     Reaction r;
       string s = wrapSBML_L2v1("<listOfReactions> <reaction id='r1'/> </listOfReactions>"
     );
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       assertEquals( true, r.isSetId() );
       assertEquals( false, r.isSetName() );
       assertEquals( false, r.isSetFast() );
       assertTrue((  "r1" == r.getId() ));
       assertTrue( r.getReversible() == true );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestReadSBML.cs

示例9: test_ReadSBML_KineticLaw

 public void test_ReadSBML_KineticLaw()
 {
     Reaction r;
       KineticLaw kl;
       string s = wrapSBML_L1v2("<listOfReactions>" +
     "  <reaction name='J1'>" +
     "    <kineticLaw formula='k1*X0'/>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue((  "k1*X0" == kl.getFormula() ));
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:16,代码来源:TestReadSBML.cs

示例10: test_ReadSBML_KineticLaw_L2

 public void test_ReadSBML_KineticLaw_L2()
 {
     Reaction r;
       KineticLaw kl;
       ASTNode math;
       string formula;
       string s = wrapSBML_L2v1("<listOfReactions>" +
     "  <reaction id='J1'>" +
     "    <kineticLaw>" +
     "      <math>" +
     "        <apply>" +
     "          <times/>" +
     "          <ci> k  </ci>" +
     "          <ci> S2 </ci>" +
     "          <ci> X0 </ci>" +
     "        </apply>" +
     "      </math>" +
     "    </kineticLaw>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       assertTrue( r != null );
       kl = r.getKineticLaw();
       assertTrue( kl != null );
       assertEquals( true, kl.isSetMath() );
       math = kl.getMath();
       formula = kl.getFormula();
       assertTrue( formula != null );
       assertTrue((  "k * S2 * X0" == formula ));
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:33,代码来源:TestReadSBML.cs

示例11: test_ReadSBML_SpeciesReference_StoichiometryMath_2

 public void test_ReadSBML_SpeciesReference_StoichiometryMath_2()
 {
     Reaction r;
       SpeciesReference sr;
       string s = wrapSBML_L2v1("<listOfReactions>" +
     "  <reaction name='r1'>" +
     "    <listOfReactants>" +
     "      <speciesReference species='X0'>" +
     "        <stoichiometryMath>" +
     "          <math> <cn type='rational'> 3 <sep/> 2 </cn> </math>" +
     "        </stoichiometryMath>" +
     "      </speciesReference>" +
     "    </listOfReactants>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       assertTrue( r != null );
       assertTrue( r.getNumReactants() == 1 );
       sr = r.getReactant(0);
       assertTrue( sr != null );
       assertEquals( false, sr.isSetStoichiometryMath() );
       assertTrue( sr.getStoichiometry() == 3 );
       assertTrue( sr.getDenominator() == 2 );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:27,代码来源:TestReadSBML.cs

示例12: test_ReadSBML_SpeciesReference_StoichiometryMath_1

 public void test_ReadSBML_SpeciesReference_StoichiometryMath_1()
 {
     Reaction r;
       SpeciesReference sr;
       StoichiometryMath math;
       string formula;
       string s = wrapSBML_L2v1("<listOfReactions>" +
     "  <reaction name='r1'>" +
     "    <listOfReactants>" +
     "      <speciesReference species='X0'>" +
     "        <stoichiometryMath>" +
     "          <math> <ci> x </ci> </math>" +
     "        </stoichiometryMath>" +
     "      </speciesReference>" +
     "    </listOfReactants>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       assertTrue( r != null );
       assertTrue( r.getNumReactants() == 1 );
       sr = r.getReactant(0);
       assertTrue( sr != null );
       assertEquals( true, sr.isSetStoichiometryMath() );
       math = sr.getStoichiometryMath();
       formula = libsbml.formulaToString(math.getMath());
       assertTrue( formula != null );
       assertTrue((  "x" == formula ));
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:31,代码来源:TestReadSBML.cs

示例13: test_ReadSBML_SpeciesReference_defaults

 public void test_ReadSBML_SpeciesReference_defaults()
 {
     Reaction r;
       SpeciesReference sr;
       string s = wrapSBML_L1v2("<listOfReactions>" +
     "  <reaction name='reaction_1' reversible='false'>" +
     "    <listOfReactants>" +
     "      <speciesReference species='X0'/>" +
     "    </listOfReactants>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       assertTrue((  "reaction_1" == r.getId() ));
       assertTrue( r.getReversible() == false );
       assertTrue( r.getNumReactants() == 1 );
       sr = r.getReactant(0);
       assertTrue((  "X0" == sr.getSpecies() ));
       assertTrue( sr.getStoichiometry() == 1 );
       assertTrue( sr.getDenominator() == 1 );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:23,代码来源:TestReadSBML.cs

示例14: test_Reaction_parent_create

 public void test_Reaction_parent_create()
 {
     Model m = new Model(2,4);
       Reaction r = m.createReaction();
       ListOf lo = m.getListOfReactions();
       assertTrue( lo == m.getReaction(0).getParentSBMLObject() );
       assertTrue( lo == r.getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:9,代码来源:TestSBMLParentObject.cs

示例15: test_ReadSBML_line_col_numbers

        public void test_ReadSBML_line_col_numbers()
        {
            //setXMLParser();

              SBase sb;
              string s = "<?xml version='1.0' encoding='UTF-8'?>\n" +
            "<sbml xmlns='http://www.sbml.org/sbml/level2' level='2' version='1'>\n" +
            "  <model id='testModel' name='testModel'>\n" +
            "    <listOfReactions> <reaction/> </listOfReactions>\n" +
            "  </model>\n" +
            "</sbml>\n";
              D = libsbml.readSBMLFromString(s);
              M = D.getModel();
              assertTrue( M != null );
              sb = M;
              sb = M.getListOfReactions();
              sb = M.getReaction(0);
        }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:18,代码来源:TestReadSBML.cs


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