本文整理汇总了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() );
}
示例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() );
}
示例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 );
}
示例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 );
}
示例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() ));
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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()));
}
}
}
}