libSBML C++ API
libSBML 5.18.0 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");
objective->
setId(
"obj1");
delete document;
}
@sbmlpackage{core}
Definition: SpeciesReference.h:276
@sbmlpackage{fbc}
Definition: FluxObjective.h:101
int setConstant(bool value)
Sets the value of the "constant" attribute of this Compartment object.
Definition: Compartment.cpp:681
@sbmlpackage{core}
Definition: Reaction.h:219
virtual int setReaction(const std::string &reaction)
Sets the value of the "reaction" attribute of this FluxBound object.
Definition: FluxBound.cpp:249
@sbmlpackage{fbc}
Definition: FbcModelPlugin.h:157
Include all SBML types in a single header file.
Reaction * createReaction()
Creates a new Reaction inside this Model and returns it.
Definition: Model.cpp:1779
int setReversible(bool value)
Sets the value of the "reversible" attribute of this Reaction.
Definition: Reaction.cpp:607
Model * createModel(const std::string sid="")
Creates a new Model inside this SBMLDocument, and returns a pointer to it.
Definition: SBMLDocument.cpp:643
int setFast(bool value)
Sets the value of the "fast" attribute of this Reaction.
Definition: Reaction.cpp:620
Species * createSpecies()
Creates a new Species inside this Model and returns it.
Definition: Model.cpp:1590
virtual int setReaction(const std::string &reaction)
Sets the value of the "reaction" attribute of this FluxObjective.
Definition: FluxObjective.cpp:247
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Compartment object.
Definition: Compartment.cpp:474
virtual int setValue(const double value)
Sets the value of the "value" attribute of this FluxBound object.
Definition: FluxBound.cpp:380
FluxBound * createFluxBound()
Creates a new FluxBound object and adds it to the list of FluxBound objects and returns it.
Definition: FbcModelPlugin.cpp:827
SpeciesReference * createReactant()
Creates a new SpeciesReference, adds it to this Reaction's list of reactants, and returns it.
Definition: Reaction.cpp:955
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this FluxBound.
Definition: FluxBound.cpp:170
int setType(ObjectiveType_t type)
Sets the value of the "type" attribute of this Objective.
Definition: Objective.cpp:252
int setConstant(bool value)
Sets the "constant" attribute of this Species object.
Definition: Species.cpp:824
@sbmlpackage{core}
Definition: Compartment.h:485
@sbmlpackage{fbc}
Definition: Objective.h:143
int setSpecies(const std::string &sid)
Sets the "species" attribute of this SimpleSpeciesReference.
Definition: SimpleSpeciesReference.cpp:192
@sbmlpackage{core}
Definition: Model.h:480
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Species.
Definition: Species.cpp:586
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Objective.
Definition: Objective.cpp:229
int setActiveObjectiveId(const std::string &objectiveId)
Sets the id of the active objective.
Definition: FbcModelPlugin.cpp:1323
SpeciesReference * createProduct()
Creates a new SpeciesReference, adds it to this Reaction's list of products, and returns it.
Definition: Reaction.cpp:983
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:1092
int setPackageRequired(const std::string &package, bool flag)
Sets the required attribute value of the given package extension.
Definition: SBMLDocument.cpp:1439
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Reaction.
Definition: Reaction.cpp:516
int setStoichiometry(double value)
Sets the value of the "stoichiometry" attribute of this SpeciesReference.
Definition: SpeciesReference.cpp:307
@sbmlpackage{fbc}
Definition: FluxBound.h:132
virtual int setOperation(const std::string &operation)
Sets the value of the "operation" attribute of this FluxBound object.
Definition: FluxBound.cpp:320
int setConstant(bool flag)
Sets the "constant" attribute of this SpeciesReference to the given boolean flag.
Definition: SpeciesReference.cpp:395
@sbmlpackage{core}
Definition: SBMLNamespaces.h:140
int setCompartment(const std::string &sid)
Sets the "compartment" attribute of this Species object.
Definition: Species.cpp:665
Compartment * createCompartment()
Creates a new Compartment inside this Model and returns it.
Definition: Model.cpp:1563
FluxObjective * createFluxObjective()
Creates a new FluxObjective object.
Definition: Objective.cpp:466
@sbmlpackage{core}
Definition: Species.h:424
virtual int setCoefficient(double coefficient)
Sets the value of the "coefficient" attribute of this FluxObjective.
Definition: FluxObjective.cpp:257
#define LIBSBML_CPP_NAMESPACE_USE
Definition: libsbml-namespace.h:67
@sbmlpackage{core}
Definition: SBMLDocument.h:343
int setSize(double value)
Sets the "size" attribute (or "volume" in SBML Level 1) of this Compartment object.
Definition: Compartment.cpp:605
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:3460
int setBoundaryCondition(bool value)
Sets the "boundaryCondition" attribute of this Species object.
Definition: Species.cpp:791
int setHasOnlySubstanceUnits(bool value)
Sets the "hasOnlySubstanceUnits" attribute of this Species object.
Definition: Species.cpp:771
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.