libSBML
5.8.0

org.sbml.libsbml
Class Model

java.lang.Object
  extended by org.sbml.libsbml.SBase
      extended by org.sbml.libsbml.Model

public class Model
extends SBase

Implementation of SBML's Model construct.

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.8.0 of libSBML:

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 Version 1 Core, 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.

Approaches to creating objects using the libSBML API

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 an SBMLDocument object in Level 3 Version 1 format:

SBMLDocument sbmlDoc = new SBMLDocument(3, 1);

// Create a Model object inside the SBMLDocument object and set
// its identifier.  The call returns a pointer to the Model 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 a Species object inside the Model and set its identifier.
// Similar to the lines above, this call returns a pointer to the Species
// object created, and methods called on that object affect the attributes
// of the object attached to the model (as expected).  Note that, like
// with Model, 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 <listOfSpecies> list in the model. Subsequently, methods called on the species change the species in the model (which is what is expected in most situations).

Consistency and adherence to SBML specifications

To make it easier for applications to do whatever they need, libSBML version 5.8.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—even 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.

Model attributes introduced in SBML Level 3

As mentioned above, the Model class has a number of optional attributes in SBML Level 3 Version 1 Core. These are 'substanceUnits', 'timeUnits', 'volumeUnits', 'areaUnits', 'lengthUnits', 'extentUnits', and 'conversionFactor. The following provide more information about them.

The 'substanceUnits' attribute

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 Version 1 Core specification provides 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

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 'volumeUnits', 'areaUnits', and 'lengthUnits' attributes

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.

The 'extentUnits' attribute

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 'conversionFactor' attribute

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 Version 1 specification.


Constructor Summary
Model(long level, long version)
          Creates a new Model using the given SBML level and version values.
Model(Model orig)
          Copy constructor; creates a (deep) copy of the given Model object.
Model(SBMLNamespaces sbmlns)
          Creates a new Model using the given SBMLNamespaces object sbmlns.
 
Method Summary
 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)
          Adds a copy of the given Event object to this Model.
 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)
          Adds a copy of the given Parameter object to this Model.
 int addReaction(Reaction r)
          Adds a copy of the given Reaction object to this Model.
 int addRule(Rule r)
          Adds a copy of the given Rule object to this Model.
 int addSpecies(Species s)
          Adds a copy of the given Species object to this Model.
 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(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)
          Takes the contents of the passed-in Model, makes copies of everything, and appends those copies to the appropriate places in this Model.
 Model cloneObject()
          Creates and returns a deep copy of this Model object.
 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()
          Creates a new Delay inside the last Event object created in this Model, and returns a pointer to it.
 Event createEvent()
          Creates a new Event inside this Model and returns it.
 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()
          Creates a new Parameter inside this Model and returns it.
 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()
          Creates a new RateRule inside this Model and returns it.
 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()
          Creates a new Reaction inside this Model and returns it.
 Species createSpecies()
          Creates a new Species inside this Model and returns it.
 SpeciesType createSpeciesType()
          Creates a new SpeciesType inside this Model and returns it.
 Trigger createTrigger()
          Creates a new Trigger inside the last Event object created in this Model, and returns a pointer to it.
 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.
 String getAreaUnits()
          Returns the value of the 'areaUnits' attribute of this Model.
 Compartment getCompartment(long n)
          Get the nth Compartment object in this Model.
 Compartment getCompartment(String sid)
          Get a Compartment object based on its identifier.
 CompartmentType getCompartmentType(long n)
          Get the nth CompartmentType object in this Model.
 CompartmentType getCompartmentType(String sid)
          Get a CompartmentType object based on its identifier.
 Constraint getConstraint(long n)
          Get the nth Constraint object in this Model.
 String getConversionFactor()
          Returns the value of the 'conversionFactor' attribute of this Model.
 SBase getElementByMetaId(String metaid)
          Returns the first child element it can find with the given metaid, or null if no such object is found.
 SBase getElementBySId(String id)
          Returns the first child element found that has the given id in the model-wide SId namespace, or null if no such object is found.
 String getElementName()
          Returns the XML element name of this object, which for Model, is always 'model'.
 Event getEvent(long n)
          Get the nth Event object in this Model.
 Event getEvent(String sid)
          Get an Event object based on its identifier.
 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(String sid)
          Get a FunctionDefinition object based on its identifier.
 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(String symbol)
          Get an InitialAssignment object based on the symbol to which it assigns a value.
 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.
 String getName()
          Returns the value of the 'name' attribute of this Model.
 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()
          Get the number of Event objects in this Model.
 long getNumFunctionDefinitions()
          Get the number of FunctionDefinition objects in this Model.
 long getNumInitialAssignments()
          Get the number of InitialAssignment objects in this Model.
 long getNumParameters()
          Get the number of Parameter objects in this Model.
 long getNumReactions()
          Get the number of Reaction objects in this Model.
 long getNumRules()
          Get the number of Rule objects in this Model.
 long getNumSpecies()
          Get the number of Specie objects in this Model.
 long getNumSpeciesTypes()
          Get the number of SpeciesType objects in this Model.
 long getNumSpeciesWithBoundaryCondition()
          Get the number of Species in this Model having their 'boundaryCondition' attribute value set to true.
 long getNumUnitDefinitions()
          Get the number of UnitDefinition objects in this Model.
 Parameter getParameter(long n)
          Get the nth Parameter object in this Model.
 Parameter getParameter(String sid)
          Get a Parameter object based on its identifier.
 Reaction getReaction(long n)
          Get the nth Reaction object in this Model.
 Reaction getReaction(String sid)
          Get a Reaction object based on its identifier.
 Rule getRule(long n)
          Get the nth Rule object in this Model.
 Rule getRule(String variable)
          Get a Rule object based on the variable to which it assigns a value.
 Species getSpecies(long n)
          Get the nth Species object in this Model.
 Species getSpecies(String sid)
          Get a Species object based on its identifier.
 SpeciesReference getSpeciesReference(String sid)
          Get a SpeciesReference object based on its identifier.
 SpeciesType getSpeciesType(long n)
          Get the nth SpeciesType object in this Model.
 SpeciesType getSpeciesType(String sid)
          Get a SpeciesType object based on its identifier.
 String getSubstanceUnits()
          Returns the value of the 'substanceUnits' attribute of this Model.
 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(String sid)
          Get a UnitDefinition based on its identifier.
 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 isPopulatedListFormulaUnitsData()
          Predicate returning true if the list of FormulaUnitsData is populated.
 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 populateListFormulaUnitsData()
          Populates the list of FormulaDataUnits with the units derived for the model.
 Compartment removeCompartment(long n)
          Removes the nth Compartment object from this Model object and returns a pointer to it.
 Compartment removeCompartment(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(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)
          Removes the nth Event object from this Model object and returns a pointer to it.
 Event removeEvent(String sid)
          Removes the Event object with the given identifier from this Model object and returns a pointer to it.
 int removeFromParentAndDelete()
          Finds this Model's parent SBMLDocument and calls setModel(null) on it, indirectly deleting itself.
 FunctionDefinition removeFunctionDefinition(long n)
          Removes the nth FunctionDefinition object from this Model object and returns a pointer to it.
 FunctionDefinition removeFunctionDefinition(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(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)
          Removes the nth Parameter object from this Model object and returns a pointer to it.
 Parameter removeParameter(String sid)
          Removes the Parameter object with the given identifier from this Model object and returns a pointer to it.
 Reaction removeReaction(long n)
          Removes the nth Reaction object from this Model object and returns a pointer to it.
 Reaction removeReaction(String sid)
          Removes the Reaction object with the given identifier from this Model object and returns a pointer to it.
 Rule removeRule(long n)
          Removes the nth Rule object from this Model object and returns a pointer to it.
 Rule removeRule(String variable)
          Removes the Rule object with the given 'variable' attribute from this Model object and returns a pointer to it.
 Species removeSpecies(long n)
          Removes the nth Species object from this Model object and returns a pointer to it.
 Species removeSpecies(String sid)
          Removes the Species object with the given identifier from this Model object and returns a pointer to it.
 SpeciesType removeSpeciesType(long n)
          Removes the nth SpeciesType object from this Model object and returns a pointer to it.
 SpeciesType removeSpeciesType(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(String sid)
          Removes the UnitDefinition object with the given identifier from this Model object and returns a pointer to it.
 void renameSIdRefs(String oldid, String newid)
          Renames all the SIdRef attributes on this element, including any found in MathML
 void renameUnitSIdRefs(String oldid, String newid)
          Renames all the UnitSIdRef attributes on this element
 int setAnnotation(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(String units)
          Sets the value of the 'areaUnits' attribute of this Model.
 int setConversionFactor(String units)
          Sets the value of the 'conversionFactor' attribute of this Model.
 int setExtentUnits(String units)
          Sets the value of the 'extentUnits' attribute of this Model.
 int setId(String sid)
          Sets the value of the 'id' attribute of this Model.
 int setLengthUnits(String units)
          Sets the value of the 'lengthUnits' attribute of this Model.
 int setName(String name)
          Sets the value of the 'name' attribute of this Model.
 int setSubstanceUnits(String units)
          Sets the value of the 'substanceUnits' attribute of this Model.
 int setTimeUnits(String units)
          Sets the value of the 'timeUnits' attribute of this Model.
 int setVolumeUnits(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.
 
Methods inherited from class org.sbml.libsbml.SBase
addCVTerm, addCVTerm, appendNotes, appendNotes, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getLevel, getLine, getListOfAllElements, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model(long level,
             long version)
      throws SBMLConstructorException
Creates a new Model using the given SBML level and version values.

Parameters:
level - a long integer, the SBML Level to assign to this Model

version - a long integer, the SBML Version to assign to this Model

Throws:
SBMLConstructorException - Thrown if the given level and version combination, or this kind of SBML object, are either invalid or mismatched with respect to the parent SBMLDocument object.

Note:
Upon the addition of a Model object to an SBMLDocument (e.g., using SBMLDocument.setModel(Model m)), the SBML Level, SBML Version and XML namespace of the document override the values used when creating the Model object via this constructor. This is necessary to ensure that an SBML document is a consistent structure. Nevertheless, the ability to supply the values at the time of creation of a Model is an important aid to producing valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.

Model

public Model(SBMLNamespaces sbmlns)
      throws SBMLConstructorException
Creates a new 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 this class constructor is to create an SBMLNamespaces object somewhere in a program, once, then pass it to object constructors such as this one when needed.

Parameters:
sbmlns - an SBMLNamespaces object.

Throws:
SBMLConstructorException - Thrown if the given level and version combination, or this kind of SBML object, are either invalid or mismatched with respect to the parent SBMLDocument object.

Note:
Upon the addition of a Model object to an SBMLDocument (e.g., using SBMLDocument.setModel(Model m)), the SBML XML namespace of the document overrides the value used when creating the Model object via this constructor. This is necessary to ensure that an SBML document is a consistent structure. Nevertheless, the ability to supply the values at the time of creation of a Model is an important aid to producing valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.

Model

public Model(Model orig)
      throws SBMLConstructorException
Copy constructor; creates a (deep) copy of the given Model object.

Parameters:
orig - the object to copy.

Throws:
SBMLConstructorException - Thrown if the argument orig is null.
Method Detail

delete

public void delete()
Explicitly deletes the underlying native object.

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.

Overrides:
delete in class SBase

cloneObject

public Model cloneObject()
Creates and returns a deep copy of this Model object.

Overrides:
cloneObject in class SBase
Returns:
a (deep) copy of this Model.

getElementBySId

public SBase getElementBySId(String id)
Returns the first child element found that has the given id in the model-wide SId namespace, or null if no such object is found.

Overrides:
getElementBySId in class SBase
Parameters:
id - string representing the id of objects to find.

Returns:
pointer to the first element found with the given id.

getElementByMetaId

public SBase getElementByMetaId(String metaid)
Returns the first child element it can find with the given metaid, or null if no such object is found.

Overrides:
getElementByMetaId in class SBase
Parameters:
metaid - string representing the metaid of objects to find

Returns:
pointer to the first element found with the given metaid.

getId

public String getId()
Returns the value of the 'id' attribute of this Model.

Overrides:
getId in class SBase
Returns:
the id of this Model.
See Also:
SBase.isSetMetaId(), SBase.setMetaId(String metaid)

getName

public String getName()
Returns the value of the 'name' attribute of this Model.

Overrides:
getName in class SBase
Returns:
the name of this Model.
See Also:
SBase.isSetMetaId(), SBase.setMetaId(String metaid)

getSubstanceUnits

public String getSubstanceUnits()
Returns the value of the 'substanceUnits' attribute of this Model.

Returns:
the substanceUnits of this Model.

Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getTimeUnits

public String getTimeUnits()
Returns the value of the 'timeUnits' attribute of this Model.

Returns:
the timeUnits of this Model.

Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getVolumeUnits

public String getVolumeUnits()
Returns the value of the 'volumeUnits' attribute of this Model.

Returns:
the volumeUnits of this Model.

Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getAreaUnits

public String getAreaUnits()
Returns the value of the 'areaUnits' attribute of this Model.

Returns:
the areaUnits of this Model.

Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getLengthUnits

public String getLengthUnits()
Returns the value of the 'lengthUnits' attribute of this Model.

Returns:
the lengthUnits of this Model.

Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getExtentUnits

public String getExtentUnits()
Returns the value of the 'extentUnits' attribute of this Model.

Returns:
the extentUnits of this Model.

Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

getConversionFactor

public String getConversionFactor()
Returns the value of the 'conversionFactor' attribute of this Model.

Returns:
the conversionFactor of this Model.

Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetId

public boolean isSetId()
Predicate returning true if this Model's 'id' attribute is set.

Overrides:
isSetId in class SBase
Returns:
true if the 'id' attribute of this Model is set, false otherwise.
See Also:
SBase.getMetaId(), SBase.setMetaId(String metaid)

isSetName

public boolean isSetName()
Predicate returning true if this Model's 'name' attribute is set.

Overrides:
isSetName in class SBase
Returns:
true if the 'name' attribute of this Model is set, false otherwise.
See Also:
SBase.getMetaId(), SBase.setMetaId(String metaid)

isSetSubstanceUnits

public boolean isSetSubstanceUnits()
Predicate returning true if this Model's 'substanceUnits' attribute is set.

Returns:
true if the 'substanceUnits' attribute of this Model is set, false otherwise.

Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetTimeUnits

public boolean isSetTimeUnits()
Predicate returning true if this Model's 'timeUnits' attribute is set.

Returns:
true if the 'timeUnits' attribute of this Model is set, false otherwise.

Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetVolumeUnits

public boolean isSetVolumeUnits()
Predicate returning true if this Model's 'volumeUnits' attribute is set.

Returns:
true if the 'volumeUnits' attribute of this Model is set, false otherwise.

Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetAreaUnits

public boolean isSetAreaUnits()
Predicate returning true if this Model's 'areaUnits' attribute is set.

Returns:
true if the 'areaUnits' attribute of this Model is set, false otherwise.

Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetLengthUnits

public boolean isSetLengthUnits()
Predicate returning true if this Model's 'lengthUnits' attribute is set.

Returns:
true if the 'lengthUnits' attribute of this Model is set, false otherwise.

Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetExtentUnits

public boolean isSetExtentUnits()
Predicate returning true if this Model's 'extentUnits' attribute is set.

Returns:
true if the 'extentUnits' attribute of this Model is set, false otherwise.

Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

isSetConversionFactor

public boolean isSetConversionFactor()
Predicate returning true if this Model's 'conversionFactor' attribute is set.

Returns:
true if the 'conversionFactor' attribute of this Model is set, false otherwise.

Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setId

public int setId(String sid)
Sets the value of the 'id' attribute of this Model.

The string sid is copied. Note that SBML has strict requirements for the syntax of identifiers. The following is a summary of the definition of the SBML identifier type SId, which defines the permitted syntax of identifiers. We express the syntax using an extended form of BNF notation:

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. In addition, there are a few conditions for the uniqueness of identifiers in an SBML model. Please consult the SBML specifications for the exact formulations.

Overrides:
setId in class SBase
Parameters:
sid - the string to use as the identifier of this Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

setName

public int setName(String name)
Sets the value of the 'name' attribute of this Model.

The string in name is copied.

Overrides:
setName in class SBase
Parameters:
name - the new name for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

setSubstanceUnits

public int setSubstanceUnits(String units)
Sets the value of the 'substanceUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new substanceUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setTimeUnits

public int setTimeUnits(String units)
Sets the value of the 'timeUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new timeUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setVolumeUnits

public int setVolumeUnits(String units)
Sets the value of the 'volumeUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new volumeUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setAreaUnits

public int setAreaUnits(String units)
Sets the value of the 'areaUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new areaUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setLengthUnits

public int setLengthUnits(String units)
Sets the value of the 'lengthUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new lengthUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setExtentUnits

public int setExtentUnits(String units)
Sets the value of the 'extentUnits' attribute of this Model.

The string in units is copied.

Parameters:
units - the new extentUnits for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

setConversionFactor

public int setConversionFactor(String units)
Sets the value of the 'conversionFactor' attribute of this Model.

The string in units is copied.

Parameters:
units - the new conversionFactor for the Model

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetId

public int unsetId()
Unsets the value of the 'id' attribute of this Model.

Overrides:
unsetId in class SBase
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

unsetName

public int unsetName()
Unsets the value of the 'name' attribute of this Model.

Overrides:
unsetName in class SBase
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

unsetSubstanceUnits

public int unsetSubstanceUnits()
Unsets the value of the 'substanceUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetTimeUnits

public int unsetTimeUnits()
Unsets the value of the 'timeUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetVolumeUnits

public int unsetVolumeUnits()
Unsets the value of the 'volumeUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetAreaUnits

public int unsetAreaUnits()
Unsets the value of the 'areaUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetLengthUnits

public int unsetLengthUnits()
Unsets the value of the 'lengthUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetExtentUnits

public int unsetExtentUnits()
Unsets the value of the 'extentUnits' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

unsetConversionFactor

public int unsetConversionFactor()
Unsets the value of the 'conversionFactor' attribute of this Model.

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is not present on Model in lower Levels of SBML.

addFunctionDefinition

public int addFunctionDefinition(FunctionDefinition fd)
Adds a copy of the given FunctionDefinition object to this Model.

Parameters:
fd - the FunctionDefinition to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createFunctionDefinition()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createFunctionDefinition() for a method that does not lead to these issues.


addUnitDefinition

public int addUnitDefinition(UnitDefinition ud)
Adds a copy of the given UnitDefinition object to this Model.

Parameters:
ud - the UnitDefinition object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createUnitDefinition()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createUnitDefinition() for a method that does not lead to these issues.


addCompartmentType

public int addCompartmentType(CompartmentType ct)
Adds a copy of the given CompartmentType object to this Model.

Parameters:
ct - the CompartmentType object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createCompartmentType()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createCompartmentType() for a method that does not lead to these issues.

, The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.


addSpeciesType

public int addSpeciesType(SpeciesType st)
Adds a copy of the given SpeciesType object to this Model.

Parameters:
st - the SpeciesType object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createSpeciesType()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createSpeciesType() for a method that does not lead to these issues.

, The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.


addCompartment

public int addCompartment(Compartment c)
Adds a copy of the given Compartment object to this Model.

Parameters:
c - the Compartment object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createCompartment()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createCompartment() for a method that does not lead to these issues.


addSpecies

public int addSpecies(Species s)
Adds a copy of the given Species object to this Model.

Parameters:
s - the Species object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createSpecies()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createSpecies() for a method that does not lead to these issues.


addParameter

public int addParameter(Parameter p)
Adds a copy of the given Parameter object to this Model.

Parameters:
p - the Parameter object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createParameter()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createParameter() for a method that does not lead to these issues.


addInitialAssignment

public int addInitialAssignment(InitialAssignment ia)
Adds a copy of the given InitialAssignment object to this Model.

Parameters:
ia - the InitialAssignment object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createInitialAssignment()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createInitialAssignment() for a method that does not lead to these issues.


addRule

public int addRule(Rule r)
Adds a copy of the given Rule object to this Model.

Parameters:
r - the Rule object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createAlgebraicRule(), Model.createAssignmentRule(), Model.createRateRule()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see the methods Model.createAlgebraicRule(), Model.createAssignmentRule() and Model.createRateRule() for methods that do not lead to these issues.


addConstraint

public int addConstraint(Constraint c)
Adds a copy of the given Constraint object to this Model.

Parameters:
c - the Constraint object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createConstraint()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createConstraint() for a method that does not lead to these issues.


addReaction

public int addReaction(Reaction r)
Adds a copy of the given Reaction object to this Model.

Parameters:
r - the Reaction object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createReaction()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createReaction() for a method that does not lead to these issues.


addEvent

public int addEvent(Event e)
Adds a copy of the given Event object to this Model.

Parameters:
e - the Event object to add

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.createEvent()
Note:
This method should be used with some caution. The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model.createEvent() for a method that does not lead to these issues.


createFunctionDefinition

public FunctionDefinition createFunctionDefinition()
Creates a new 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.

Returns:
the FunctionDefinition object created

See Also:
Model.addFunctionDefinition(FunctionDefinition fd)

createUnitDefinition

public UnitDefinition createUnitDefinition()
Creates a new 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.

Returns:
the UnitDefinition object created

See Also:
Model.addUnitDefinition(UnitDefinition ud)

createUnit

public Unit createUnit()
Creates a new 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.

Returns:
the Unit object created

See Also:
Model.addUnitDefinition(UnitDefinition ud)

createCompartmentType

public CompartmentType createCompartmentType()
Creates a new 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.

Returns:
the CompartmentType object created

See Also:
Model.addCompartmentType(CompartmentType ct)
Note:
The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.


createSpeciesType

public SpeciesType createSpeciesType()
Creates a new 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.

Returns:
the SpeciesType object created

See Also:
Model.addSpeciesType(SpeciesType st)
Note:
The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.


createCompartment

public Compartment createCompartment()
Creates a new 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.

Returns:
the Compartment object created

See Also:
Model.addCompartment(Compartment c)

createSpecies

public Species createSpecies()
Creates a new 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.

Returns:
the Species object created

See Also:
Model.addSpecies(Species s)

createParameter

public Parameter createParameter()
Creates a new 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.

Returns:
the Parameter object created

See Also:
Model.addParameter(Parameter p)

createInitialAssignment

public InitialAssignment createInitialAssignment()
Creates a new 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.

Returns:
the InitialAssignment object created

See Also:
Model.addInitialAssignment(InitialAssignment ia)

createAlgebraicRule

public AlgebraicRule createAlgebraicRule()
Creates a new 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.

Returns:
the AlgebraicRule object created

See Also:
Model.addRule(Rule r)

createAssignmentRule

public AssignmentRule createAssignmentRule()
Creates a new 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.

Returns:
the AssignmentRule object created

See Also:
Model.addRule(Rule r)

createRateRule

public RateRule createRateRule()
Creates a new 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.

Returns:
the RateRule object created

See Also:
Model.addRule(Rule r)

createConstraint

public Constraint createConstraint()
Creates a new 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.

Returns:
the Constraint object created

See Also:
Model.addConstraint(Constraint c)

createReaction

public Reaction createReaction()
Creates a new 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.

Returns:
the Reaction object created

See Also:
Model.addReaction(Reaction r)

createReactant

public SpeciesReference createReactant()
Creates a new 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.

Returns:
the SpeciesReference object created

createProduct

public SpeciesReference createProduct()
Creates a new 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.

Returns:
the SpeciesReference object created

createModifier

public 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.

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 ModifierSpeciesReference is not created and null is returned instead.

Returns:
the SpeciesReference object created

createKineticLaw

public KineticLaw createKineticLaw()
Creates a new 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, or a Reaction exists but already has a KineticLaw, a new KineticLaw is not created and null is returned instead.

Returns:
the KineticLaw object created

createKineticLawParameter

public 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.

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.

Returns:
the Parameter object created

createKineticLawLocalParameter

public LocalParameter createKineticLawLocalParameter()
Creates a new 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.

Returns:
the Parameter object created

createEvent

public Event createEvent()
Creates a new 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.

Returns:
the Event object created

createEventAssignment

public EventAssignment createEventAssignment()
Creates a new 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.

Returns:
the EventAssignment object created

createTrigger

public Trigger createTrigger()
Creates a new 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 Trigger is not created and null is returned instead.

Returns:
the Trigger object created

createDelay

public Delay createDelay()
Creates a new 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 Delay is not created and null is returned instead.

Returns:
the Delay object created

setAnnotation

public int setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object to a copy of 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().

Overrides:
setAnnotation in class SBase
Parameters:
annotation - an XML structure that is to be used as the content of the 'annotation' subelement of this object

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.appendAnnotation(XMLNode annotation)

setAnnotation

public int setAnnotation(String annotation)
Sets the value of the 'annotation' subelement of this SBML object to a copy of 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().

Overrides:
setAnnotation in class SBase
Parameters:
annotation - an XML string that is to be used as the content of the 'annotation' subelement of this object

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.appendAnnotation(String annotation)

appendAnnotation

public int appendAnnotation(XMLNode annotation)
Appends annotation content to any existing content in the 'annotation' subelement of this object.

The content in annotation is copied. Unlike setAnnotation(), this method allows other annotations to be preserved when an application adds its own data.

Overrides:
appendAnnotation in class SBase
Parameters:
annotation - an XML structure that is to be copied and appended to the content of the 'annotation' subelement of this object

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.setAnnotation(XMLNode annotation)

appendAnnotation

public int appendAnnotation(String annotation)
Appends annotation content to any existing content in the 'annotation' subelement of this object.

The content in annotation is copied. Unlike setAnnotation(), this method allows other annotations to be preserved when an application adds its own data.

Overrides:
appendAnnotation in class SBase
Parameters:
annotation - an XML string that is to be copied and appended to the content of the 'annotation' subelement of this object

Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

See Also:
Model.setAnnotation(String annotation)

getListOfFunctionDefinitions

public ListOfFunctionDefinitions getListOfFunctionDefinitions()
Get the ListOfFunctionDefinitions object in this Model.

Returns:
the list of FunctionDefinitions for this Model.

getListOfUnitDefinitions

public ListOfUnitDefinitions getListOfUnitDefinitions()
Get the ListOfUnitDefinitions object in this Model.

Returns:
the list of UnitDefinitions for this Model.

getListOfCompartmentTypes

public ListOfCompartmentTypes getListOfCompartmentTypes()
Get the ListOfCompartmentTypes object in this Model.

Returns:
the list of CompartmentTypes for this Model.

Note:
The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getListOfSpeciesTypes

public ListOfSpeciesTypes getListOfSpeciesTypes()
Get the ListOfSpeciesTypes object in this Model.

Returns:
the list of SpeciesTypes for this Model.

Note:
The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getListOfCompartments

public ListOfCompartments getListOfCompartments()
Get the ListOfCompartments object in this Model.

Returns:
the list of Compartments for this Model.

getListOfSpecies

public ListOfSpecies getListOfSpecies()
Get the ListOfSpecies object in this Model.

Returns:
the list of Species for this Model.

getListOfParameters

public ListOfParameters getListOfParameters()
Get the ListOfParameters object in this Model.

Returns:
the list of Parameters for this Model.

getListOfInitialAssignments

public ListOfInitialAssignments getListOfInitialAssignments()
Get the ListOfInitialAssignments object in this Model.

Returns:
the list of InitialAssignments for this Model.

getListOfRules

public ListOfRules getListOfRules()
Get the ListOfRules object in this Model.

Returns:
the list of Rules for this Model.

getListOfConstraints

public ListOfConstraints getListOfConstraints()
Get the ListOfConstraints object in this Model.

Returns:
the list of Constraints for this Model.

getListOfReactions

public ListOfReactions getListOfReactions()
Get the ListOfReactions object in this Model.

Returns:
the list of Reactions for this Model.

getListOfEvents

public ListOfEvents getListOfEvents()
Get the ListOfEvents object in this Model.

Returns:
the list of Events for this Model.

getFunctionDefinition

public FunctionDefinition getFunctionDefinition(long n)
Get the nth FunctionDefinitions object in this Model.

Returns:
the nth FunctionDefinition of this Model.

getFunctionDefinition

public FunctionDefinition getFunctionDefinition(String sid)
Get a FunctionDefinition object based on its identifier.

Returns:
the FunctionDefinition in this Model with the identifier sid or null if no such FunctionDefinition exists.

getUnitDefinition

public UnitDefinition getUnitDefinition(long n)
Get the nth UnitDefinition object in this Model.

Returns:
the nth UnitDefinition of this Model.

getUnitDefinition

public UnitDefinition getUnitDefinition(String sid)
Get a UnitDefinition based on its identifier.

Returns:
the UnitDefinition in this Model with the identifier sid or null if no such UnitDefinition exists.

getCompartmentType

public CompartmentType getCompartmentType(long n)
Get the nth CompartmentType object in this Model.

Returns:
the nth CompartmentType of this Model.

Note:
The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getCompartmentType

public CompartmentType getCompartmentType(String sid)
Get a CompartmentType object based on its identifier.

Returns:
the CompartmentType in this Model with the identifier sid or null if no such CompartmentType exists.

Note:
The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getSpeciesType

public SpeciesType getSpeciesType(long n)
Get the nth SpeciesType object in this Model.

Returns:
the nth SpeciesType of this Model.

Note:
The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getSpeciesType

public SpeciesType getSpeciesType(String sid)
Get a SpeciesType object based on its identifier.

Returns:
the SpeciesType in this Model with the identifier sid or null if no such SpeciesType exists.

Note:
The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getCompartment

public Compartment getCompartment(long n)
Get the nth Compartment object in this Model.

Returns:
the nth Compartment of this Model.

getCompartment

public Compartment getCompartment(String sid)
Get a Compartment object based on its identifier.

Returns:
the Compartment in this Model with the identifier sid or null if no such Compartment exists.

getSpecies

public Species getSpecies(long n)
Get the nth Species object in this Model.

Returns:
the nth Species of this Model.

getSpecies

public Species getSpecies(String sid)
Get a Species object based on its identifier.

Returns:
the Species in this Model with the identifier sid or null if no such Species exists.

getParameter

public Parameter getParameter(long n)
Get the nth Parameter object in this Model.

Returns:
the nth Parameter of this Model.

getParameter

public Parameter getParameter(String sid)
Get a Parameter object based on its identifier.

Returns:
the Parameter in this Model with the identifier sid or null if no such Parameter exists.

getInitialAssignment

public InitialAssignment getInitialAssignment(long n)
Get the nth InitialAssignment object in this Model.

Returns:
the nth InitialAssignment of this Model.

getInitialAssignment

public InitialAssignment getInitialAssignment(String symbol)
Get an InitialAssignment object based on the symbol to which it assigns a value.

Returns:
the InitialAssignment in this Model with the given 'symbol' attribute value or null if no such InitialAssignment exists.

getRule

public Rule getRule(long n)
Get the nth Rule object in this Model.

Returns:
the nth Rule of this Model.

getRule

public Rule getRule(String variable)
Get a Rule object based on the variable to which it assigns a value.

Returns:
the Rule in this Model with the given 'variable' attribute value or null if no such Rule exists.

getConstraint

public Constraint getConstraint(long n)
Get the nth Constraint object in this Model.

Returns:
the nth Constraint of this Model.

getReaction

public Reaction getReaction(long n)
Get the nth Reaction object in this Model.

Returns:
the nth Reaction of this Model.

getReaction

public Reaction getReaction(String sid)
Get a Reaction object based on its identifier.

Returns:
the Reaction in this Model with the identifier sid or null if no such Reaction exists.

getSpeciesReference

public SpeciesReference getSpeciesReference(String sid)
Get a SpeciesReference object based on its identifier.

Returns:
the SpeciesReference in this Model with the identifier sid or null if no such SpeciesReference exists.

getEvent

public Event getEvent(long n)
Get the nth Event object in this Model.

Returns:
the nth Event of this Model.

getEvent

public Event getEvent(String sid)
Get an Event object based on its identifier.

Returns:
the Event in this Model with the identifier sid or null if no such Event exists.

getNumFunctionDefinitions

public long getNumFunctionDefinitions()
Get the number of FunctionDefinition objects in this Model.

Returns:
the number of FunctionDefinitions in this Model.

getNumUnitDefinitions

public long getNumUnitDefinitions()
Get the number of UnitDefinition objects in this Model.

Returns:
the number of UnitDefinitions in this Model.

getNumCompartmentTypes

public long getNumCompartmentTypes()
Get the number of CompartmentType objects in this Model.

Returns:
the number of CompartmentTypes in this Model.

Note:
The CompartmentType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getNumSpeciesTypes

public long getNumSpeciesTypes()
Get the number of SpeciesType objects in this Model.

Returns:
the number of SpeciesTypes in this Model.

Note:
The SpeciesType object class is only available in SBML Level 2 Versions 2–4. It is not available in Level 1 nor Level 3.

getNumCompartments

public long getNumCompartments()
Get the number of Compartment objects in this Model.

Returns:
the number of Compartments in this Model.

getNumSpecies

public long getNumSpecies()
Get the number of Specie objects in this Model.

Returns:
the number of Species in this Model.

getNumSpeciesWithBoundaryCondition

public long getNumSpeciesWithBoundaryCondition()
Get the number of Species in this Model having their 'boundaryCondition' attribute value set to true.

Returns:
the number of Species in this Model with boundaryCondition set to true.

getNumParameters

public long getNumParameters()
Get the number of Parameter objects in this Model.

Returns:
the number of Parameters in this Model. Parameters defined in KineticLaws are not included.

getNumInitialAssignments

public long getNumInitialAssignments()
Get the number of InitialAssignment objects in this Model.

Returns:
the number of InitialAssignments in this Model.

getNumRules

public long getNumRules()
Get the number of Rule objects in this Model.

Returns:
the number of Rules in this Model.

getNumConstraints

public long getNumConstraints()
Get the number of Constraint objects in this Model.

Returns:
the number of Constraints in this Model.

getNumReactions

public long getNumReactions()
Get the number of Reaction objects in this Model.

Returns:
the number of Reactions in this Model.

getNumEvents

public long getNumEvents()
Get the number of Event objects in this Model.

Returns:
the number of Events in this Model.

removeFromParentAndDelete

public int removeFromParentAndDelete()
Finds this Model's parent SBMLDocument and calls setModel(null) on it, indirectly deleting itself. Overridden from the SBase function since the parent is not a ListOf.

Overrides:
removeFromParentAndDelete in class SBase
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:

renameSIdRefs

public void renameSIdRefs(String oldid,
                          String newid)
Renames all the SIdRef attributes on this element, including any found in MathML

Overrides:
renameSIdRefs in class SBase
Parameters:
oldid - the old identifier
newid - the new identifier

renameUnitSIdRefs

public void renameUnitSIdRefs(String oldid,
                              String newid)
Renames all the UnitSIdRef attributes on this element

Overrides:
renameUnitSIdRefs in class SBase
Parameters:
oldid - the old identifier
newid - the new identifier

getTypeCode

public int getTypeCode()
Returns the libSBML type code for this SBML object.

LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in the interface class libsbmlConstants. The names of the type codes all begin with the characters SBML_.

Overrides:
getTypeCode in class SBase
Returns:
the SBML type code for this object, or SBML_UNKNOWN (default).

See Also:
Model.getElementName()

getElementName

public String getElementName()
Returns the XML element name of this object, which for Model, is always 'model'.

Overrides:
getElementName in class SBase
Returns:
the name of this element, i.e., 'model'.

populateListFormulaUnitsData

public void populateListFormulaUnitsData()
Populates the list of FormulaDataUnits with the units derived for the model. The list contains elements of class FormulaUnitsData.

The first element of the list refers to the default units of 'substance per time' derived from the model and has the unitReferenceId 'subs_per_time'. This facilitates the comparison of units derived from mathematical formula with the expected units.

The next elements of the list record the units of the compartments and species established from either explicitly declared or default units.

The next elements record the units of any parameters.

Subsequent elements of the list record the units derived for each mathematical expression encountered within the model.

Note:
This function is utilised by the Unit Consistency Validator. The list is populated prior to running the validation and thus the consistency of units can be checked by accessing the members of the list and comparing the appropriate data.

isPopulatedListFormulaUnitsData

public boolean isPopulatedListFormulaUnitsData()
Predicate returning true if the list of FormulaUnitsData is populated.

Returns:
true if the list of FormulaUnitsData is populated, false otherwise.

hasRequiredElements

public boolean hasRequiredElements()
Predicate returning true if all the required elements for this Model object have been set.

Overrides:
hasRequiredElements in class SBase
Returns:
a boolean value indicating whether all the required elements for this object have been defined.
Note:
The required elements for a Model object are: listOfCompartments (L1 only); listOfSpecies (L1V1 only); listOfReactions(L1V1 only)


removeFunctionDefinition

public FunctionDefinition removeFunctionDefinition(long n)
Removes the nth FunctionDefinition object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the FunctionDefinition object to remove

Returns:
the FunctionDefinition object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeFunctionDefinition

public FunctionDefinition removeFunctionDefinition(String sid)
Removes the 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. If none of the FunctionDefinition objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the FunctionDefinition object to remove

Returns:
the FunctionDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if no FunctionDefinition object with the identifier exists in this Model object.

removeUnitDefinition

public UnitDefinition removeUnitDefinition(long n)
Removes the nth UnitDefinition object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the UnitDefinition object to remove

Returns:
the UnitDefinition object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeUnitDefinition

public UnitDefinition removeUnitDefinition(String sid)
Removes the 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. If none of the UnitDefinition objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the UnitDefinition object to remove

Returns:
the UnitDefinition object removed. As mentioned above, the caller owns the returned object. null is returned if no UnitDefinition object with the identifier exists in this Model object.

removeCompartmentType

public CompartmentType removeCompartmentType(long n)
Removes the nth CompartmentType object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the CompartmentType object to remove

Returns:
the ComapartmentType object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeCompartmentType

public CompartmentType removeCompartmentType(String sid)
Removes the 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. If none of the CompartmentType objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the object to remove

Returns:
the CompartmentType object removed. As mentioned above, the caller owns the returned object. null is returned if no CompartmentType object with the identifier exists in this Model object.

removeSpeciesType

public SpeciesType removeSpeciesType(long n)
Removes the nth SpeciesType object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the SpeciesType object to remove

Returns:
the SpeciesType object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeSpeciesType

public SpeciesType removeSpeciesType(String sid)
Removes the 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. If none of the SpeciesType objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the SpeciesType object to remove

Returns:
the SpeciesType object removed. As mentioned above, the caller owns the returned object. null is returned if no SpeciesType object with the identifier exists in this Model object.


removeCompartment

public Compartment removeCompartment(long n)
Removes the nth Compartment object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Compartment object to remove

Returns:
the Compartment object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeCompartment

public Compartment removeCompartment(String sid)
Removes the 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. If none of the Compartment objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the Compartment object to remove

Returns:
the Compartment object removed. As mentioned above, the caller owns the returned object. null is returned if no Compartment object with the identifier exists in this Model object.

removeSpecies

public Species removeSpecies(long n)
Removes the nth Species object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Species object to remove

Returns:
the Species object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeSpecies

public Species removeSpecies(String sid)
Removes the Species 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. If none of the Species objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the Species object to remove

Returns:
the Species object removed. As mentioned above, the caller owns the returned object. null is returned if no Species object with the identifier exists in this Model object.


removeParameter

public Parameter removeParameter(long n)
Removes the nth Parameter object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Parameter object to remove

Returns:
the Parameter object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeParameter

public Parameter removeParameter(String sid)
Removes the Parameter 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. If none of the Parameter objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the Parameter object to remove

Returns:
the Parameter object removed. As mentioned above, the caller owns the returned object. null is returned if no Parameter object with the identifier exists in this Model object.

removeInitialAssignment

public InitialAssignment removeInitialAssignment(long n)
Removes the nth InitialAssignment object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the InitialAssignment object to remove

Returns:
the InitialAssignment object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeInitialAssignment

public InitialAssignment removeInitialAssignment(String symbol)
Removes the 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. If none of the InitialAssignment objects in this Model object have the 'symbol' attribute symbol, then null is returned.

Parameters:
symbol - the 'symbol' attribute of the InitialAssignment object to remove

Returns:
the InitialAssignment object removed. As mentioned above, the caller owns the returned object. null is returned if no InitialAssignment object with the 'symbol' attribute exists in this Model object.

removeRule

public Rule removeRule(long n)
Removes the nth Rule object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Rule object to remove

Returns:
the Rule object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeRule

public Rule removeRule(String variable)
Removes the Rule object with the given 'variable' attribute from this Model object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it. If none of the Rule objects in this Model object have the 'variable' attribute variable, then null is returned.

Parameters:
variable - the 'variable' attribute of the Rule object to remove

Returns:
the Rule object removed. As mentioned above, the caller owns the returned object. null is returned if no Rule object with the 'variable' attribute exists in this Model object.

removeConstraint

public Constraint removeConstraint(long n)
Removes the nth Constraint object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Constraint object to remove

Returns:
the Constraint object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeReaction

public Reaction removeReaction(long n)
Removes the nth Reaction object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Reaction object to remove

Returns:
the Reaction object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeReaction

public Reaction removeReaction(String sid)
Removes the Reaction 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. If none of the Reaction objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the Reaction object to remove

Returns:
the Reaction object removed. As mentioned above, the caller owns the returned object. null is returned if no Reaction object with the identifier exists in this Model object.


removeEvent

public Event removeEvent(long n)
Removes the nth Event object from this Model object and returns a pointer to it.

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

Parameters:
n - the index of the Event object to remove

Returns:
the Event object removed. As mentioned above, the caller owns the returned item. null is returned if the given index is out of range.


removeEvent

public Event removeEvent(String sid)
Removes the Event 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. If none of the Event objects in this Model object have the identifier sid, then null is returned.

Parameters:
sid - the identifier of the Event object to remove

Returns:
the Event object removed. As mentioned above, the caller owns the returned object. null is returned if no Event object with the identifier exists in this Model object.


appendFrom

public int appendFrom(Model model)
Takes the contents of the passed-in Model, makes copies of everything, and appends those copies to the appropriate places in this Model. Also calls 'appendFrom' on all plugin objects.

Parameters:
model - the Model to merge with this one.


libSBML
5.8.0


LibSBML, an application programming interface (API) library for SBML.