本文整理汇总了C++中KineticLaw::getLocalParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ KineticLaw::getLocalParameter方法的具体用法?C++ KineticLaw::getLocalParameter怎么用?C++ KineticLaw::getLocalParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KineticLaw
的用法示例。
在下文中一共展示了KineticLaw::getLocalParameter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createCompartment
/* convert from L1 to L3 */
void
Model::convertL3ToL1 ()
{
//
// Level 3 allows a model to be specified without a Compartment. However
// this is not valid in Level 1. Thus if a L3 model has no Compartment
// one must be included
//
if (getNumCompartments() == 0)
{
createCompartment()->setId(ASSIGNED_COMPARTMENT);
}
dealWithModelUnits();
dealWithAssigningL1Stoichiometry(*this, false);
for (unsigned int i = 0; i < getNumReactions(); i++)
{
Reaction *r = getReaction(i);
if (r->isSetKineticLaw())
{
KineticLaw *kl = r->getKineticLaw();
for (unsigned int j = 0; j < kl->getNumLocalParameters(); j++)
{
Parameter *lp = new Parameter(getLevel(), getVersion());
(*lp) = *(kl->getLocalParameter(j));
kl->addParameter(lp);
}
}
}
}
示例3: updateKineticLawFromBound
void updateKineticLawFromBound(Reaction* reaction, FluxBound* current)
{
if (reaction == NULL || current == NULL)
return;
const string operation = current -> getOperation();
KineticLaw *law = reaction->getKineticLaw();
LocalParameter* LB = law->getLocalParameter("LOWER_BOUND");
LocalParameter* UB = law->getLocalParameter("UPPER_BOUND");
if (operation == "less" || operation == "lessEqual" || operation == "equal")
{
UB->setValue(current->getValue());
}
if (operation == "greater" || operation == "greaterEqual" || operation == "equal")
{
LB->setValue(current->getValue());
}
}
示例4: setObjectiveCoefficient
void setObjectiveCoefficient(FbcModelPlugin* plugin, Model* model)
{
if (plugin == NULL || model == NULL)
return;
Objective* obj = plugin->getActiveObjective();
if (obj == NULL)
return;
for (unsigned int i = 0; i < obj->getNumFluxObjectives(); ++i)
{
FluxObjective* fluxObj = obj->getFluxObjective(i);
if (fluxObj == NULL)
continue;
Reaction* reaction = model->getReaction(fluxObj->getReaction());
if (reaction == NULL)
continue;
KineticLaw* law = reaction->getKineticLaw();
if (law == NULL)
continue;
LocalParameter* param = law->getLocalParameter("OBJECTIVE_COEFFICIENT");
param->setValue(fluxObj->getCoefficient());
}
}
示例5: dealWithModelUnits
/* convert from L1 to L3 */
void
Model::convertL3ToL2 (bool strict)
{
dealWithModelUnits();
dealWithStoichiometry();
dealWithEvents(strict);
for (unsigned int i = 0; i < getNumReactions(); i++)
{
Reaction *r = getReaction(i);
if (r->isSetKineticLaw())
{
KineticLaw *kl = r->getKineticLaw();
for (unsigned int j = 0; j < kl->getNumLocalParameters(); j++)
{
Parameter *lp = new Parameter(getLevel(), getVersion());
(*lp) = *(kl->getLocalParameter(j));
kl->addParameter(lp);
}
}
}
}