public class Objective extends SBase
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 (&ldquofbc&rdquo) package, this concept
is succinctly captured in the Objective
class.
The Objective
class is derived from the normal SBML SBase
class and
inherits the 'metaid' and 'sboTerm' attributes, as well as the
subcomponents for Annotation and Notes. To these, the Objective
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 &ldquofbc&rdquo 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
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>
FluxObjective
,
ListOfObjectives
Constructor and Description |
---|
Objective()
Creates a new
Objective with the given SBML Level, Version, and
&ldquofbc&rdquopackage version. |
Objective(FbcPkgNamespaces fbcns)
Creates a new
Objective with the given FbcPkgNamespaces object. |
Objective(long level)
Creates a new
Objective with the given SBML Level, Version, and
&ldquofbc&rdquopackage version. |
Objective(long level,
long version)
Creates a new
Objective with the given SBML Level, Version, and
&ldquofbc&rdquopackage version. |
Objective(long level,
long version,
long pkgVersion)
Creates a new
Objective with the given SBML Level, Version, and
&ldquofbc&rdquopackage version. |
Objective(Objective orig)
Copy constructor for
Objective . |
Modifier and Type | Method and Description |
---|---|
int |
addFluxObjective(FluxObjective fo)
Adds a copy the given 'FluxObjective' to this
Objective . |
Objective |
cloneObject()
Creates and returns a deep copy of this
Objective object. |
FluxObjective |
createFluxObjective()
Creates a new
FluxObjective object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this object.
|
FluxObjective |
getFluxObjective(long n)
Get a
FluxObjective from the ListOfFluxObjectives . |
FluxObjective |
getFluxObjective(java.lang.String sid)
Get a
FluxObjective from the ListOfFluxObjectives based on its
identifier. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Objective . |
ListOfFluxObjectives |
getListOfFluxObjectives()
Returns the 'ListOfFluxObjectives' in this
Objective object. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Objective . |
long |
getNumFluxObjectives()
Get the number of
FluxObjective objects in this Objective . |
int |
getObjectiveType()
Returns the enumeration value of the 'type' attribute of this
Objective . |
java.lang.String |
getType()
Returns the string of the 'type' attribute of this
Objective . |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this
Objective object have been set. |
boolean |
hasRequiredElements()
Predicate returning
true if all the required elements for this
Objective object have been set. |
boolean |
isSetId()
Predicate returning
true if this Objective 's 'id' attribute is set. |
boolean |
isSetName()
Predicate returning
true if this Objective 's 'name' attribute is set. |
boolean |
isSetType()
Predicate returning
true if this Objective 's 'type' attribute is set. |
FluxObjective |
removeFluxObjective(long n)
Removes the nth
FluxObjective from the ListOfFluxObjectives . |
FluxObjective |
removeFluxObjective(java.lang.String sid)
Removes the
FluxObjective with the given identifier from the
ListOfFluxObjectives . |
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this
Objective . |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Objective . |
int |
setType(int type)
Sets the SIdRef string of the 'type' attribute of this
Objective . |
int |
setType(java.lang.String type)
Sets the value of the 'type' attribute of this
Objective . |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Objective . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Objective . |
int |
unsetType()
Unsets the value of the 'type' attribute of this
Objective . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public Objective(long level, long version, long pkgVersion) throws SBMLConstructorException
Objective
with the given SBML Level, Version, and
&ldquofbc&rdquopackage version.
level
- a long integer, the SBML Level to assign to this Objective
version
- a long integer, the SBML Version to assign to this
Objective
pkgVersion
- a long integer, the SBML Fbc Version to assign to
this Objective
SBMLConstructorException
public Objective(long level, long version) throws SBMLConstructorException
Objective
with the given SBML Level, Version, and
&ldquofbc&rdquopackage version.
level
- a long integer, the SBML Level to assign to this Objective
version
- a long integer, the SBML Version to assign to this
Objective
pkgVersion
- a long integer, the SBML Fbc Version to assign to
this Objective
SBMLConstructorException
public Objective(long level) throws SBMLConstructorException
Objective
with the given SBML Level, Version, and
&ldquofbc&rdquopackage version.
level
- a long integer, the SBML Level to assign to this Objective
version
- a long integer, the SBML Version to assign to this
Objective
pkgVersion
- a long integer, the SBML Fbc Version to assign to
this Objective
SBMLConstructorException
public Objective() throws SBMLConstructorException
Objective
with the given SBML Level, Version, and
&ldquofbc&rdquopackage version.
level
- a long integer, the SBML Level to assign to this Objective
version
- a long integer, the SBML Version to assign to this
Objective
pkgVersion
- a long integer, the SBML Fbc Version to assign to
this Objective
SBMLConstructorException
public Objective(FbcPkgNamespaces fbcns) throws SBMLConstructorException
Objective
with the given FbcPkgNamespaces
object.
fbcns
- the FbcPkgNamespaces
objectSBMLConstructorException
public Objective(Objective orig) throws SBMLConstructorException
Objective
.
orig
- the Objective
instance to copy.SBMLConstructorException
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the Objective.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Objective.delete()
themselves.
public Objective cloneObject()
Objective
object.
cloneObject
 in class SBase
Objective
object.public java.lang.String getId()
Objective
.
public java.lang.String getName()
Objective
.
public int getObjectiveType()
Objective
.
Objective
.public java.lang.String getType()
Objective
.
Objective
.public boolean isSetId()
true
if this Objective
's 'id' attribute is set.
public boolean isSetName()
true
if this Objective
's 'name' attribute is set.
public boolean isSetType()
true
if this Objective
's 'type' attribute is set.
true
if this Objective
's 'type' attribute has been set,
otherwise false
is returned.public int setId(java.lang.String id)
Objective
.
public int setName(java.lang.String name)
Objective
.
public int setType(int type)
Objective
.
type
- a SIdRef string to be set.
public int setType(java.lang.String type)
Objective
.
type
- string value of the 'type' attribute to be set
public int unsetId()
Objective
.
public int unsetName()
Objective
.
public int unsetType()
Objective
.
public ListOfFluxObjectives getListOfFluxObjectives()
Objective
object.
Objective
.public FluxObjective getFluxObjective(long n)
FluxObjective
from the ListOfFluxObjectives
.
n
- the index number of the FluxObjective
to get.
FluxObjective
in the ListOfFluxObjectives
within this
Objective
.
Objective.getNumFluxObjectives()
public FluxObjective getFluxObjective(java.lang.String sid)
FluxObjective
from the ListOfFluxObjectives
based on its
identifier.
sid
- a string representing the identifier of the FluxObjective
to
get.
FluxObjective
in the ListOfFluxObjectives
with the given id
or null if no such FluxObjective
exists.
,
Objective.getFluxObjective(long n)
public int addFluxObjective(FluxObjective fo)
Objective
.
fo
- the FluxObjective
object to add
public long getNumFluxObjectives()
FluxObjective
objects in this Objective
.
FluxObjective
objects in this Objective
public FluxObjective createFluxObjective()
FluxObjective
object.
This method creates the FluxObjective
object, adds it to this Objective
object's ListOfFluxObjectives
, and returns the FluxObjective
object
created.
FluxObjective
object instance
Objective.addFluxObjective(FluxObjective fo)
public FluxObjective removeFluxObjective(long n)
FluxObjective
from the ListOfFluxObjectives
.
The caller owns the returned item and is responsible for deleting it.
n
- the index of the FluxObjective
to remove.
Objective.getNumFluxObjectives()
public FluxObjective removeFluxObjective(java.lang.String sid)
FluxObjective
with the given identifier from the
ListOfFluxObjectives
.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier sid
, then
null
is returned.
sid
- the identifier of the FluxObjective
to remove.
FluxObjective
removed. As mentioned above, the caller owns the
returned item.public java.lang.String getElementName()
For Objective
, the XML element name is always 'objective'.
getElementName
 in class SBase
'objective'.
public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class SBase
SBML_FBC_OBJECTIVE
(default).
Objective.getElementName()
,
SBase.getPackageName()
public boolean hasRequiredAttributes()
true
if all the required attributes for this
Objective
object have been set.
hasRequiredAttributes
 in class SBase
Objective
object are:
public boolean hasRequiredElements()
true
if all the required elements for this
Objective
object have been set.
hasRequiredElements
 in class SBase
Objective
object are:
FluxObjective
child of the ListOfFluxObjectives
.