libSBML C++ API
libSBML 5.17.2 C++ API
|
Simple example of writing a model that uses the SBML Level 3 Flux Balance Constraints package.
int main(int argc,char** argv)
{
compartment->
setId(
"compartment");
= static_cast<FbcModelPlugin*>(model->
getPlugin(
"fbc"));
bound->setReaction("J0");
bound->setOperation("equal");
bound->setValue(10);
objective->
setId(
"obj1");
delete document;
}
A reference to an SBML species in a reaction.
Definition: SpeciesReference.h:271
An objective function for a flux.
Definition: FluxObjective.h:96
int setConstant(bool value)
Sets the value of the "constant" attribute of this Compartment object.
Definition: Compartment.cpp:677
An SBML reaction between species in an SBML model.
Definition: Reaction.h:214
Extension of Model.
Definition: FbcModelPlugin.h:152
Include all SBML types in a single header file.
Reaction * createReaction()
Creates a new Reaction inside this Model and returns it.
Definition: Model.cpp:1771
int setReversible(bool value)
Sets the value of the "reversible" attribute of this Reaction.
Definition: Reaction.cpp:603
int setFast(bool value)
Sets the value of the "fast" attribute of this Reaction.
Definition: Reaction.cpp:616
Species * createSpecies()
Creates a new Species inside this Model and returns it.
Definition: Model.cpp:1582
virtual int setReaction(const std::string &reaction)
Sets the value of the "reaction" attribute of this FluxObjective.
Definition: FluxObjective.cpp:243
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Compartment object.
Definition: Compartment.cpp:470
FluxBound * createFluxBound()
Creates a new FluxBound object and adds it to the list of FluxBound objects and returns it.
Definition: FbcModelPlugin.cpp:823
SpeciesReference * createReactant()
Creates a new SpeciesReference, adds it to this Reaction's list of reactants, and returns it.
Definition: Reaction.cpp:951
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this FluxBound.
Definition: FluxBound.cpp:166
int setType(ObjectiveType_t type)
Sets the value of the "type" attribute of this Objective.
Definition: Objective.cpp:248
int setConstant(bool value)
Sets the "constant" attribute of this Species object.
Definition: Species.cpp:820
An SBML compartment, where species are located.
Definition: Compartment.h:480
An objective function.
Definition: Objective.h:138
int setSpecies(const std::string &sid)
Sets the "species" attribute of this SimpleSpeciesReference.
Definition: SimpleSpeciesReference.cpp:188
An SBML model.
Definition: Model.h:475
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Species.
Definition: Species.cpp:582
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Objective.
Definition: Objective.cpp:225
int setActiveObjectiveId(const std::string &objectiveId)
Sets the id of the active objective.
Definition: FbcModelPlugin.cpp:1319
SpeciesReference * createProduct()
Creates a new SpeciesReference, adds it to this Reaction's list of products, and returns it.
Definition: Reaction.cpp:979
Includes all SBML types of the fbc package extension in a single header file.
Objective * createObjective()
Creates a new Objective object, adds it to this FbcModelPlugin's ListOfObjectives and returns the Obj...
Definition: FbcModelPlugin.cpp:1088
int setPackageRequired(const std::string &package, bool flag)
Sets the required attribute value of the given package extension.
Definition: SBMLDocument.cpp:1431
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Reaction.
Definition: Reaction.cpp:512
int setStoichiometry(double value)
Sets the value of the "stoichiometry" attribute of this SpeciesReference.
Definition: SpeciesReference.cpp:303
Max or min value for a reaction flux.
Definition: FluxBound.h:127
int setConstant(bool flag)
Sets the "constant" attribute of this SpeciesReference to the given boolean flag.
Definition: SpeciesReference.cpp:391
Set of SBML Level + Version + namespace triples.
Definition: SBMLNamespaces.h:135
int setCompartment(const std::string &sid)
Sets the "compartment" attribute of this Species object.
Definition: Species.cpp:661
Compartment * createCompartment()
Creates a new Compartment inside this Model and returns it.
Definition: Model.cpp:1555
FluxObjective * createFluxObjective()
Creates a new FluxObjective object.
Definition: Objective.cpp:462
An SBML species – a pool of entities.
Definition: Species.h:419
virtual int setCoefficient(double coefficient)
Sets the value of the "coefficient" attribute of this FluxObjective.
Definition: FluxObjective.cpp:253
#define LIBSBML_CPP_NAMESPACE_USE
Definition: libsbml-namespace.h:63
Overall SBML container object.
Definition: SBMLDocument.h:338
int setSize(double value)
Sets the "size" attribute (or "volume" in SBML Level 1) of this Compartment object.
Definition: Compartment.cpp:601
SBasePlugin * getPlugin(const std::string &package)
Returns a plug-in object (extension interface) for an SBML Level 3 package extension with the given p...
Definition: SBase.cpp:3456
int setBoundaryCondition(bool value)
Sets the "boundaryCondition" attribute of this Species object.
Definition: Species.cpp:787
int setHasOnlySubstanceUnits(bool value)
Sets the "hasOnlySubstanceUnits" attribute of this Species object.
Definition: Species.cpp:767
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
Model * createModel(const std::string &sid="")
Creates a new Model inside this SBMLDocument, and returns a pointer to it.
Definition: SBMLDocument.cpp:635