本文整理匯總了C#中libsbml.Model.addFunctionDefinition方法的典型用法代碼示例。如果您正苦於以下問題:C# Model.addFunctionDefinition方法的具體用法?C# Model.addFunctionDefinition怎麽用?C# Model.addFunctionDefinition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類libsbml.Model
的用法示例。
在下文中一共展示了Model.addFunctionDefinition方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: test_Model_addFunctionDefinition4
public void test_Model_addFunctionDefinition4()
{
Model m = new Model(2,2);
FunctionDefinition fd = new FunctionDefinition(2,2);
fd.setId( "fd");
fd.setMath(libsbml.parseFormula("fd"));
FunctionDefinition fd1 = new FunctionDefinition(2,2);
fd1.setId( "fd");
fd1.setMath(libsbml.parseFormula("fd"));
int i = m.addFunctionDefinition(fd);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( m.getNumFunctionDefinitions() == 1 );
i = m.addFunctionDefinition(fd1);
assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
assertTrue( m.getNumFunctionDefinitions() == 1 );
fd = null;
fd1 = null;
m = null;
}
示例2: test_Model_addFunctionDefinition3
public void test_Model_addFunctionDefinition3()
{
Model m = new Model(2,2);
FunctionDefinition fd = null;
int i = m.addFunctionDefinition(fd);
assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
assertTrue( m.getNumFunctionDefinitions() == 0 );
m = null;
}
示例3: test_FunctionDefinition_parent_add
public void test_FunctionDefinition_parent_add()
{
FunctionDefinition fd = new FunctionDefinition(2,4);
Model m = new Model(2,4);
fd.setId("fd");
fd.setMath(libsbml.parseFormula("l"));
m.addFunctionDefinition(fd);
fd = null;
ListOf lo = m.getListOfFunctionDefinitions();
assertTrue( lo == m.getFunctionDefinition(0).getParentSBMLObject() );
assertTrue( m == lo.getParentSBMLObject() );
}
示例4: test_Model_addFunctionDefinition2
public void test_Model_addFunctionDefinition2()
{
Model m = new Model(2,2);
FunctionDefinition fd = new FunctionDefinition(2,1);
fd.setId( "fd");
fd.setMath(libsbml.parseFormula("fd"));
int i = m.addFunctionDefinition(fd);
assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
assertTrue( m.getNumFunctionDefinitions() == 0 );
fd = null;
m = null;
}
示例5: test_FunctionDefinition_ancestor_add
public void test_FunctionDefinition_ancestor_add()
{
FunctionDefinition fd = new FunctionDefinition(2,4);
Model m = new Model(2,4);
fd.setId("fd");
fd.setMath(libsbml.parseFormula("l"));
m.addFunctionDefinition(fd);
fd = null;
ListOf lo = m.getListOfFunctionDefinitions();
FunctionDefinition obj = m.getFunctionDefinition(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 );
}