本文整理汇总了C#中libsbmlcs.Model.getUnitDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# Model.getUnitDefinition方法的具体用法?C# Model.getUnitDefinition怎么用?C# Model.getUnitDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.Model
的用法示例。
在下文中一共展示了Model.getUnitDefinition方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_UnitDefinition_parent_add
public void test_UnitDefinition_parent_add()
{
UnitDefinition ia = new UnitDefinition(2,4);
Model m = new Model(2,4);
ia.setId("u");
ia.createUnit();
m.addUnitDefinition(ia);
ia = null;
ListOf lo = m.getListOfUnitDefinitions();
assertTrue( lo == m.getUnitDefinition(0).getParentSBMLObject() );
assertTrue( m == lo.getParentSBMLObject() );
}
示例2: test_UnitDefinition_parent_create
public void test_UnitDefinition_parent_create()
{
Model m = new Model(2,4);
UnitDefinition ud = m.createUnitDefinition();
ListOf lo = m.getListOfUnitDefinitions();
assertTrue( lo == m.getUnitDefinition(0).getParentSBMLObject() );
assertTrue( lo == ud.getParentSBMLObject() );
assertTrue( m == lo.getParentSBMLObject() );
}
示例3: test_UnitDefinition_ancestor_add
public void test_UnitDefinition_ancestor_add()
{
UnitDefinition ia = new UnitDefinition(2,4);
Model m = new Model(2,4);
ia.setId("u");
ia.createUnit();
m.addUnitDefinition(ia);
ia = null;
ListOf lo = m.getListOfUnitDefinitions();
UnitDefinition obj = m.getUnitDefinition(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_UnitDefinition_ancestor_create
public void test_UnitDefinition_ancestor_create()
{
Model m = new Model(2,4);
UnitDefinition ud = m.createUnitDefinition();
ListOf lo = m.getListOfUnitDefinitions();
assertTrue( ud.getAncestorOfType(libsbml.SBML_MODEL) == m );
assertTrue( ud.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
assertTrue( ud.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
assertTrue( ud.getAncestorOfType(libsbml.SBML_EVENT) == null );
UnitDefinition obj = m.getUnitDefinition(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_metaid_Unit
public void test_ReadSBML_metaid_Unit()
{
SBase sb;
UnitDefinition ud;
string s = wrapSBML_L2v1("<listOfUnitDefinitions>" +
" <unitDefinition metaid='ud'>" +
" <listOfUnits metaid='lou'>" +
" <unit metaid='u'/>" +
" </listOfUnits>" +
" </unitDefinition>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M != null );
ud = M.getUnitDefinition(0);
sb = ud;
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "ud" == sb.getMetaId() ));
sb = ud.getListOfUnits();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "lou" == sb.getMetaId() ));
sb = ud.getUnit(0);
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "u" == sb.getMetaId() ));
}
示例7: test_ReadSBML_Unit_L2
public void test_ReadSBML_Unit_L2()
{
Unit u;
UnitDefinition ud;
string s = wrapSBML_L2v1("<listOfUnitDefinitions>" +
" <unitDefinition id='Fahrenheit'>" +
" <listOfUnits>" +
" <unit kind='Celsius' multiplier='1.8' offset='32'/>" +
" </listOfUnits>" +
" </unitDefinition>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M.getNumUnitDefinitions() == 1 );
ud = M.getUnitDefinition(0);
assertEquals( true, ud.isSetId() );
assertTrue(( "Fahrenheit" == ud.getId() ));
assertTrue( ud.getNumUnits() == 1 );
u = ud.getUnit(0);
assertTrue( u.getKind() == libsbml.UNIT_KIND_CELSIUS );
assertTrue( u.getExponent() == 1 );
assertTrue( u.getScale() == 0 );
assertTrue( u.getMultiplier() == 1.8 );
assertTrue( u.getOffset() == 32 );
}
示例8: test_ReadSBML_Unit_defaults_L1_L2
public void test_ReadSBML_Unit_defaults_L1_L2()
{
Unit u;
UnitDefinition ud;
string s = wrapSBML_L1v2("<listOfUnitDefinitions>" +
" <unitDefinition name='bogomips'>" +
" <listOfUnits> <unit kind='second'/> </listOfUnits>" +
" </unitDefinition>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M.getNumUnitDefinitions() == 1 );
ud = M.getUnitDefinition(0);
assertTrue(( "bogomips" == ud.getId() ));
assertTrue( ud.getNumUnits() == 1 );
u = ud.getUnit(0);
assertTrue( u.getKind() == libsbml.UNIT_KIND_SECOND );
assertTrue( u.getExponent() == 1 );
assertTrue( u.getScale() == 0 );
assertTrue( u.getMultiplier() == 1.0 );
assertTrue( u.getOffset() == 0.0 );
}
示例9: test_ReadSBML_UnitDefinition_L2
public void test_ReadSBML_UnitDefinition_L2()
{
UnitDefinition ud;
string s = wrapSBML_L2v1("<listOfUnitDefinitions>" +
" <unitDefinition id='mmls' name='mmol/ls'/>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M.getNumUnitDefinitions() == 1 );
ud = M.getUnitDefinition(0);
assertEquals( true, ud.isSetId() );
assertEquals( true, ud.isSetName() );
assertTrue(( "mmls" == ud.getId() ));
assertTrue(( "mmol/ls" == ud.getName() ));
}
示例10: test_ReadSBML_UnitDefinition
public void test_ReadSBML_UnitDefinition()
{
UnitDefinition ud;
string s = wrapSBML_L1v2("<listOfUnitDefinitions>" +
" <unitDefinition name='mmls'/>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M.getNumUnitDefinitions() == 1 );
ud = M.getUnitDefinition(0);
assertTrue(( "mmls" == ud.getId() ));
}
示例11: test_ReadSBML_Unit
public void test_ReadSBML_Unit()
{
Unit u;
UnitDefinition ud;
string s = wrapSBML_L1v2("<listOfUnitDefinitions>" +
" <unitDefinition name='substance'>" +
" <listOfUnits> <unit kind='mole' scale='-3'/> </listOfUnits>" +
" </unitDefinition>" +
"</listOfUnitDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M.getNumUnitDefinitions() == 1 );
ud = M.getUnitDefinition(0);
assertTrue(( "substance" == ud.getId() ));
assertTrue( ud.getNumUnits() == 1 );
u = ud.getUnit(0);
assertTrue( u.getKind() == libsbml.UNIT_KIND_MOLE );
assertTrue( u.getExponent() == 1 );
assertTrue( u.getScale() == -3 );
}