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


C# Model.getParameter方法代码示例

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


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

示例1: test_Parameter_parent_add

 public void test_Parameter_parent_add()
 {
     Parameter ia = new Parameter(2,4);
       Model m = new Model(2,4);
       ia.setId("p");
       m.addParameter(ia);
       ia = null;
       ListOf lo = m.getListOfParameters();
       assertTrue( lo == m.getParameter(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:11,代码来源:TestSBMLParentObject.cs

示例2: test_Parameter_parent_create

 public void test_Parameter_parent_create()
 {
     Model m = new Model(2,4);
       Parameter p = m.createParameter();
       ListOf lo = m.getListOfParameters();
       assertTrue( lo == m.getParameter(0).getParentSBMLObject() );
       assertTrue( lo == p.getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:9,代码来源:TestSBMLParentObject.cs

示例3: test_Parameter_ancestor_add

 public void test_Parameter_ancestor_add()
 {
     Parameter ia = new Parameter(2,4);
       Model m = new Model(2,4);
       ia.setId("p");
       m.addParameter(ia);
       ia = null;
       ListOf lo = m.getListOfParameters();
       Parameter obj = m.getParameter(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:alexholehouse,项目名称:SBMLIntegrator,代码行数:14,代码来源:TestAncestor.cs

示例4: test_Parameter_ancestor_create

 public void test_Parameter_ancestor_create()
 {
     Model m = new Model(2,4);
       Parameter p = m.createParameter();
       ListOf lo = m.getListOfParameters();
       assertTrue( p.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( p.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( p.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( p.getAncestorOfType(libsbml.SBML_EVENT) == null );
       Parameter obj = m.getParameter(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:alexholehouse,项目名称:SBMLIntegrator,代码行数:15,代码来源: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:yarden,项目名称:roadrunner,代码行数:55,代码来源:TestReadSBML.cs

示例6: test_ReadSBML_Parameter_L2_defaults

 public void test_ReadSBML_Parameter_L2_defaults()
 {
     Parameter p;
       string s = wrapSBML_L2v1("<listOfParameters> <parameter id='x'/> </listOfParameters>"
     );
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertEquals( true, p.isSetId() );
       assertEquals( false, p.isSetName() );
       assertEquals( false, p.isSetValue() );
       assertEquals( false, p.isSetUnits() );
       assertTrue((  "x" == p.getId() ));
       assertTrue( p.getConstant() == true );
 }
开发者ID:yarden,项目名称:roadrunner,代码行数:16,代码来源:TestReadSBML.cs

示例7: test_ReadSBML_Parameter_L2

 public void test_ReadSBML_Parameter_L2()
 {
     Parameter p;
       string s = wrapSBML_L2v1("<listOfParameters>" +
     "  <parameter id='T' value='4.6' units='Celsius' constant='false'/>" +
     "</listOfParameters>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertEquals( true, p.isSetId() );
       assertEquals( false, p.isSetName() );
       assertEquals( true, p.isSetValue() );
       assertEquals( true, p.isSetUnits() );
       assertTrue((  "T"        == p.getId() ));
       assertTrue((  "Celsius"  == p.getUnits() ));
       assertTrue( p.getValue() == 4.6 );
       assertTrue( p.getConstant() == false );
 }
开发者ID:yarden,项目名称:roadrunner,代码行数:19,代码来源:TestReadSBML.cs

示例8: test_ReadSBML_Parameter

 public void test_ReadSBML_Parameter()
 {
     Parameter p;
       string s = wrapSBML_L1v2("<listOfParameters>" +
     "  <parameter name='Km1' value='2.3' units='second'/>" +
     "</listOfParameters>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertTrue((  "Km1"     == p.getId() ));
       assertTrue((  "second"  == p.getUnits() ));
       assertTrue( p.getValue() == 2.3 );
       assertTrue( p.isSetValue() == true );
 }
开发者ID:yarden,项目名称:roadrunner,代码行数:15,代码来源:TestReadSBML.cs

示例9: InitializeFromFbcV2

        private void InitializeFromFbcV2(Model model, FbcModelPlugin plugin)
        {
            if (!plugin.getStrict())
              {
            Warnings.Add(
              "Encountered non-strict model, this software does not support any of the dynamic features of FBC V2, only the static features of the model are imported. ");
              }

              var numConstraints = plugin.getNumFluxBounds();
              for (int i = 0; i < numConstraints; i++)
              {
            var constraint = plugin.getFluxBound(i);
            Constraints.Add(new LPsolveConstraint(constraint.getReaction(), GetOperator(constraint.getOperation()),
              constraint.getValue()));
              }

              var activeObjective = plugin.getActiveObjective();
              if (activeObjective == null && plugin.getNumObjectives() > 0)
            activeObjective = plugin.getObjective(0);
              if (activeObjective == null) return;
              var numObjectives = (int)activeObjective.getNumFluxObjectives();
              for (int i = 0; i < numObjectives; i++)
              {
            var objective = activeObjective.getFluxObjective(i);
            Objectives.Add(new LPsolveObjective(objective.getReaction(), objective.getCoefficient()));
              }

              if (activeObjective.getType() == "minimize" || activeObjective.getType() == "minimise") Mode = FBA_Mode.minimize;
              else Mode = FBA_Mode.maximize;
              ActiveObjective = activeObjective.getId();

              for (int i = 0; i < model.getNumReactions(); i++)
              {
            var reaction = model.getReaction(i);
            ReversibilityMap[reaction.getId()] = reaction.getReversible();

            var rplug = (FbcReactionPlugin) reaction.getPlugin("fbc");
            if (rplug == null) continue;

            if (rplug.isSetLowerFluxBound())
            {
              var param = model.getParameter(rplug.getLowerFluxBound());
              if (param != null)
              {
            Constraints.Add(new LPsolveConstraint(reaction.getId(), lpsolve_constr_types.GE,
              param.getValue()));
              }
            }

            if (rplug.isSetUpperFluxBound())
            {
              var param = model.getParameter(rplug.getUpperFluxBound());
              if (param != null)
              {
            Constraints.Add(new LPsolveConstraint(reaction.getId(), lpsolve_constr_types.LE,
              param.getValue()));
              }
            }

            }
        }
开发者ID:fbergmann,项目名称:FluxBalance,代码行数:61,代码来源:FluxBalance.cs


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