libSBML Perl API  libSBML 5.10.0 Perl API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
doc_compartment_units Class Reference

Detailed Description

Compartments in SBML have an attribute ("units") for declaring the units of measurement intended for the value of the compartment's size. In the absence of a value given for this attribute, the units are inherited from values either defined on the enclosing Model (in SBML Level 3) or in defaults (in SBML Level 2). This method returns a UnitDefinition object based on how this compartment's units are interpreted according to the relevant SBML guidelines, or it returns NULL if no units have been declared and no defaults are defined by the relevant SBML specification.

Note that unit declarations for Compartment objects are specified in terms of the identifier of a unit, but this method returns an object , not a unit identifier. It does this by constructing an appropriate UnitDefinition object. For SBML Level 2 models, it will do this even when the value of the "units" attribute is one of the special SBML Level 2 unit identifiers "substance", "volume", "area", "length" or "time". Callers may find this useful in conjunction with the helper methods provided by the UnitDefinition class for comparing different UnitDefinition objects.