本文整理汇总了C++中KineticLaw::createLocalParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ KineticLaw::createLocalParameter方法的具体用法?C++ KineticLaw::createLocalParameter怎么用?C++ KineticLaw::createLocalParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KineticLaw
的用法示例。
在下文中一共展示了KineticLaw::createLocalParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createKineticLawForReaction
void createKineticLawForReaction(Reaction* reaction)
{
if (reaction == NULL)
return;
reaction->unsetKineticLaw();
KineticLaw *law = reaction->getKineticLaw();
if (law == NULL)
{
law = reaction->createKineticLaw();
LocalParameter* fluxValue = law->createLocalParameter();
fluxValue->initDefaults();
fluxValue->setId("FLUX_VALUE");
fluxValue->setValue(0);
fluxValue->setUnits("dimensionless");
ASTNode* astn = SBML_parseFormula("FLUX_VALUE");
law->setMath(astn);
delete astn;
}
LocalParameter* LB = law->getLocalParameter("LOWER_BOUND");
if (LB == NULL)
{
LB = law->createLocalParameter();
LB->initDefaults();
LB->setId("LOWER_BOUND");
LB->setUnits("dimensionless");
LB->setValue(-std::numeric_limits<double>::infinity());
}
LocalParameter* UB = law->getLocalParameter("UPPER_BOUND");
if (UB == NULL)
{
UB = law->createLocalParameter();
UB->initDefaults();
UB->setId("UPPER_BOUND");
UB->setUnits("dimensionless");
LB->setValue(std::numeric_limits<double>::infinity());
}
LocalParameter* param = law->getLocalParameter("OBJECTIVE_COEFFICIENT");
if (param == NULL)
{
param = law->createLocalParameter();
param->initDefaults();
param->setId("OBJECTIVE_COEFFICIENT");
param->setUnits("dimensionless");
param->setValue(0);
}
}
示例2: equals
END_TEST
START_TEST (test_WriteL3SBML_KineticLaw_ListOfParameters)
{
const char* expected =
"<kineticLaw>\n"
" <listOfLocalParameters>\n"
" <localParameter id=\"n\" value=\"1.2\"/>\n"
" </listOfLocalParameters>\n"
"</kineticLaw>";
KineticLaw *kl = D->createModel()->createReaction()->createKineticLaw();
LocalParameter *p = kl->createLocalParameter();
p->setId("n");
p->setValue(1.2);
char* sbml = kl->toSBML();
fail_unless( equals(expected, sbml) );
safe_free(sbml);
}