libSBML C API
5.18.0
|
An integral component in a complete description of a steady-state model is the so-called objective function, which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the SBML Level 3 Flux Balance Constraints (“fbc”) package, this concept is succinctly captured in the Objective_t class.
The Objective_t class is derived from the normal SBML SBase_t class and inherits the "metaid" and "sboTerm" attributes, as well as the subcomponents for Annotation and Notes. To these, the Objective_t class adds an optional attribute named "type". The type attribute can take one of two literal values: "maximize"
or "minimize"
. The values represent the sense of the optimality constraint for the FBC model.
The “fbc” package allows for the definition of multiple model objectives, with one being designated as active. The active objective is indicated using the attribute "activeObjective" on the ListOfObjectives_t object. Here is an example of the XML encoding of a model with a list of objective functions:
<fbc:listOfObjectives fbc:activeObjective="obj1"> <fbc:objective fbc:id="obj1" fbc:type="maximize"> <fbc:listOfFluxObjectives> <fbc:fluxObjective fbc:reaction="R101" fbc:coefficient="1"/> </fbc:listOfFluxObjectives> </fbc:objective> <fbc:objective fbc:id="obj2" fbc:type="minimize"> <fbc:listOfFluxObjectives> <fbc:fluxObjective fbc:reaction="R102" fbc:coefficient="-2.5"/> <fbc:fluxObjective fbc:reaction="R103" fbc:coefficient="1"/> </fbc:listOfFluxObjectives> </fbc:objective> </fbc:listOfObjectives>
Public Member Functions | |
Objective_t * | Objective_clone (Objective_t *o) |
Creates a deep copy of the given Objective_t structure. More... | |
Objective_t * | Objective_create (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Objective_t structure using the given SBML level and version , and the pkgVersion package version. More... | |
void | Objective_free (Objective_t *o) |
Frees the given Objective_t structure. More... | |
const char * | Objective_getId (const Objective_t *o) |
Returns the value of the "id" attribute of the given Objective_t structure. More... | |
const char * | Objective_getName (const Objective_t *o) |
Returns the value of the "name" attribute of the given Objective_t structure. More... | |
const char * | Objective_getType (Objective_t *obj) |
Takes a Objective_t structure and returns its type. More... | |
int | Objective_hasRequiredAttributes (const Objective_t *o) |
Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes of the given Objective_t structure have been set. More... | |
int | Objective_hasRequiredElements (const Objective_t *o) |
Predicate returning 1 (true) or 0 (false) depending on whether all the required sub-elements of the given Objective_t structure have been set. More... | |
int | Objective_isSetId (const Objective_t *o) |
Predicate returning 1 (true) if the given Objective_t structure's "id" is set. More... | |
int | Objective_isSetName (const Objective_t *o) |
Predicate returning 1 (true) if the given Objective_t structure's "name" is set. More... | |
int | Objective_isSetType (const Objective_t *o) |
Predicate returning 1 (true) if the given Objective_t structure's "type" is set. More... | |
int | Objective_setId (Objective_t *o, const char *id) |
Sets the "id" attribute of the given Objective_t structure. More... | |
int | Objective_setName (Objective_t *o, const char *name) |
Sets the "name" attribute of the given Objective_t structure. More... | |
int | Objective_setType (Objective_t *o, const char *type) |
Sets the "type" attribute of the given Objective_t structure. More... | |
int | Objective_unsetId (Objective_t *o) |
Unsets the value of the "id" attribute of the given Objective_t structure. More... | |
int | Objective_unsetName (Objective_t *o) |
Unsets the value of the "name" attribute of the given Objective_t structure. More... | |
int | Objective_unsetType (Objective_t *o) |
Unsets the value of the "type" attribute of the given Objective_t structure. More... | |
ObjectiveType_t | ObjectiveType_fromString (const char *s) |
Returns the ObjectiveType_t enumeration corresponding to the given string, or OBJECTIVE_TYPE_UNKNOWN if there is no such match. More... | |
int | ObjectiveType_isValidObjectiveType (ObjectiveType_t type) |
Predicate returning 1 (true) or 0 (false) depending on whether the given ObjectiveType_t is valid. More... | |
int | ObjectiveType_isValidObjectiveTypeString (const char *s) |
Predicate returning 1 (true) or 0 (false) depending on whether the given string is a valid ObjectiveType_t. More... | |
const char * | ObjectiveType_toString (ObjectiveType_t type) |
Returns the string version of the provided ObjectiveType_t enumeration. More... | |
Objective_t * Objective_clone | ( | Objective_t * | o | ) |
Creates a deep copy of the given Objective_t structure.
o | the Objective_t structure to be copied. |
Objective_t * Objective_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Objective_t structure using the given SBML level
and version
, and the pkgVersion
package version.
level | an unsigned int, the SBML level to assign to this Objective_t structure. |
version | an unsigned int, the SBML version to assign to this Objective_t structure. |
pkgVersion | an unsigned int, the version of the package to assign to this Objective_t structure. |
void Objective_free | ( | Objective_t * | o | ) |
Frees the given Objective_t structure.
o | the Objective_t structure to be freed. |
const char * Objective_getId | ( | const Objective_t * | o | ) |
Returns the value of the "id" attribute of the given Objective_t structure.
o | the Objective_t structure. |
const char * Objective_getName | ( | const Objective_t * | o | ) |
Returns the value of the "name" attribute of the given Objective_t structure.
o | the Objective_t structure. |
const char * Objective_getType | ( | Objective_t * | obj | ) |
Takes a Objective_t structure and returns its type.
obj | the Objective_t whose type is sought. |
int Objective_hasRequiredAttributes | ( | const Objective_t * | o | ) |
Predicate returning 1
(true) or 0
(false) depending on whether all the required attributes of the given Objective_t structure have been set.
o | the Objective_t structure to check. |
1
(true) if all the required attributes for this structure have been defined, 0
(false) otherwise. int Objective_hasRequiredElements | ( | const Objective_t * | o | ) |
Predicate returning 1
(true) or 0
(false) depending on whether all the required sub-elements of the given Objective_t structure have been set.
o | the Objective_t structure to check. |
1
(true) if all the required sub-elements for this structure have been defined, 0
(false) otherwise. int Objective_isSetId | ( | const Objective_t * | o | ) |
Predicate returning 1
(true) if the given Objective_t structure's "id" is set.
o | the Objective_t structure. |
1
(true) if the "id" of this Objective_t structure is set, 0
(false) otherwise. int Objective_isSetName | ( | const Objective_t * | o | ) |
Predicate returning 1
(true) if the given Objective_t structure's "name" is set.
o | the Objective_t structure. |
1
(true) if the "name" of this Objective_t structure is set, 0
(false) otherwise. int Objective_isSetType | ( | const Objective_t * | o | ) |
Predicate returning 1
(true) if the given Objective_t structure's "type" is set.
o | the Objective_t structure. |
1
(true) if the "type" of this Objective_t structure is set, 0
(false) otherwise. int Objective_setId | ( | Objective_t * | o, |
const char * | id | ||
) |
Sets the "id" attribute of the given Objective_t structure.
This function copies the string given in id
. If the string is a null pointer, this function is equivalent to calling Objective_unsetId().
o | the Objective_t structure. |
id | the string to which the structures "id" attribute should be set. |
id
is equivalent to unsetting the value of the "id" attribute. int Objective_setName | ( | Objective_t * | o, |
const char * | name | ||
) |
Sets the "name" attribute of the given Objective_t structure.
This function copies the string given in name
. If the string is a null pointer, this function is equivalent to calling Objective_unsetName().
o | the Objective_t structure. |
name | the string to which the structures "name" attribute should be set. |
name
is equivalent to unsetting the value of the "name" attribute. int Objective_setType | ( | Objective_t * | o, |
const char * | type | ||
) |
Sets the "type" attribute of the given Objective_t structure.
o | the Objective_t structure. |
type | the string to which the structures "type" attribute should be set. Valid values include:
|
int Objective_unsetId | ( | Objective_t * | o | ) |
Unsets the value of the "id" attribute of the given Objective_t structure.
o | the Objective_t structure. |
int Objective_unsetName | ( | Objective_t * | o | ) |
Unsets the value of the "name" attribute of the given Objective_t structure.
o | the Objective_t structure. |
int Objective_unsetType | ( | Objective_t * | o | ) |
Unsets the value of the "type" attribute of the given Objective_t structure.
o | the Objective_t structure. |
ObjectiveType_t ObjectiveType_fromString | ( | const char * | s | ) |
Returns the ObjectiveType_t enumeration corresponding to the given string, or OBJECTIVE_TYPE_UNKNOWN if there is no such match.
The matching is case-sensitive: "maximize" will return OBJECTIVE_TYPE_MAXIMIZE, but "Maximize" will return OBJECTIVE_TYPE_UNKNOWN.
s | the string to convert to an ObjectiveType_t. |
int ObjectiveType_isValidObjectiveType | ( | ObjectiveType_t | type | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given ObjectiveType_t is valid.
type | the ObjectiveType_t enumeration to query. |
1
(true) if the ObjectiveType_t is OBJECTIVE_TYPE_MAXIMIZE or OBJECTIVE_TYPE_MINIMIZE; 0
(false) otherwise (including OBJECTIVE_TYPE_UNKNOWN). int ObjectiveType_isValidObjectiveTypeString | ( | const char * | s | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given string is a valid ObjectiveType_t.
The matching is case-sensitive: "maximize" will return true
, but "Maximize" will return false
.
s | the string to query. |
1
(true) if the string is "maximize" or "minimize"; 0
(false) otherwise. const char * ObjectiveType_toString | ( | ObjectiveType_t | type | ) |
Returns the string version of the provided ObjectiveType_t enumeration.
type | the ObjectiveType_t enumeration to convert. |
NULL
if the value is OBJECTIVE_TYPE_UNKNOWN or another invalid enumeration value.