libSBML C API  5.18.0
FluxObjective_t Class Reference

Detailed Description

fbc An objective function for a flux.

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. An Objective_t object includes a list of flux objectives, each in the form of a FluxObjective_t object.

The FluxObjective_t class is a relatively simple container for a model variable weighted by a signed linear coefficient. In addition to the common SBML object attributes of "id" and "name" (both of which are optional), it adds two required attributes: "reaction" and "coefficient".

The "reaction" attribute must have a value of type SIdRef, and its value is restricted to the identifier of a Reaction_t object in the model. The "reaction" attribute identifiers the reaction to which the FluxObjective_t applies. The "coefficient" attribute must have a value of type double, and refers to the coefficient that this FluxObjective_t takes in the enclosing Objective_t. Its unit of measurement is dimensionless. The meaning of these two attributes together is given by the formula coefficient × reaction-flux. Since reactions in SBML Level 3 are in units of extent, the units of a flux objective are thus extent per time.

The following example * illustrates the use of these attributes in an example of a * ListOfObjectives_t:

<fbc:listOfObjectives fbc:activeObjective="obj1">
 <fbc:objective fbc:id="obj1" fbc:type="maximize">
  <fbc:listOfFluxObjectives>
   <fbc:fluxObjective fbc:reaction="R1" fbc:coefficient="1"/>
   <fbc:fluxObjective fbc:reaction="R2" fbc:coefficient="2"/>
  </fbc:listOfFluxObjectives>
 </fbc:objective>
</fbc:listOfObjectives>
See also
Objective_t
ListOfObjectives_t
ListOfFluxObjectives_t

Public Member Functions

FluxObjective_tFluxObjective_clone (FluxObjective_t *fo)
 Creates a deep copy of the given FluxObjective_t structure. More...
 
FluxObjective_tFluxObjective_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new FluxObjective_t structure using the given SBML level and version, and the pkgVersion package version. More...
 
void FluxObjective_free (FluxObjective_t *fo)
 Frees the given FluxObjective_t structure. More...
 
double FluxObjective_getCoefficient (const FluxObjective_t *fo)
 Returns the value of the "coefficient" attribute of the given FluxObjective_t structure. More...
 
const char * FluxObjective_getId (const FluxObjective_t *fo)
 Returns the value of the "id" attribute of the given FluxObjective_t structure. More...
 
const char * FluxObjective_getName (const FluxObjective_t *fo)
 Returns the value of the "name" attribute of the given FluxObjective_t structure. More...
 
const char * FluxObjective_getReaction (const FluxObjective_t *fo)
 Returns the value of the "reaction" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_hasRequiredAttributes (const FluxObjective_t *fo)
 Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes of the given FluxObjective_t structure have been set. More...
 
int FluxObjective_isSetCoefficient (const FluxObjective_t *fo)
 Predicate returning 1 (true) if the given FluxObjective_t structure's "coefficient" is set. More...
 
int FluxObjective_isSetId (const FluxObjective_t *fo)
 Predicate returning 1 (true) if the given FluxObjective_t structure's "id" is set. More...
 
int FluxObjective_isSetName (const FluxObjective_t *fo)
 Predicate returning 1 (true) if the given FluxObjective_t structure's "name" is set. More...
 
int FluxObjective_isSetReaction (const FluxObjective_t *fo)
 Predicate returning 1 (true) if the given FluxObjective_t structure's "reaction" is set. More...
 
int FluxObjective_setCoefficient (FluxObjective_t *fo, double coefficient)
 Sets the "coefficient" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_setId (FluxObjective_t *fo, const char *id)
 Sets the "id" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_setName (FluxObjective_t *fo, const char *name)
 Sets the "name" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_setReaction (FluxObjective_t *fo, const char *reaction)
 Sets the "reaction" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_unsetCoefficient (FluxObjective_t *fo)
 Unsets the value of the "coefficient" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_unsetId (FluxObjective_t *fo)
 Unsets the value of the "id" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_unsetName (FluxObjective_t *fo)
 Unsets the value of the "name" attribute of the given FluxObjective_t structure. More...
 
int FluxObjective_unsetReaction (FluxObjective_t *fo)
 Unsets the value of the "reaction" attribute of the given FluxObjective_t structure. More...
 
FluxObjective_tListOfFluxObjectives_getById (ListOf_t *lo, const char *sid)
 Return the structure indicated by the given sid. More...
 
FluxObjective_tListOfFluxObjectives_removeById (ListOf_t *lo, const char *sid)
 Removes the structure with the given sid from the given ListOf_t structure and returns a pointer to it. More...
 

Member Function Documentation

FluxObjective_t * FluxObjective_clone ( FluxObjective_t fo)

Creates a deep copy of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure to be copied.
Returns
a (deep) copy of the given FluxObjective_t structure, or a null pointer if a failure occurred.
FluxObjective_t * FluxObjective_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new FluxObjective_t structure using the given SBML level and version, and the pkgVersion package version.

Parameters
levelan unsigned int, the SBML level to assign to this FluxObjective_t structure.
versionan unsigned int, the SBML version to assign to this FluxObjective_t structure.
pkgVersionan unsigned int, the version of the package to assign to this FluxObjective_t structure.
Returns
the newly-created FluxObjective_t structure, or a null pointer if an error occurred during construction.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute.
void FluxObjective_free ( FluxObjective_t fo)

Frees the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure to be freed.
double FluxObjective_getCoefficient ( const FluxObjective_t fo)

Returns the value of the "coefficient" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
the coefficient of this structure.
const char * FluxObjective_getId ( const FluxObjective_t fo)

Returns the value of the "id" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
the id of this structure.
const char * FluxObjective_getName ( const FluxObjective_t fo)

Returns the value of the "name" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
the name of this structure.
const char * FluxObjective_getReaction ( const FluxObjective_t fo)

Returns the value of the "reaction" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
the reaction of this structure.
int FluxObjective_hasRequiredAttributes ( const FluxObjective_t fo)

Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes of the given FluxObjective_t structure have been set.

Parameters
fothe FluxObjective_t structure to check.
Returns
1 (true) if all the required attributes for this structure have been defined, 0 (false) otherwise.
int FluxObjective_isSetCoefficient ( const FluxObjective_t fo)

Predicate returning 1 (true) if the given FluxObjective_t structure's "coefficient" is set.

Parameters
fothe FluxObjective_t structure.
Returns
1 (true) if the "coefficient" of this FluxObjective_t structure is set, 0 (false) otherwise.
int FluxObjective_isSetId ( const FluxObjective_t fo)

Predicate returning 1 (true) if the given FluxObjective_t structure's "id" is set.

Parameters
fothe FluxObjective_t structure.
Returns
1 (true) if the "id" of this FluxObjective_t structure is set, 0 (false) otherwise.
int FluxObjective_isSetName ( const FluxObjective_t fo)

Predicate returning 1 (true) if the given FluxObjective_t structure's "name" is set.

Parameters
fothe FluxObjective_t structure.
Returns
1 (true) if the "name" of this FluxObjective_t structure is set, 0 (false) otherwise.
int FluxObjective_isSetReaction ( const FluxObjective_t fo)

Predicate returning 1 (true) if the given FluxObjective_t structure's "reaction" is set.

Parameters
fothe FluxObjective_t structure.
Returns
1 (true) if the "reaction" of this FluxObjective_t structure is set, 0 (false) otherwise.
int FluxObjective_setCoefficient ( FluxObjective_t fo,
double  coefficient 
)

Sets the "coefficient" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
coefficientthe string to which the structures "coefficient" attribute should be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FluxObjective_setId ( FluxObjective_t fo,
const char *  id 
)

Sets the "id" attribute of the given FluxObjective_t structure.

This function copies the string given in id. If the string is a null pointer, this function is equivalent to calling FluxObjective_unsetId().

Parameters
fothe FluxObjective_t structure.
idthe string to which the structures "id" attribute should be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with a null pointer for id is equivalent to unsetting the value of the "id" attribute.
int FluxObjective_setName ( FluxObjective_t fo,
const char *  name 
)

Sets the "name" attribute of the given FluxObjective_t structure.

This function copies the string given in name. If the string is a null pointer, this function is equivalent to calling FluxObjective_unsetName().

Parameters
fothe FluxObjective_t structure.
namethe string to which the structures "name" attribute should be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with a null pointer for name is equivalent to unsetting the value of the "name" attribute.
int FluxObjective_setReaction ( FluxObjective_t fo,
const char *  reaction 
)

Sets the "reaction" attribute of the given FluxObjective_t structure.

This function copies the string given in reaction. If the string is a null pointer, this function is equivalent to calling FluxObjective_unsetReaction().

Parameters
fothe FluxObjective_t structure.
reactionthe string to which the structures "reaction" attribute should be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with a null pointer for reaction is equivalent to unsetting the value of the "reaction" attribute.
int FluxObjective_unsetCoefficient ( FluxObjective_t fo)

Unsets the value of the "coefficient" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FluxObjective_unsetId ( FluxObjective_t fo)

Unsets the value of the "id" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FluxObjective_unsetName ( FluxObjective_t fo)

Unsets the value of the "name" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FluxObjective_unsetReaction ( FluxObjective_t fo)

Unsets the value of the "reaction" attribute of the given FluxObjective_t structure.

Parameters
fothe FluxObjective_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
FluxObjective_t * ListOfFluxObjectives_getById ( ListOf_t lo,
const char *  sid 
)

Return the structure indicated by the given sid.

Parameters
lothe ListOf_t structure to use.
sida string matching the "id" attribute of the element sought.
Returns
the structure for the given variable, or NULL if no such object exists in the list.
FluxObjective_t * ListOfFluxObjectives_removeById ( ListOf_t lo,
const char *  sid 
)

Removes the structure with the given sid from the given ListOf_t structure and returns a pointer to it.

The caller owns the returned structure and is responsible for deleting it.

Parameters
lothe ListOf_t structure.
sidthe string of the "id" attribute of the sought structure.
Returns
the structure removed. As mentioned above, the caller owns the returned structure. NULL is returned if no structure with the "id" attribute exists in the given ListOf_t structure.