本文整理汇总了C#中libsbml.Model.getParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Model.getParameter方法的具体用法?C# Model.getParameter怎么用?C# Model.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbml.Model
的用法示例。
在下文中一共展示了Model.getParameter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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() );
}
示例2: getParameter
/// <summary>
/// [ ParameterStruct ]
/// [[ Id , Name , Value , Unit , Constant ]]
/// </summary>
/// <param name="aSBMLmodel"></param>
/// <returns></returns>
public static List<ParameterStruct> getParameter(Model aSBMLmodel)
{
List<ParameterStruct> list = new List<ParameterStruct>();
ListOfParameters parameters = aSBMLmodel.getListOfParameters();
for (int i = 0; i < parameters.size(); i++ )
{
Parameter aParameter = aSBMLmodel.getParameter(i);
string anId_Pa = aParameter.getId();
string aName_Pa = aParameter.getName();
double aValue_Pa = GetParameterValue(aParameter);
string anUnit_Pa = aParameter.getUnits();
bool aConstant_Pa = aParameter.getConstant();
ParameterStruct parameter = new ParameterStruct(
anId_Pa,
aName_Pa,
aValue_Pa,
anUnit_Pa,
aConstant_Pa);
list.Add(parameter);
}
return list;
}
示例3: 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 );
}
示例4: 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() );
}
示例5: 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 );
}
示例6: 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 );
}
示例7: 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() ));
}
示例8: 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 );
}
示例9: 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 );
}