public class Model extends SBase
In an SBML model definition, a single object of class Model
serves as
the overall container for the lists of the various model components.
All of the lists are optional, but if a given list container is present
within the model, the list must not be empty that is, it must have
length one or more. The following are the components and lists
permitted in different Levels and Versions of SBML in
version 5.16.0
of libSBML:
UnitDefinition
, Compartment
,
Species
, Parameter
, Rule
, and Reaction
. Instances of the classes are
placed inside instances of classes ListOfUnitDefinitions
,
ListOfCompartments
, ListOfSpecies
, ListOfParameters
, ListOfRules
, and
ListOfReactions
.
FunctionDefinition
,
UnitDefinition
, Compartment
, Species
, Parameter
, Rule
, Reaction
and
Event
. Instances of the classes are placed inside instances of classes
ListOfFunctionDefinitions
, ListOfUnitDefinitions
, ListOfCompartments
,
ListOfSpecies
, ListOfParameters
, ListOfRules
, ListOfReactions
, and
ListOfEvents
.
FunctionDefinition
, UnitDefinition
, CompartmentType
, SpeciesType
,
Compartment
, Species
, Parameter
, InitialAssignment
, Rule
, Constraint
,
Reaction
and Event
. Instances of the classes are placed inside
instances of classes ListOfFunctionDefinitions
, ListOfUnitDefinitions
,
ListOfCompartmentTypes
, ListOfSpeciesTypes
, ListOfCompartments
,
ListOfSpecies
, ListOfParameters
, ListOfInitialAssignments
, ListOfRules
,
ListOfConstraints
, ListOfReactions
, and ListOfEvents
.
FunctionDefinition
,
UnitDefinition
, Compartment
, Species
, Parameter
, InitialAssignment
,
Rule
, Constraint
, Reaction
and Event
. Instances of the classes are
placed inside instances of classes ListOfFunctionDefinitions
,
ListOfUnitDefinitions
, ListOfCompartments
, ListOfSpecies
,
ListOfParameters
, ListOfInitialAssignments
, ListOfRules
,
ListOfConstraints
, ListOfReactions
, and ListOfEvents
.
Although all the lists are optional, there are dependencies between SBML components such that defining some components requires defining others. An example is that defining a species requires defining a compartment, and defining a reaction requires defining a species. The dependencies are explained in more detail in the SBML specifications.
In addition to the above lists and attributes, the Model
class in both
SBML Level 2 and Level 3 has the usual two attributes of 'id'
and 'name', and both are optional. As is the case for other SBML
components with 'id' and 'name' attributes, they must be used according
to the guidelines described in the SBML specifications. (Within the
frameworks of SBML Level 2 and Level 3, a
Model
object identifier has no assigned meaning, but extension packages
planned for SBML Level 3 are likely to make use of this
identifier.)
Finally, SBML Level 3 has introduced a number of additional Model
attributes. They are discussed in a separate section below.
LibSBML provides two main mechanisms for creating objects: class
constructors
(e.g., Species() ),
and createObject()
methods (such as Model.createSpecies()
) provided by certain Object classes such as Model
. These
multiple mechanisms are provided by libSBML for flexibility and to
support different use-cases, but they also have different implications
for the overall model structure.
In general, the recommended approach is to use the createObject()
methods. These
methods both create an object and link it to the parent in one step.
Here is an example:
// Create anSBMLDocument
object in Level 3 Version 1 format:SBMLDocument
sbmlDoc = newSBMLDocument
(3, 1) // Create aModel
object inside theSBMLDocument
object and set // its identifier. The call returns a pointer to theModel
object // created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Note that // the call to setId() returns a status code, and a real program // should check this status code to make sure everything went okay.Model
model = sbmlDoc.createModel() model.setId("BestModelEver") // Create aSpecies
object inside theModel
and set its identifier. // Similar to the lines above, this call returns a pointer to theSpecies
// object created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Note that, like // withModel
, the call to setId() returns a status code, and a real program // should check this status code to make sure everything went okay.Species
sp = model.createSpecies() sp.setId("BestSpeciesEver")
The createObject()
methods return a
pointer to the object created, but they also add the object to the
relevant list of object instances contained in the parent. (These lists
become the <listOfObjects>
elements in the
finished XML rendition of SBML.) In the example above,
Model.createSpecies()
adds the created species directly to the
<listOfSpeciesgt
list in the model. Subsequently,
methods called on the species change the species in the model (which is
what is expected in most situations).
To make it easier for applications to do whatever they need,
libSBML version 5.16.0
is relatively lax when it comes to enforcing correctness and
completeness of models during model construction and editing.
Essentially, libSBML will not in most cases check automatically
that a model's components have valid attribute values, or that the
overall model is consistent and free of errors&mdasheven obvious errors
such as duplication of identifiers. This allows applications great
leeway in how they build their models, but it means that software
authors must take deliberate steps to ensure that the model will be, in
the end, valid SBML. These steps include such things as keeping track
of the identifiers used in a model, manually performing updates in
certain situations where an entity is referenced in more than one place
(e.g., a species that is referenced by multiple SpeciesReference
objects), and so on.
That said, libSBML does provide powerful features for deliberately
performing validation of SBML when an application decides it is time to
do so. The interfaces to these facilities are on the SBMLDocument
class, in the form of SBMLDocument.checkInternalConsistency()
and
SBMLDocument.checkConsistency()
. Please refer to the documentation for
SBMLDocument
for more information about this.
While applications may play fast and loose and live like free spirits
during the construction and editing of SBML models, they should always
make sure to call SBMLDocument.checkInternalConsistency()
and/or
SBMLDocument.checkConsistency()
before writing out the final version of
an SBML model.
As mentioned above, the Model
class has a number of optional attributes
in SBML Level 3. These are 'substanceUnits',
'timeUnits', 'volumeUnits', 'areaUnits', 'lengthUnits', 'extentUnits',
and 'conversionFactor. The following provide more information about
them.
The 'substanceUnits' attribute is used to specify the unit of
measurement associated with substance quantities of Species
objects that
do not specify units explicitly. If a given Species
object definition
does not specify its unit of substance quantity via the 'substanceUnits'
attribute on the Species
object instance, then that species inherits the
value of the Model
'substanceUnits' attribute. If the Model
does not
define a value for this attribute, then there is no unit to inherit, and
all species that do not specify individual 'substanceUnits' attribute
values then have no declared units for their quantities. The
SBML Level 3 specifications provide more details.
Note that when the identifier of a species appears in a model's
mathematical expressions, the unit of measurement associated with that
identifier is not solely determined by setting 'substanceUnits'
on Model
or Species
. Please see the discussion about units given in
the documentation for the Species
class.
The 'timeUnits' attribute on SBML Level 3's Model
object is used to
specify the unit in which time is measured in the model. This attribute
on Model
is the only way to specify a unit for time in a model.
It is a global attribute time is measured in the model everywhere in
the same way. This is particularly relevant to Reaction
and RateRule
objects in a model: all Reaction
and RateRule
objects in SBML define
per-time values, and the unit of time is given by the 'timeUnits'
attribute on the Model
object instance. If the Model
'timeUnits'
attribute has no value, it means that the unit of time is not defined
for the model's reactions and rate rules. Leaving it unspecified in an
SBML model does not result in an invalid model in SBML Level 3
however, as a matter of best practice, we strongly recommend that all
models specify units of measurement for time.
The attributes 'volumeUnits', 'areaUnits' and 'lengthUnits' together are
used to set the units of measurements for the sizes of Compartment
objects in an SBML Level 3 model when those objects do not
otherwise specify units. The three attributes correspond to the most
common cases of compartment dimensions: 'volumeUnits' for compartments
having a 'spatialDimensions' attribute value of '3'
, 'areaUnits' for
compartments having a 'spatialDimensions' attribute value of '2'
, and
'lengthUnits' for compartments having a 'spatialDimensions' attribute
value of '1'.
The attributes are not applicable to compartments
whose 'spatialDimensions' attribute values are not one of '1'
,
'2'
or '3'.
If a given Compartment
object instance does not provide a value for its
'units' attribute, then the unit of measurement of that compartment's
size is inherited from the value specified by the Model
'volumeUnits',
'areaUnits' or 'lengthUnits' attribute, as appropriate based on the
Compartment
object's 'spatialDimensions' attribute value. If the Model
object does not define the relevant attribute, then there are no units
to inherit, and all Compartment
objects that do not set a value for
their 'units' attribute then have no units associated with
their compartment sizes.
The use of three separate attributes is a carry-over from SBML Level 2. Note that it is entirely possible for a model to define a value for two or more of the attributes 'volumeUnits', 'areaUnits' and 'lengthUnits' simultaneously, because SBML models may contain compartments with different numbers of dimensions.
Reactions are processes that occur over time. These processes involve events of some sort, where a single ``reaction event'' is one in which some set of entities (known as reactants, products and modifiers in SBML) interact, once. The extent of a reaction is a measure of how many times the reaction has occurred, while the time derivative of the extent gives the instantaneous rate at which the reaction is occurring. Thus, what is colloquially referred to as the 'rate of the reaction' is in fact equal to the rate of change of reaction extent.
In SBML Level 3, the combination of 'extentUnits' and 'timeUnits'
defines the units of kinetic laws in SBML and establishes how the
numerical value of each KineticLaw
object's mathematical formula is
meant to be interpreted in a model. The units of the kinetic laws are
taken to be 'extentUnits' divided by 'timeUnits'.
Note that this embodies an important principle in SBML Level 3 models: all reactions in an SBML model must have the same units for the rate of change of extent. In other words, the units of all reaction rates in the model must be the same. There is only one global value for 'extentUnits' and one global value for 'timeUnits'.
The attribute 'conversionFactor' in SBML Level 3's Model
object
defines a global value inherited by all Species
object instances that do
not define separate values for their 'conversionFactor' attributes. The
value of this attribute must refer to a Parameter
object instance
defined in the model. The Parameter
object in question must be a
constant ie it must have its 'constant' attribute value set to
'true'.
If a given Species
object definition does not specify a conversion
factor via the 'conversionFactor' attribute on Species
, then the species
inherits the conversion factor specified by the Model
'conversionFactor'
attribute. If the Model
does not define a value for this attribute,
then there is no conversion factor to inherit. More information about
conversion factors is provided in the SBML Level 3
specifications.
Constructor and Description |
---|
Model(long level,
long version)
|
Model(Model orig)
Copy constructor creates a (deep) copy of the given
Model object. |
Model(SBMLNamespaces sbmlns)
|
Modifier and Type | Method and Description |
---|---|
int |
addCompartment(Compartment c)
Adds a copy of the given
Compartment object to this Model . |
int |
addCompartmentType(CompartmentType ct)
Adds a copy of the given
CompartmentType object to this Model . |
int |
addConstraint(Constraint c)
Adds a copy of the given
Constraint object to this Model . |
int |
addEvent(Event e)
|
int |
addFunctionDefinition(FunctionDefinition fd)
Adds a copy of the given
FunctionDefinition object to this Model . |
int |
addInitialAssignment(InitialAssignment ia)
Adds a copy of the given
InitialAssignment object to this Model . |
int |
addParameter(Parameter p)
|
int |
addReaction(Reaction r)
|
int |
addRule(Rule r)
|
int |
addSpecies(Species s)
|
int |
addSpeciesType(SpeciesType st)
Adds a copy of the given
SpeciesType object to this Model . |
int |
addUnitDefinition(UnitDefinition ud)
Adds a copy of the given
UnitDefinition object to this Model . |
int |
appendAnnotation(java.lang.String annotation)
Appends annotation content to any existing content in the 'annotation'
subelement of this object.
|
int |
appendAnnotation(XMLNode annotation)
Appends annotation content to any existing content in the 'annotation'
subelement of this object.
|
int |
appendFrom(Model model)
|
void |
clearAllElementIdList()
Clears the internal list of the identifiers of all elements within this
Model object. |
void |
clearAllElementMetaIdList()
Clears the internal list of the metaids of all elements within this
Model object. |
Model |
cloneObject()
Creates and returns a deep copy of this
Model object. |
void |
connectToChild()   |
AlgebraicRule |
createAlgebraicRule()
Creates a new
AlgebraicRule inside this Model and returns it. |
AssignmentRule |
createAssignmentRule()
Creates a new
AssignmentRule inside this Model and returns it. |
Compartment |
createCompartment()
Creates a new
Compartment inside this Model and returns it. |
CompartmentType |
createCompartmentType()
Creates a new
CompartmentType inside this Model and returns it. |
Constraint |
createConstraint()
Creates a new
Constraint inside this Model and returns it. |
Delay |
createDelay()
|
Event |
createEvent()
|
EventAssignment |
createEventAssignment()
Creates a new
EventAssignment inside the last Event object created in
this Model , and returns a pointer to it. |
FunctionDefinition |
createFunctionDefinition()
Creates a new
FunctionDefinition inside this Model and returns it. |
InitialAssignment |
createInitialAssignment()
Creates a new
InitialAssignment inside this Model and returns it. |
KineticLaw |
createKineticLaw()
Creates a new
KineticLaw inside the last Reaction object created in
this Model , and returns a pointer to it. |
LocalParameter |
createKineticLawLocalParameter()
Creates a new
LocalParameter inside the KineticLaw object of the last
Reaction created inside this Model , and returns a pointer to it. |
Parameter |
createKineticLawParameter()
Creates a new local
Parameter inside the KineticLaw object of the last
Reaction created inside this Model , and returns a pointer to it. |
ModifierSpeciesReference |
createModifier()
Creates a new
ModifierSpeciesReference object for a modifier species
inside the last Reaction object in this Model , and returns a pointer
to it. |
Parameter |
createParameter()
|
SpeciesReference |
createProduct()
Creates a new
SpeciesReference object for a product inside the last
Reaction object in this Model , and returns a pointer to it. |
RateRule |
createRateRule()
|
SpeciesReference |
createReactant()
Creates a new
SpeciesReference object for a reactant inside the last
Reaction object in this Model , and returns a pointer to it. |
Reaction |
createReaction()
|
Species |
createSpecies()
|
SpeciesType |
createSpeciesType()
Creates a new
SpeciesType inside this Model and returns it. |
Trigger |
createTrigger()
|
Unit |
createUnit()
Creates a new
Unit object within the last UnitDefinition object
created in this model and returns a pointer to it. |
UnitDefinition |
createUnitDefinition()
Creates a new
UnitDefinition inside this Model and returns it. |
void |
delete()
Explicitly deletes the underlying native object.
|
IdList |
getAllElementIdList()
Returns the internal list of the identifiers of all elements within this
Model object. |
IdList |
getAllElementMetaIdList()
Returns the internal list of the metaids of all elements within this
Model object. |
java.lang.String |
getAreaUnits()
Returns the value of the 'areaUnits' attribute of this
Model . |
AssignmentRule |
getAssignmentRule(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
AssignmentRule |
getAssignmentRuleByVariable(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
Compartment |
getCompartment(long n)
Get the nth
Compartment object in this Model . |
Compartment |
getCompartment(java.lang.String sid)
Get a
Compartment object based on its identifier. |
CompartmentType |
getCompartmentType(long n)
Get the nth
CompartmentType object in this Model . |
CompartmentType |
getCompartmentType(java.lang.String sid)
Get a
CompartmentType object based on its identifier. |
Constraint |
getConstraint(long n)
Get the nth
Constraint object in this Model . |
java.lang.String |
getConversionFactor()
Returns the value of the 'conversionFactor' attribute of this
Model . |
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element it can find with the given
metaid . |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element found that has the given
id . |
java.lang.String |
getElementName()
Returns the XML element name of this object, which for
Model , is
always 'model'. |
Event |
getEvent(long n)
|
Event |
getEvent(java.lang.String sid)
Get an
Event object based on its identifier. |
java.lang.String |
getExtentUnits()
Returns the value of the 'extentUnits' attribute of this
Model . |
FunctionDefinition |
getFunctionDefinition(long n)
Get the nth FunctionDefinitions object in this
Model . |
FunctionDefinition |
getFunctionDefinition(java.lang.String sid)
Get a
FunctionDefinition object based on its identifier. |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Model . |
InitialAssignment |
getInitialAssignment(long n)
Get the nth
InitialAssignment object in this Model . |
InitialAssignment |
getInitialAssignment(java.lang.String symbol)
Get an
InitialAssignment object based on the symbol to which it
assigns a value. |
InitialAssignment |
getInitialAssignmentBySymbol(java.lang.String symbol)
Get an
InitialAssignment object based on the symbol to which it
assigns a value. |
java.lang.String |
getLengthUnits()
Returns the value of the 'lengthUnits' attribute of this
Model . |
ListOfCompartments |
getListOfCompartments()
Get the
ListOfCompartments object in this Model . |
ListOfCompartmentTypes |
getListOfCompartmentTypes()
Get the
ListOfCompartmentTypes object in this Model . |
ListOfConstraints |
getListOfConstraints()
Get the
ListOfConstraints object in this Model . |
ListOfEvents |
getListOfEvents()
Get the
ListOfEvents object in this Model . |
ListOfFunctionDefinitions |
getListOfFunctionDefinitions()
Get the
ListOfFunctionDefinitions object in this Model . |
ListOfInitialAssignments |
getListOfInitialAssignments()
Get the
ListOfInitialAssignments object in this Model . |
ListOfParameters |
getListOfParameters()
Get the
ListOfParameters object in this Model . |
ListOfReactions |
getListOfReactions()
Get the
ListOfReactions object in this Model . |
ListOfRules |
getListOfRules()
Get the
ListOfRules object in this Model . |
ListOfSpecies |
getListOfSpecies()
Get the
ListOfSpecies object in this Model . |
ListOfSpeciesTypes |
getListOfSpeciesTypes()
Get the
ListOfSpeciesTypes object in this Model . |
ListOfUnitDefinitions |
getListOfUnitDefinitions()
Get the
ListOfUnitDefinitions object in this Model . |
ModifierSpeciesReference |
getModifierSpeciesReference(java.lang.String sid)
Get a
ModifierSpeciesReference object based on its identifier. |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Model object. |
long |
getNumCompartments()
Get the number of
Compartment objects in this Model . |
long |
getNumCompartmentTypes()
Get the number of
CompartmentType objects in this Model . |
long |
getNumConstraints()
Get the number of
Constraint objects in this Model . |
long |
getNumEvents()
|
long |
getNumFunctionDefinitions()
Get the number of
FunctionDefinition objects in this Model . |
long |
getNumInitialAssignments()
Get the number of
InitialAssignment objects in this Model . |
long |
getNumParameters()
|
long |
getNumReactions()
|
long |
getNumRules()
|
long |
getNumSpecies()
|
long |
getNumSpeciesTypes()
Get the number of
SpeciesType objects in this Model . |
long |
getNumSpeciesWithBoundaryCondition()
|
long |
getNumUnitDefinitions()
Get the number of
UnitDefinition objects in this Model . |
Parameter |
getParameter(long n)
|
Parameter |
getParameter(java.lang.String sid)
Get a
Parameter object based on its identifier. |
RateRule |
getRateRule(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
RateRule |
getRateRuleByVariable(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
Reaction |
getReaction(long n)
|
Reaction |
getReaction(java.lang.String sid)
Get a
Reaction object based on its identifier. |
Rule |
getRule(long n)
|
Rule |
getRule(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
Rule |
getRuleByVariable(java.lang.String variable)
Get a
Rule object based on the variable to which it assigns a value. |
Species |
getSpecies(long n)
|
Species |
getSpecies(java.lang.String sid)
Get a
Species object based on its identifier. |
SpeciesReference |
getSpeciesReference(java.lang.String sid)
Get a
SpeciesReference object based on its identifier. |
SpeciesType |
getSpeciesType(long n)
Get the nth
SpeciesType object in this Model . |
SpeciesType |
getSpeciesType(java.lang.String sid)
Get a
SpeciesType object based on its identifier. |
java.lang.String |
getSubstanceUnits()
Returns the value of the 'substanceUnits' attribute of this
Model . |
java.lang.String |
getTimeUnits()
Returns the value of the 'timeUnits' attribute of this
Model . |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
UnitDefinition |
getUnitDefinition(long n)
Get the nth
UnitDefinition object in this Model . |
UnitDefinition |
getUnitDefinition(java.lang.String sid)
Get a
UnitDefinition based on its identifier. |
java.lang.String |
getVolumeUnits()
Returns the value of the 'volumeUnits' attribute of this
Model . |
boolean |
hasRequiredElements()
Predicate returning
true if all the required elements for this Model
object have been set. |
boolean |
isPopulatedAllElementIdList()
Predicate returning
true if libSBML has a list of the ids of all
components of this model. |
boolean |
isPopulatedAllElementMetaIdList()
Predicate returning
true if libSBML has a list of the metaids of all
components of this model. |
boolean |
isPopulatedListFormulaUnitsData()
Predicate returning
true if libSBML has derived units for the
components of this model. |
boolean |
isSetAreaUnits()
Predicate returning
true if this
Model 's 'areaUnits' attribute is set. |
boolean |
isSetConversionFactor()
Predicate returning
true if this
Model 's 'conversionFactor' attribute is set. |
boolean |
isSetExtentUnits()
Predicate returning
true if this
Model 's 'extentUnits' attribute is set. |
boolean |
isSetId()
Predicate returning
true if this
Model 's 'id' attribute is set. |
boolean |
isSetLengthUnits()
Predicate returning
true if this
Model 's 'lengthUnits' attribute is set. |
boolean |
isSetName()
Predicate returning
true if this
Model 's 'name' attribute is set. |
boolean |
isSetSubstanceUnits()
Predicate returning
true if this
Model 's 'substanceUnits' attribute is set. |
boolean |
isSetTimeUnits()
Predicate returning
true if this
Model 's 'timeUnits' attribute is set. |
boolean |
isSetVolumeUnits()
Predicate returning
true if this
Model 's 'volumeUnits' attribute is set. |
void |
populateAllElementIdList()
Populates the internal list of the identifiers of all elements within this
Model object. |
void |
populateAllElementMetaIdList()
Populates the internal list of the metaids of all elements within this
Model object. |
void |
populateListFormulaUnitsData()
Populates the internal list of derived units for this
Model object. |
Compartment |
removeCompartment(long n)
Removes the nth
Compartment object from this Model object and
returns a pointer to it. |
Compartment |
removeCompartment(java.lang.String sid)
Removes the
Compartment object with the given identifier from this Model
object and returns a pointer to it. |
CompartmentType |
removeCompartmentType(long n)
Removes the nth
CompartmentType object from this Model object and
returns a pointer to it. |
CompartmentType |
removeCompartmentType(java.lang.String sid)
Removes the
CompartmentType object with the given identifier from this Model
object and returns a pointer to it. |
Constraint |
removeConstraint(long n)
Removes the nth
Constraint object from this Model object and
returns a pointer to it. |
Event |
removeEvent(long n)
|
Event |
removeEvent(java.lang.String sid)
|
int |
removeFromParentAndDelete()
Remove this
Model from its parent SBMLDocument object. |
FunctionDefinition |
removeFunctionDefinition(long n)
Removes the nth
FunctionDefinition object from this Model object and
returns a pointer to it. |
FunctionDefinition |
removeFunctionDefinition(java.lang.String sid)
Removes the
FunctionDefinition object with the given identifier from this Model
object and returns a pointer to it. |
InitialAssignment |
removeInitialAssignment(long n)
Removes the nth
InitialAssignment object from this Model object and
returns a pointer to it. |
InitialAssignment |
removeInitialAssignment(java.lang.String symbol)
Removes the
InitialAssignment object with the given 'symbol' attribute
from this Model object and returns a pointer to it. |
Parameter |
removeParameter(long n)
|
Parameter |
removeParameter(java.lang.String sid)
|
Reaction |
removeReaction(long n)
|
Reaction |
removeReaction(java.lang.String sid)
|
Rule |
removeRule(long n)
|
Rule |
removeRule(java.lang.String variable)
|
Rule |
removeRuleByVariable(java.lang.String variable)
|
Species |
removeSpecies(long n)
|
Species |
removeSpecies(java.lang.String sid)
|
SpeciesType |
removeSpeciesType(long n)
Removes the nth
SpeciesType object from this Model object and
returns a pointer to it. |
SpeciesType |
removeSpeciesType(java.lang.String sid)
Removes the
SpeciesType object with the given identifier from this Model
object and returns a pointer to it. |
UnitDefinition |
removeUnitDefinition(long n)
Removes the nth
UnitDefinition object from this Model object and
returns a pointer to it. |
UnitDefinition |
removeUnitDefinition(java.lang.String sid)
Removes the
UnitDefinition object with the given identifier from this Model
object and returns a pointer to it. |
void |
renameIDs(SBaseList elements,
IdentifierTransformer idTransformer)   |
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Replaces all uses of a given
SIdRef type attribute value with another
value. |
void |
renameUnitSIdRefs(java.lang.String oldid,
java.lang.String newid)
Replaces all uses of a given
UnitSIdRef type attribute value with
another value. |
int |
setAnnotation(java.lang.String annotation)
Sets the value of the 'annotation' subelement of this SBML object to a
copy of
annotation . |
int |
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object to a
copy of
annotation . |
int |
setAreaUnits(java.lang.String units)
Sets the value of the 'areaUnits' attribute of this
Model . |
int |
setConversionFactor(java.lang.String units)
Sets the value of the 'conversionFactor' attribute of this
Model . |
int |
setExtentUnits(java.lang.String units)
Sets the value of the 'extentUnits' attribute of this
Model . |
int |
setId(java.lang.String sid)
Sets the value of the 'id' attribute of this
Model . |
int |
setLengthUnits(java.lang.String units)
Sets the value of the 'lengthUnits' attribute of this
Model . |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Model . |
int |
setSubstanceUnits(java.lang.String units)
Sets the value of the 'substanceUnits' attribute of this
Model . |
int |
setTimeUnits(java.lang.String units)
Sets the value of the 'timeUnits' attribute of this
Model . |
int |
setVolumeUnits(java.lang.String units)
Sets the value of the 'volumeUnits' attribute of this
Model . |
int |
unsetAreaUnits()
Unsets the value of the 'areaUnits' attribute of this
Model . |
int |
unsetConversionFactor()
Unsets the value of the 'conversionFactor' attribute of this
Model . |
int |
unsetExtentUnits()
Unsets the value of the 'extentUnits' attribute of this
Model . |
int |
unsetId()
Unsets the value of the 'id' attribute of this
Model . |
int |
unsetLengthUnits()
Unsets the value of the 'lengthUnits' attribute of this
Model . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Model . |
int |
unsetSubstanceUnits()
Unsets the value of the 'substanceUnits' attribute of this
Model . |
int |
unsetTimeUnits()
Unsets the value of the 'timeUnits' attribute of this
Model . |
int |
unsetVolumeUnits()
Unsets the value of the 'volumeUnits' attribute of this
Model . |
addCVTerm, addCVTerm, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public Model(long level, long version) throws SBMLConstructorException
level
- a long integer, the SBML Level to assign to this Model
.
version
- a long integer, the SBML Version to assign to this
Model
.
SBMLConstructorException
- Thrown if the given level
and version
combination are invalid
or if this object is incompatible with the given level and version.
SBMLDocument
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
), 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.public Model(SBMLNamespaces sbmlns) throws SBMLConstructorException
Model
using the given SBMLNamespaces
object
sbmlns
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and (in
Level 3) packages used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
sbmlns
- an SBMLNamespaces
object.
SBMLConstructorException
- Thrown if the given sbmlns
is inconsistent or incompatible
with this object.
SBMLDocument
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
), 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.public Model(Model orig) throws SBMLConstructorException
Model
object.
orig
- the object 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 Model.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 Model.delete()
themselves.
public Model cloneObject()
Model
object.
cloneObject
 in class SBase
Model
object.public SBase getElementBySId(java.lang.String id)
id
.
This operation searches the model-wide SId
identifier
type namespace
getElementBySId
 in class SBase
id
- string representing the id of the object to find.
id
, or
null
if no such object is found.public SBase getElementByMetaId(java.lang.String metaid)
metaid
.
getElementByMetaId
 in class SBase
metaid
- string representing the meta-identifier of the object to
find.
metaid
, or
null if no such object is found.public java.lang.String getId()
Model
.
getId
 in class SBase
Model
.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public java.lang.String getName()
Model
object.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
getName
 in class SBase
SBase.getIdAttribute()
,
Model.isSetName()
,
Model.setName(String sid)
,
Model.unsetName()
public java.lang.String getSubstanceUnits()
Model
.
public java.lang.String getTimeUnits()
Model
.
public java.lang.String getVolumeUnits()
Model
.
public java.lang.String getAreaUnits()
Model
.
public java.lang.String getLengthUnits()
Model
.
public java.lang.String getExtentUnits()
Model
.
public java.lang.String getConversionFactor()
Model
.
public boolean isSetId()
isSetId
 in class SBase
true
if the 'id' attribute of this SBML object is
set, false
otherwise.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.unsetIdAttribute()
,
SBase.isSetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public boolean isSetName()
true
if this
Model
's 'name' attribute is set.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
isSetName
 in class SBase
true
if the 'name' attribute of this SBML object is
set, false
otherwise.
Model.getName()
,
Model.setName(String sid)
,
Model.unsetName()
public boolean isSetSubstanceUnits()
true
if this
Model
's 'substanceUnits' attribute is set.
public boolean isSetTimeUnits()
true
if this
Model
's 'timeUnits' attribute is set.
public boolean isSetVolumeUnits()
true
if this
Model
's 'volumeUnits' attribute is set.
public boolean isSetAreaUnits()
true
if this
Model
's 'areaUnits' attribute is set.
public boolean isSetLengthUnits()
true
if this
Model
's 'lengthUnits' attribute is set.
public boolean isSetExtentUnits()
true
if this
Model
's 'extentUnits' attribute is set.
public boolean isSetConversionFactor()
true
if this
Model
's 'conversionFactor' attribute is set.
public int setId(java.lang.String sid)
Model
.
The string sid
is copied.
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
setId
 in class SBase
sid
- the string to use as the identifier of this object.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
public int setName(java.lang.String name)
public int setSubstanceUnits(java.lang.String units)
Model
.
The string in units
is copied.
units
- the new substanceUnits for the Model
.
Model
in lower Levels of SBML.public int setTimeUnits(java.lang.String units)
Model
.
The string in units
is copied.
public int setVolumeUnits(java.lang.String units)
Model
.
The string in units
is copied.
public int setAreaUnits(java.lang.String units)
Model
.
The string in units
is copied.
public int setLengthUnits(java.lang.String units)
Model
.
The string in units
is copied.
public int setExtentUnits(java.lang.String units)
Model
.
The string in units
is copied.
public int setConversionFactor(java.lang.String units)
Model
.
The string in units
is copied.
units
- the new conversionFactor for the Model
.
Model
in lower Levels of SBML.public int unsetId()
Model
.
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
unsetId
 in class SBase
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
public int unsetName()
Model
.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
unsetName
 in class SBase
Model.getName()
,
Model.setName(String sid)
,
Model.isSetName()
public int unsetSubstanceUnits()
Model
.
Model
in lower Levels of SBML.public int unsetTimeUnits()
Model
.
Model
in lower Levels of SBML.public int unsetVolumeUnits()
Model
.
Model
in lower Levels of SBML.public int unsetAreaUnits()
Model
.
Model
in lower Levels of SBML.public int unsetLengthUnits()
Model
.
Model
in lower Levels of SBML.public int unsetExtentUnits()
Model
.
Model
in lower Levels of SBML.public int unsetConversionFactor()
Model
.
Model
in lower Levels of SBML.public int addFunctionDefinition(FunctionDefinition fd)
FunctionDefinition
object to this Model
.
fd
- the FunctionDefinition
to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createFunctionDefinition()
create
)
for alternatives that do not lead to these issues.
public int addUnitDefinition(UnitDefinition ud)
UnitDefinition
object to this Model
.
ud
- the UnitDefinition
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createUnitDefinition()
create
)
for alternatives that do not lead to these issues.
public int addCompartmentType(CompartmentType ct)
CompartmentType
object to this Model
.
ct
- the CompartmentType
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createCompartmentType()
create
)
for alternatives that do not lead to these issues.
, The CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.
public int addSpeciesType(SpeciesType st)
SpeciesType
object to this Model
.
st
- the SpeciesType
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createSpeciesType()
create
)
for alternatives that do not lead to these issues.
, The SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.
public int addCompartment(Compartment c)
Compartment
object to this Model
.
c
- the Compartment
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createCompartment()
create
)
for alternatives that do not lead to these issues.
public int addSpecies(Species s)
s
- the Species
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createSpecies()
create
)
for alternatives that do not lead to these issues.
public int addParameter(Parameter p)
p
- the Parameter
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createParameter()
create
)
for alternatives that do not lead to these issues.
public int addInitialAssignment(InitialAssignment ia)
InitialAssignment
object to this Model
.
ia
- the InitialAssignment
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createInitialAssignment()
create
)
for alternatives that do not lead to these issues.
public int addRule(Rule r)
r
- the Rule
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createAlgebraicRule()
,
Model.createAssignmentRule()
,
Model.createRateRule()
create
)
for alternatives that do not lead to these issues.
public int addConstraint(Constraint c)
Constraint
object to this Model
.
c
- the Constraint
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createConstraint()
create
)
for alternatives that do not lead to these issues.
public int addReaction(Reaction r)
r
- the Reaction
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createReaction()
create
)
for alternatives that do not lead to these issues.
public int addEvent(Event e)
e
- the Event
object to add.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Model.createEvent()
create
)
for alternatives that do not lead to these issues.
public FunctionDefinition createFunctionDefinition()
FunctionDefinition
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
FunctionDefinition
object created.
Model.addFunctionDefinition(FunctionDefinition fd)
public UnitDefinition createUnitDefinition()
UnitDefinition
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
UnitDefinition
object created.
Model.addUnitDefinition(UnitDefinition ud)
public Unit createUnit()
Unit
object within the last UnitDefinition
object
created in this model and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the UnitDefinition
was created is not
significant. If a UnitDefinition
object does not exist in this model,
a new Unit
is not created and null
is returned instead.
Unit
object created.
Model.addUnitDefinition(UnitDefinition ud)
public CompartmentType createCompartmentType()
CompartmentType
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
CompartmentType
object created.
Model.addCompartmentType(CompartmentType ct)
CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.
public SpeciesType createSpeciesType()
SpeciesType
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
SpeciesType
object created.
Model.addSpeciesType(SpeciesType st)
SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.
public Compartment createCompartment()
Compartment
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Compartment
object created.
Model.addCompartment(Compartment c)
public Species createSpecies()
Species
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Species
object created.
Model.addSpecies(Species s)
public Parameter createParameter()
Parameter
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Parameter
object created.
Model.addParameter(Parameter p)
public InitialAssignment createInitialAssignment()
InitialAssignment
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
InitialAssignment
object created.
Model.addInitialAssignment(InitialAssignment ia)
public AlgebraicRule createAlgebraicRule()
AlgebraicRule
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
AlgebraicRule
object created.
Model.addRule(Rule r)
public AssignmentRule createAssignmentRule()
AssignmentRule
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
AssignmentRule
object created.
Model.addRule(Rule r)
public RateRule createRateRule()
RateRule
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
RateRule
object created.
Model.addRule(Rule r)
public Constraint createConstraint()
Constraint
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Constraint
object created.
Model.addConstraint(Constraint c)
public Reaction createReaction()
Reaction
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Reaction
object created.
Model.addReaction(Reaction r)
public SpeciesReference createReactant()
SpeciesReference
object for a reactant inside the last
Reaction
object in this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction
object was created and added
to this Model
is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference
is not
created and null
is returned instead.
SpeciesReference
object created. If a Reaction
does not
exist for this model, a new SpeciesReference
is not created and
null
is returned.public SpeciesReference createProduct()
SpeciesReference
object for a product inside the last
Reaction
object in this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction
object was created and added
to this Model
is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference
is not
created and null
is returned instead.
SpeciesReference
object created. If a Reaction
does not
exist for this model, a new SpeciesReference
is not created and
null
is returned.public ModifierSpeciesReference createModifier()
ModifierSpeciesReference
object for a modifier species
inside the last Reaction
object in this Model
, and returns a pointer
to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction
object was created and added
to this Model
is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference
is not
created and null
is returned instead.
SpeciesReference
object created. If a Reaction
does not
exist for this model, a new SpeciesReference
is not created and
null
is returned.public KineticLaw createKineticLaw()
KineticLaw
inside the last Reaction
object created in
this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Reaction
object was created and added
to this Model
is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference
is not
created and null
is returned instead.
KineticLaw
object created. If a Reaction
does not exist for
this model, or a Reaction
does exist but already has a KineticLaw
, a new
KineticLaw
is not created and null
is returned.public Parameter createKineticLawParameter()
Parameter
inside the KineticLaw
object of the last
Reaction
created inside this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The last KineticLaw
object in this Model
could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw()
on the Reaction
object created by a
createReaction(). If a Reaction
does not exist for this model, or the
last Reaction
does not contain a KineticLaw
object, a new Parameter
is
not created and null
is returned instead.
Parameter
object created. If a Reaction
does not exist for
this model, or a KineticLaw
for the Reaction
does not exist, a new
Parameter
is not created and null
is returned.public LocalParameter createKineticLawLocalParameter()
LocalParameter
inside the KineticLaw
object of the last
Reaction
created inside this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The last KineticLaw
object in this Model
could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw()
on the Reaction
object created by a
createReaction(). If a Reaction
does not exist for this model, or the
last Reaction
does not contain a KineticLaw
object, a new Parameter
is
not created and null
is returned instead.
Parameter
object created. If a Reaction
does not exist for
this model, or a KineticLaw
for the Reaction
does not exist, a new
Parameter
is not created and null
is returned.public Event createEvent()
Event
inside this Model
and returns it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
Event
object created.public EventAssignment createEventAssignment()
EventAssignment
inside the last Event
object created in
this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event
object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event
object exists in this
Model
object, a new EventAssignment
is not created and null
is
returned instead.
EventAssignment
object created.public Trigger createTrigger()
Trigger
inside the last Event
object created in
this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event
object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event
object exists in this
Model
object, a new EventAssignment
is not created and null
is
returned instead.
Trigger
object created.public Delay createDelay()
Delay
inside the last Event
object created in
this Model
, and returns a pointer to it.
The SBML Level and Version of the enclosing Model
object, as well as
any SBML package namespaces, are used to initialize this
object's corresponding attributes.
The mechanism by which the last Event
object in this model was created
is not significant. It could have been created in a variety of ways,
for example by using createEvent(). If no Event
object exists in this
Model
object, a new EventAssignment
is not created and null
is
returned instead.
Delay
object created.public int setAnnotation(XMLNode annotation)
annotation
.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the annotation
that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
setAnnotation
 in class SBase
annotation
- an XML structure that is to be used as the content
of the 'annotation' subelement of this object.
Model.appendAnnotation(XMLNode annotation)
public int setAnnotation(java.lang.String annotation)
annotation
.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the annotation
that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
setAnnotation
 in class SBase
annotation
- an XML string that is to be used as the content
of the 'annotation' subelement of this object.
Model.appendAnnotation(String annotation)
public int appendAnnotation(XMLNode annotation)
The content in annotation
is copied. Unlike setAnnotation(), this
method allows other annotations to be preserved when an application
adds its own data.
appendAnnotation
 in class SBase
annotation
- an XML structure that is to be copied and appended
to the content of the 'annotation' subelement of this object.
Model.setAnnotation(XMLNode annotation)
public int appendAnnotation(java.lang.String annotation)
The content in annotation
is copied. Unlike setAnnotation(), this
method allows other annotations to be preserved when an application
adds its own data.
appendAnnotation
 in class SBase
annotation
- an XML string that is to be copied and appended
to the content of the 'annotation' subelement of this object.
Model.setAnnotation(String annotation)
public ListOfFunctionDefinitions getListOfFunctionDefinitions()
ListOfFunctionDefinitions
object in this Model
.
Model
.public ListOfUnitDefinitions getListOfUnitDefinitions()
ListOfUnitDefinitions
object in this Model
.
Model
.public ListOfCompartmentTypes getListOfCompartmentTypes()
ListOfCompartmentTypes
object in this Model
.
Model
.
CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public ListOfSpeciesTypes getListOfSpeciesTypes()
ListOfSpeciesTypes
object in this Model
.
Model
.
SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public ListOfCompartments getListOfCompartments()
ListOfCompartments
object in this Model
.
Model
.public ListOfSpecies getListOfSpecies()
ListOfSpecies
object in this Model
.
public ListOfParameters getListOfParameters()
ListOfParameters
object in this Model
.
Model
.public ListOfInitialAssignments getListOfInitialAssignments()
ListOfInitialAssignments
object in this Model
.
Model
.public ListOfRules getListOfRules()
ListOfRules
object in this Model
.
Model
.public ListOfConstraints getListOfConstraints()
ListOfConstraints
object in this Model
.
Model
.public ListOfReactions getListOfReactions()
ListOfReactions
object in this Model
.
Model
.public ListOfEvents getListOfEvents()
ListOfEvents
object in this Model
.
Model
.public FunctionDefinition getFunctionDefinition(long n)
Model
.
n
- the index of the object to return.
FunctionDefinition
of this Model
.public FunctionDefinition getFunctionDefinition(java.lang.String sid)
FunctionDefinition
object based on its identifier.
sid
- the identifier to search for.
FunctionDefinition
in this Model
with the identifier
sid
or null
if no such FunctionDefinition
exists.public UnitDefinition getUnitDefinition(long n)
UnitDefinition
object in this Model
.
n
- the index of the object to return.
UnitDefinition
of this Model
.public UnitDefinition getUnitDefinition(java.lang.String sid)
UnitDefinition
based on its identifier.
sid
- the identifier to search for.
UnitDefinition
in this Model
with the identifier sid
or
null
if no such UnitDefinition
exists.public CompartmentType getCompartmentType(long n)
CompartmentType
object in this Model
.
n
- the index of the object to return.
CompartmentType
of this Model
.
CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public CompartmentType getCompartmentType(java.lang.String sid)
CompartmentType
object based on its identifier.
sid
- the identifier to search for.
CompartmentType
in this Model
with the identifier sid
or null
if no such CompartmentType
exists.
CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public SpeciesType getSpeciesType(long n)
SpeciesType
object in this Model
.
n
- the index of the object to return.
SpeciesType
of this Model
.
SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public SpeciesType getSpeciesType(java.lang.String sid)
SpeciesType
object based on its identifier.
sid
- the identifier to search for.
SpeciesType
in this Model
with the identifier sid
or
null
if no such SpeciesType
exists.
SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public Compartment getCompartment(long n)
Compartment
object in this Model
.
n
- the index of the object to return.
Compartment
of this Model
.public Compartment getCompartment(java.lang.String sid)
Compartment
object based on its identifier.
sid
- the identifier to search for.
Compartment
in this Model
with the identifier sid
or
null
if no such Compartment
exists.public Species getSpecies(long n)
public Species getSpecies(java.lang.String sid)
Species
object based on its identifier.
public Parameter getParameter(long n)
public Parameter getParameter(java.lang.String sid)
Parameter
object based on its identifier.
public InitialAssignment getInitialAssignment(long n)
InitialAssignment
object in this Model
.
n
- the index of the object to return.
InitialAssignment
of this Model
.public InitialAssignment getInitialAssignment(java.lang.String symbol)
InitialAssignment
object based on the symbol to which it
assigns a value.
symbol
- the symbol to search for.
InitialAssignment
in this Model
with the given 'symbol'
attribute value or null
if no such InitialAssignment
exists.public InitialAssignment getInitialAssignmentBySymbol(java.lang.String symbol)
InitialAssignment
object based on the symbol to which it
assigns a value.
symbol
- the symbol to search for.
InitialAssignment
in this Model
with the given 'symbol'
attribute value or null
if no such InitialAssignment
exists.public Rule getRule(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public Rule getRuleByVariable(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public AssignmentRule getAssignmentRule(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public RateRule getRateRule(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public AssignmentRule getAssignmentRuleByVariable(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public RateRule getRateRuleByVariable(java.lang.String variable)
Rule
object based on the variable to which it assigns a value.
public Constraint getConstraint(long n)
Constraint
object in this Model
.
n
- the index of the object to return.
Constraint
of this Model
.public Reaction getReaction(long n)
public Reaction getReaction(java.lang.String sid)
Reaction
object based on its identifier.
public SpeciesReference getSpeciesReference(java.lang.String sid)
SpeciesReference
object based on its identifier.
sid
- the identifier to search for.
SpeciesReference
in this Model
with the identifier sid
or null
if no such SpeciesReference
exists.public ModifierSpeciesReference getModifierSpeciesReference(java.lang.String sid)
ModifierSpeciesReference
object based on its identifier.
sid
- the identifier to search for.
ModifierSpeciesReference
in this Model
with the
identifier sid
or null
if no such ModifierSpeciesReference
exists.public Event getEvent(java.lang.String sid)
Event
object based on its identifier.
public long getNumFunctionDefinitions()
FunctionDefinition
objects in this Model
.
Model
.public long getNumUnitDefinitions()
UnitDefinition
objects in this Model
.
Model
.public long getNumCompartmentTypes()
CompartmentType
objects in this Model
.
Model
.
CompartmentType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public long getNumSpeciesTypes()
SpeciesType
objects in this Model
.
Model
.
SpeciesType
object class is only available in SBML
Level 2 Versions 2&ndash4. It is not available in
Level 1 nor Level 3.public long getNumCompartments()
Compartment
objects in this Model
.
Model
.public long getNumSpecies()
public long getNumSpeciesWithBoundaryCondition()
public long getNumParameters()
Model
. Parameters defined in
KineticLaws are not included.public long getNumInitialAssignments()
InitialAssignment
objects in this Model
.
Model
.public long getNumRules()
Model
.public long getNumConstraints()
Constraint
objects in this Model
.
Model
.public long getNumReactions()
Model
.public long getNumEvents()
Model
.public int removeFromParentAndDelete()
Model
from its parent SBMLDocument
object.
This works by finding this Model
's parent SBMLDocument
and then calling
setModel(null)
on it, indirectly deleting itself.
Overridden from the SBase
function since the parent is not a ListOf
.
removeFromParentAndDelete
 in class SBase
public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
Replaces all uses of a given SIdRef
type attribute value with another
value.
In SBML, object identifiers are of a data type called SId
.
In SBML Level 3, an explicit data type called SIdRef
was
introduced for attribute values that refer to SId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to an identifier', but the effective
data type was the same as SIdRef
in Level 3. These and
other methods of libSBML refer to the type SIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of oldid
. If any matches are found, the
matching values are replaced with newid
. The method does not
descend into child elements.
renameSIdRefs
 in class SBase
oldid
- the old identifier.newid
- the new identifier.public void renameUnitSIdRefs(java.lang.String oldid, java.lang.String newid)
Replaces all uses of a given UnitSIdRef
type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId
. In
SBML Level 3, an explicit data type called UnitSIdRef
was
introduced for attribute values that refer to UnitSId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef
in Level 3. These and
other methods of libSBML refer to the type UnitSIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing the
referenced unit identifiers to the value of oldid
. If any matches
are found, the matching values are replaced with newid
. The method
does not descend into child elements.
renameUnitSIdRefs
 in class SBase
oldid
- the old identifier.newid
- the new identifier.public void connectToChild()
connectToChild
 in class SBase
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
method on the object.
SBase.getPackageName()
getTypeCode
 in class SBase
SBML_MODEL
(default).
Model.getElementName()
,
SBase.getPackageName()
public java.lang.String getElementName()
Model
, is
always 'model'.
getElementName
 in class SBase
'model'.
public void populateListFormulaUnitsData()
Model
object.
This method tells libSBML to (re)calculate all units for all components
of the enclosing Model
object. The result is stored in an internal list
of unit data. Users can access the resulting data by calling the method
SBase.getDerivedUnitDefinition()
available on most objects. (The name
'formula units data' is drawn from the name of the internal objects
libSBML uses to store the data note that these internal objects are not
exposed to callers, because callers can interact with the results using
the ordinary SBML unit objects.)
This method is used by libSBML itself in the validator concerned with
unit consistency. The unit consistency validator (like all other
validators in libSBML) is invoked by using
SBMLDocument.checkConsistency()
, with the consistency checks for the
category LIBSBML_CAT_UNITS_CONSISTENCY
turned on. The method
populateListFormulaUnitsData() does not need to be called prior to
invoking the validator if unit consistency checking has not been turned
off. This method is only provided for cases when callers have a special
need to force the unit data to be recalculated. For instance, during
construction of a model, a caller may want to interrogate libSBML's
inferred units without invoking full-blown model validation this is a
scenario in which calling populateListFormulaUnitsData() may be useful.
Model.isPopulatedListFormulaUnitsData()
public boolean isPopulatedListFormulaUnitsData()
true
if libSBML has derived units for the
components of this model.
LibSBML can infer the units of measurement associated with different
elements of a model. When libSBML does that, it builds a complex
internal structure during a resource-intensive operation. This is done
automatically only when callers invoke validation (via
SBMLDocument.checkConsistency()
) and have not turned off the unit
validation option.
Callers can force units to be recalculated by calling populateListFormulaUnitsData(). To avoid calling that method unnecessarily, calling programs may first want to invoke this method (isPopulatedListFormulaUnitsData()) to determine whether it is even necessary.
true
if the units have already been computed, false
otherwise.public void populateAllElementIdList()
Model
object.
This method tells libSBML to retrieve the identifiers of all elements
of the enclosing Model
object. The result is stored in an internal list
of ids. Users can access the resulting data by calling the method
getAllElementIdList().
Model.isPopulatedAllElementIdList()
public boolean isPopulatedAllElementIdList()
true
if libSBML has a list of the ids of all
components of this model.
true
if the id list has already been populated, false
otherwise.public IdList getAllElementIdList()
Model
object.
Model.populateAllElementIdList()
,
Model.isPopulatedAllElementIdList()
public void clearAllElementIdList()
Model
object.
public void populateAllElementMetaIdList()
Model
object.
This method tells libSBML to retrieve the identifiers of all elements
of the enclosing Model
object. The result is stored in an internal list
of metaids. Users can access the resulting data by calling the method
getAllElementMetaIdList().
Model.isPopulatedAllElementMetaIdList()
public boolean isPopulatedAllElementMetaIdList()
true
if libSBML has a list of the metaids of all
components of this model.
true
if the metaid list has already been populated, false
otherwise.public IdList getAllElementMetaIdList()
Model
object.
Model.populateAllElementMetaIdList()
,
Model.isPopulatedAllElementMetaIdList()
public void clearAllElementMetaIdList()
Model
object.
public boolean hasRequiredElements()
true
if all the required elements for this Model
object have been set.
hasRequiredElements
 in class SBase
public FunctionDefinition removeFunctionDefinition(long n)
FunctionDefinition
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the FunctionDefinition
object to remove.
FunctionDefinition
object removed, or null
if the given
index is out of range.public FunctionDefinition removeFunctionDefinition(java.lang.String sid)
FunctionDefinition
object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
sid
- the identifier of the FunctionDefinition
object to remove.
FunctionDefinition
object removed, or null
if no
FunctionDefinition
object with the identifier exists in this Model
object.public UnitDefinition removeUnitDefinition(long n)
UnitDefinition
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the UnitDefinition
object to remove.
UnitDefinition
object removed., or null
if the given
index is out of range.public UnitDefinition removeUnitDefinition(java.lang.String sid)
UnitDefinition
object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
sid
- the identifier of the UnitDefinition
object to remove.
UnitDefinition
object removed, or null
if no
UnitDefinition
object with the identifier exists in this Model
object.public CompartmentType removeCompartmentType(long n)
CompartmentType
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the CompartmentType
object to remove.
null
if the given
index is out of range.public CompartmentType removeCompartmentType(java.lang.String sid)
CompartmentType
object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
sid
- the identifier of the object to remove.
CompartmentType
object removed, or null
if no
CompartmentType
object with the identifier exists in this Model
object.public SpeciesType removeSpeciesType(long n)
SpeciesType
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the SpeciesType
object to remove.
SpeciesType
object removed, or null
if the given index is
out of range.public SpeciesType removeSpeciesType(java.lang.String sid)
SpeciesType
object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
sid
- the identifier of the SpeciesType
object to remove.
SpeciesType
object removed, or null
if no SpeciesType
object with the identifier exists in this Model
object.public Compartment removeCompartment(long n)
Compartment
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the Compartment
object to remove.
Compartment
object removed, or null
if the given index is
out of range.public Compartment removeCompartment(java.lang.String sid)
Compartment
object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
sid
- the identifier of the Compartment
object to remove.
Compartment
object removed, or null
if no Compartment
object with the identifier exists in this Model
object.public Species removeSpecies(long n)
public Species removeSpecies(java.lang.String sid)
public Parameter removeParameter(long n)
public Parameter removeParameter(java.lang.String sid)
public InitialAssignment removeInitialAssignment(long n)
InitialAssignment
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the InitialAssignment
object to remove.
InitialAssignment
object removed, or null
if the given
index is out of range.public InitialAssignment removeInitialAssignment(java.lang.String symbol)
InitialAssignment
object with the given 'symbol' attribute
from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
symbol
- the 'symbol' attribute of the InitialAssignment
object to remove.
InitialAssignment
object removed, or null
if no
InitialAssignment
object with the 'symbol' attribute exists in this
Model
object.public Rule removeRule(long n)
public Rule removeRule(java.lang.String variable)
public Rule removeRuleByVariable(java.lang.String variable)
public Constraint removeConstraint(long n)
Constraint
object from this Model
object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
n
- the index of the Constraint
object to remove.
Constraint
object removed, or null
if the given index is
out of range.public Reaction removeReaction(long n)
public Reaction removeReaction(java.lang.String sid)
public Event removeEvent(long n)
public Event removeEvent(java.lang.String sid)
public int appendFrom(Model model)
Model
object's subcomponents and appends the copies to
the appropriate places in this Model
.
This method also calls the appendFrom
method on all libSBML
plug-in objects.
SBML Level 3 consists of a Core definition that can be extended via optional SBML Level 3 packages. A given model may indicate that it uses one or more SBML packages, and likewise, a software tool may be able to support one or more packages. LibSBML does not come preconfigured with all possible packages included and enabled, in part because not all package specifications have been finalized. To support the ability for software systems to enable support for the Level 3 packages they choose, libSBML features a plug-in mechanism. Each SBML Level 3 package is implemented in a separate code plug-in that can be enabled by the application to support working with that SBML package. A given SBML model may thus contain not only objects defined by SBML Level 3 Core, but also objects created by libSBML plug-ins supporting additional Level 3 packages.
model
- the Model
to merge with this one.public void renameIDs(SBaseList elements, IdentifierTransformer idTransformer)