本文整理汇总了C++中Objective::getFluxObjective方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::getFluxObjective方法的具体用法?C++ Objective::getFluxObjective怎么用?C++ Objective::getFluxObjective使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::getFluxObjective方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSBMLFromFile
END_TEST
START_TEST (test_FbcExtension_read_L3V1V1_defaultNS)
{
char *filename = safe_strcat(TestDataDirectory, "fbc_example1_defaultNS.xml");
SBMLDocument *document = readSBMLFromFile(filename);
fail_unless(document->getPackageName() == "core");
Model *model = document->getModel();
fail_unless(model != NULL);
fail_unless(model->getPackageName() == "core");
fail_unless(document->getNumErrors() == 0);
// get the fbc plugin
FbcModelPlugin* mplugin = static_cast<FbcModelPlugin*>(model->getPlugin("fbc"));
fail_unless(mplugin != NULL);
fail_unless(mplugin->getNumObjectives() == 1);
fail_unless(mplugin->getListOfObjectives()->getPackageName() == "fbc");
Objective* objective = mplugin->getObjective(0);
fail_unless(objective->getId() == "obj1");
fail_unless(objective->getType() == "maximize");
fail_unless(objective->getNumFluxObjectives() == 1);
fail_unless(objective->getPackageName() == "fbc");
fail_unless(objective->getListOfFluxObjectives()->getPackageName() == "fbc");
FluxObjective* fluxObjective = objective->getFluxObjective(0);
fail_unless(fluxObjective->getReaction() == "J8");
fail_unless(fluxObjective->getPackageName() == "fbc");
fail_unless(fluxObjective->getCoefficient() == 1);
fail_unless(mplugin->getNumFluxBounds() == 1);
fail_unless(mplugin->getListOfFluxBounds()->getPackageName() == "fbc");
FluxBound* bound = mplugin->getFluxBound(0);
fail_unless(bound->getId() == "bound1");
fail_unless(bound->getPackageName() == "fbc");
fail_unless(bound->getReaction() == "J0");
fail_unless(bound->getOperation() == "equal");
fail_unless(bound->getValue() == 10);
delete document;
}
示例2: 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());
}
}