本文整理汇总了C++中Objective::setId方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::setId方法的具体用法?C++ Objective::setId怎么用?C++ Objective::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: document
END_TEST
START_TEST(test_FbcExtension_create_and_write_new_geneassociation
)
{
FbcPkgNamespaces *sbmlns = new FbcPkgNamespaces(3, 1, 2);
// create the document
SBMLDocument document(sbmlns);
document.setConsistencyChecks(LIBSBML_CAT_UNITS_CONSISTENCY, false);
document.setConsistencyChecks(LIBSBML_CAT_MODELING_PRACTICE, false);
// create the Model
Model* model = document.createModel();
// create the Compartment
Compartment* compartment = model->createCompartment();
compartment->setId("compartment");
compartment->setConstant(true);
compartment->setSize(1);
// create the Species
Species* species = model->createSpecies();
species->setId("Node1");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species = model->createSpecies();
species->setId("Node2");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
Reaction* reaction = model->createReaction();
reaction->setId("J0");
reaction->setReversible(false);
SpeciesReference* reactant = reaction->createReactant();
reactant->setSpecies("Node0");
reactant->setStoichiometry(1);
SpeciesReference* product = reaction->createProduct();
product->setSpecies("Node1");
product->setStoichiometry(1);
// use fbc
FbcModelPlugin* mplugin = static_cast<FbcModelPlugin*>(model->getPlugin("fbc"));
fail_unless(mplugin != NULL);
FluxBound* bound = mplugin->createFluxBound();
bound->setId("bound1");
bound->setReaction("J0");
bound->setOperation("equal");
bound->setValue(10);
Objective* objective = mplugin->createObjective();
objective->setId("obj1");
objective->setType("maximize");
FluxObjective* fluxObjective = objective->createFluxObjective();
fluxObjective->setReaction("J0");
fluxObjective->setCoefficient(1);
FbcReactionPlugin* rplug = dynamic_cast<FbcReactionPlugin*>(reaction->getPlugin("fbc"));
fail_unless(rplug != NULL);
GeneProductAssociation * ga = rplug->createGeneProductAssociation();
ga->setId("ga1");
ga->setAssociation("MG_077 AND MG_321 AND MG_080 AND MG_078 AND MG_079");
fail_unless(ga->getAssociation() != NULL);
fail_unless(mplugin->getNumGeneProducts() == 5);
ga->setAssociation("MG_077 AND MG_321 AND MG_080 AND MG_078 AND MG_079");
fail_unless(ga->getAssociation() != NULL);
fail_unless(mplugin->getNumGeneProducts() == 5);
delete sbmlns;
}
示例2: main
LIBSBML_CPP_NAMESPACE_USE
int main(int argc,char** argv)
{
SBMLNamespaces sbmlns(3,1,"fbc",1);
// create the document
SBMLDocument *document = new SBMLDocument(&sbmlns);
document->setPackageRequired("fbc", false);
// create the Model
Model* model=document->createModel();
// create the Compartment
Compartment* compartment = model->createCompartment();
compartment->setId("compartment");
compartment->setConstant(true);
compartment->setSize(1);
// create the Species
Species* species = model->createSpecies();
species->setId("Node1");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node2");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node3");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node4");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node5");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node6");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node7");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node8");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node0");
species->setCompartment("compartment");
species->setBoundaryCondition(true);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
species = model->createSpecies();
species->setId("Node9");
species->setCompartment("compartment");
species->setBoundaryCondition(true);
species->setConstant(false);
species->setHasOnlySubstanceUnits(false);
Reaction* reaction = model->createReaction();
reaction->setId("J0");
reaction->setReversible(false);
reaction->setFast(false);
SpeciesReference* reactant = reaction->createReactant();
reactant->setSpecies("Node0");
//.........这里部分代码省略.........
示例3: FbcPkgNamespaces
END_TEST
START_TEST(test_FbcExtension_create_and_write_L3V1V1)
{
FbcPkgNamespaces *sbmlns = new FbcPkgNamespaces(3, 1, 1);
// create the document
SBMLDocument *document = new SBMLDocument(sbmlns);
delete sbmlns;
// create the Model
Model* model = document->createModel();
// create the Compartment
Compartment* compartment = model->createCompartment();
compartment->setId("compartment");
compartment->setConstant(true);
compartment->setSize(1);
// create the Species
Species* species = model->createSpecies();
species->setId("Node1");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
species = model->createSpecies();
species->setId("Node2");
species->setCompartment("compartment");
species->setBoundaryCondition(false);
Reaction* reaction = model->createReaction();
reaction->setId("J0");
reaction->setReversible(false);
SpeciesReference* reactant = reaction->createReactant();
reactant->setSpecies("Node0");
reactant->setStoichiometry(1);
SpeciesReference* product = reaction->createProduct();
product->setSpecies("Node1");
product->setStoichiometry(1);
// use fbc
FbcModelPlugin* mplugin = static_cast<FbcModelPlugin*>(model->getPlugin("fbc"));
fail_unless(mplugin != NULL);
FluxBound* bound = mplugin->createFluxBound();
bound->setId("bound1");
bound->setReaction("J0");
bound->setOperation("equal");
bound->setValue(10);
Objective* objective = mplugin->createObjective();
objective->setId("obj1");
objective->setType("maximize");
FluxObjective* fluxObjective = objective->createFluxObjective();
fluxObjective->setReaction("J0");
fluxObjective->setCoefficient(1);
string s1 = writeSBMLToStdString(document);
// check clone()
SBMLDocument* document2 = document->clone();
string s2 = writeSBMLToStdString(document2);
fail_unless(s1 == s2);
// check operator=
Model m = *(document->getModel());
document2->setModel(&m);
s2 = writeSBMLToStdString(document2);
fail_unless(s1 == s2);
delete document2;
delete document;
}