本文整理汇总了C++中Objective::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::getType方法的具体用法?C++ Objective::getType怎么用?C++ Objective::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::getType方法的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: checkFbc
void checkFbc(FbcModelPlugin* fbcmodplug, set<string>& components, set<string>& tests, const map<string, vector<double> >& results)
{
if (fbcmodplug->isSetStrict() && fbcmodplug->getStrict() == false) {
tests.insert("fbc:NonStrict");
}
List* allElements = fbcmodplug->getAllElements();
for (unsigned int e=0; e<allElements->getSize(); e++) {
SBase* element = static_cast<SBase*>(allElements->get(e));
FluxBound* fluxBound;
Objective* objective;
switch(element->getTypeCode()) {
case SBML_FBC_FLUXBOUND:
components.insert("fbc:FluxBound");
fluxBound = static_cast<FluxBound*>(element);
if (fluxBound->isSetOperation()) {
if (fluxBound->getOperation() == "lessEqual") {
tests.insert("fbc:BoundLessEqual");
}
else if (fluxBound->getOperation() == "greaterEqual") {
tests.insert("fbc:BoundGreaterEqual");
}
else if (fluxBound->getOperation() == "equal") {
tests.insert("fbc:BoundEqual");
}
}
break;
case SBML_FBC_OBJECTIVE:
components.insert("fbc:Objective");
objective = static_cast<Objective*>(element);
if (objective->isSetType()) {
if (objective->getType() == "maximize") {
tests.insert("fbc:MaximizeObjective");
}
else {
tests.insert("fbc:MinimizeObjective");
}
}
break;
case SBML_FBC_FLUXOBJECTIVE:
components.insert("fbc:FluxObjective");
break;
default:
break;
}
}
}