libSBML C API  5.18.0
LocalParameter_t Class Reference

Detailed Description

A parameter inside an SBML reaction definition.

LocalParameter_t has been introduced in SBML Level 3 to serve as the object class for parameter definitions that are intended to be local to a Reaction_t. Objects of class LocalParameter_t never appear at the Model_t level; they are always contained within ListOfLocalParameters_t lists which are in turn contained within KineticLaw_t objects.

Like its global Parameter_t counterpart, the LocalParameter_t object class is used to define a symbol associated with a value; this symbol can then be used in a model's mathematical formulas (and specifically, for LocalParameter_t, reaction rate formulas). Unlike Parameter_t, the LocalParameter_t class does not have a "constant" attribute: local parameters within reactions are always constant.

LocalParameter_t has one required attribute, "id", to give the parameter a unique identifier by which other parts of an SBML model definition can refer to it. A parameter can also have an optional "name" attribute of type string. Identifiers and names must be used according to the guidelines described in the SBML specifications.

The optional attribute "value" determines the value (of type double) assigned to the parameter. A missing value for "value" implies that the value either is unknown, or to be obtained from an external source, or determined by an initial assignment. The unit of measurement associated with the value of the parameter can be specified using the optional attribute "units". Here we only mention briefly some notable points about the possible unit choices, but readers are urged to consult the SBML specification documents for more information:

  • In SBML Level 3, there are no constraints on the units that can be assigned to parameters in a model; there are also no units to inherit from the enclosing Model_t object.

  • In SBML Level 2, the value assigned to the parameter's "units" attribute must be chosen from one of the following possibilities: one of the base unit identifiers defined in SBML; one of the built-in unit identifiers "substance", "time", "volume", "area" or "length"; or the identifier of a new unit defined in the list of unit definitions in the enclosing Model_t structure. There are no constraints on the units that can be chosen from these sets. There are no default units for local parameters.

As with all other major SBML components, LocalParameter_t is derived from SBase_t, and the methods defined on SBase_t are available on LocalParameter_t.

In SBML Level 3 Version 2, the scope of the LocalParameter_t was expanded slightly to officially encompass the entire Reaction_t instead of just the KineticLaw_t in which it appears. This has no effect on models using only SBML Level 3 Core constructs, but has the potential to allow SBML Level 3 Packages to include elements in a Reaction_t that could reference a LocalParameter_t from that Reaction_t's KineticLaw_t. It also means that no LocalParameter_t may have the same "id" as a referenced Species_t in any SimpleSpeciesReference_t in that Reaction_t.

Warning
LibSBML derives LocalParameter_t from Parameter_t; however, this does not precisely match the object hierarchy defined by SBML Level 3, where LocalParameter_t is derived directly from SBase_t and not Parameter_t. We believe this arrangement makes it easier for libSBML users to program applications that work with both SBML Level 2 and SBML Level 3, but programmers should also keep in mind this difference exists. A side-effect of libSBML's scheme is that certain methods on LocalParameter_t that are inherited from Parameter_t do not actually have relevance to LocalParameter_t objects. An example of this is the methods pertaining to Parameter_t's attribute "constant" (i.e., isSetConstant(), setConstant(), and getConstant()).
See also
ListOfLocalParameters_t
KineticLaw_t

Public Member Functions

LocalParameter_tLocalParameter_clone (const LocalParameter_t *p)
 Creates a deep copy of the given LocalParameter_t structure. More...
 
LocalParameter_tLocalParameter_create (unsigned int level, unsigned int version)
 Creates a new LocalParameter_t structure using the given SBML level and version values. More...
 
LocalParameter_tLocalParameter_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new LocalParameter_t structure using the given SBMLNamespaces_t structure. More...
 
void LocalParameter_free (LocalParameter_t *p)
 Frees the given LocalParameter_t structure. More...
 
int LocalParameter_getConstant (const LocalParameter_t *p)
 Because a LocalParameter_t has no 'constant' attribute, always returns 'true', as local parameters in SBML may not vary. More...
 
UnitDefinition_tLocalParameter_getDerivedUnitDefinition (LocalParameter_t *p)
 Constructs and returns a UnitDefinition_t structure that expresses the units of this LocalParameter_t structure. More...
 
const char * LocalParameter_getId (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its identifier. More...
 
const char * LocalParameter_getName (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its name. More...
 
const XMLNamespaces_tLocalParameter_getNamespaces (LocalParameter_t *p)
 Returns a list of XMLNamespaces_t associated with this LocalParameter_t structure. More...
 
const char * LocalParameter_getUnits (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its units. More...
 
double LocalParameter_getValue (const LocalParameter_t *p)
 Takes a LocalParameter_t structure and returns its value. More...
 
int LocalParameter_hasRequiredAttributes (LocalParameter_t *p)
 Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes for this LocalParameter_t object have been set. More...
 
void LocalParameter_initDefaults (LocalParameter_t *p)
 Does nothing: this function initializes structures according to their defaults in SBML Level 2, but Local Parameters did not exist in SBML Level 2. More...
 
int LocalParameter_isSetId (const LocalParameter_t *p)
 Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's identifier is set. More...
 
int LocalParameter_isSetName (const LocalParameter_t *p)
 Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's name is set. More...
 
int LocalParameter_isSetUnits (const LocalParameter_t *p)
 Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's units have been set. More...
 
int LocalParameter_isSetValue (const LocalParameter_t *p)
 Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's value is set. More...
 
int LocalParameter_setConstant (LocalParameter_t *p, int value)
 Because LocalParameter_t structures don't have a 'constant' attribute, this function always returns LIBSBML_INVALID_ATTRIBUTE_VALUE, or LIBSBML_INVALID_OBJECT if p is NULL. More...
 
int LocalParameter_setId (LocalParameter_t *p, const char *sid)
 Assigns the identifier of a LocalParameter_t structure. More...
 
int LocalParameter_setName (LocalParameter_t *p, const char *name)
 Assign the name of a LocalParameter_t structure. More...
 
int LocalParameter_setUnits (LocalParameter_t *p, const char *units)
 Assign the units of a LocalParameter_t structure. More...
 
int LocalParameter_setValue (LocalParameter_t *p, double value)
 Assign the value of a LocalParameter_t structure. More...
 
int LocalParameter_unsetConstant (LocalParameter_t *p)
 Because LocalParameter_t structures don't have a 'constant' attribute, this function always returns LIBSBML_INVALID_ATTRIBUTE_VALUE, or LIBSBML_INVALID_OBJECT if p is NULL. More...
 
int LocalParameter_unsetName (LocalParameter_t *p)
 Unsets the name of this LocalParameter_t structure. More...
 
int LocalParameter_unsetUnits (LocalParameter_t *p)
 Unsets the units of this LocalParameter_t structure. More...
 
int LocalParameter_unsetValue (LocalParameter_t *p)
 Unsets the value of this LocalParameter_t structure. More...
 

Member Function Documentation

LocalParameter_t * LocalParameter_clone ( const LocalParameter_t p)

Creates a deep copy of the given LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure to be copied.
Returns
a (deep) copy of the given LocalParameter_t structure.
LocalParameter_t * LocalParameter_create ( unsigned int  level,
unsigned int  version 
)

Creates a new LocalParameter_t structure using the given SBML level and version values.

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

Creates a new LocalParameter_t structure using the given SBMLNamespaces_t structure.

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

Frees the given LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure to be freed.
int LocalParameter_getConstant ( const LocalParameter_t p)

Because a LocalParameter_t has no 'constant' attribute, always returns 'true', as local parameters in SBML may not vary.

Parameters
pthe LocalParameter_t to ignore.
Returns
1 (true), or 0 (false) if p is NULL.
UnitDefinition_t * LocalParameter_getDerivedUnitDefinition ( LocalParameter_t p)

Constructs and returns a UnitDefinition_t structure that expresses the units of this LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure whose units are to be returned.
Returns
a UnitDefinition_t structure that expresses the units of this LocalParameter_t strucuture.
Note
This function returns the units of the LocalParameter_t expressed as a UnitDefinition_t. The units may be those explicitly declared. In the case where no units have been declared, NULL is returned.
const char * LocalParameter_getId ( const LocalParameter_t p)

Takes a LocalParameter_t structure and returns its identifier.

Parameters
pthe LocalParameter_t structure whose identifier is sought.
Returns
the identifier of this LocalParameter_t, as a pointer to a string.
const char * LocalParameter_getName ( const LocalParameter_t p)

Takes a LocalParameter_t structure and returns its name.

Parameters
pthe LocalParameter_t whose name is sought.
Returns
the name of this LocalParameter_t, as a pointer to a string.
const XMLNamespaces_t * LocalParameter_getNamespaces ( LocalParameter_t p)

Returns a list of XMLNamespaces_t associated with this LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure.
Returns
pointer to the XMLNamespaces_t structure associated with this structure
const char * LocalParameter_getUnits ( const LocalParameter_t p)

Takes a LocalParameter_t structure and returns its units.

Parameters
pthe LocalParameter_t whose units are sought.
Returns
the units assigned to this LocalParameter_t structure, as a pointer to a string.
double LocalParameter_getValue ( const LocalParameter_t p)

Takes a LocalParameter_t structure and returns its value.

Parameters
pthe LocalParameter_t whose value is sought.
Returns
the value assigned to this LocalParameter_t structure, as a double.
int LocalParameter_hasRequiredAttributes ( LocalParameter_t p)

Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes for this LocalParameter_t object have been set.

Parameters
pthe LocalParameter_t structure to check.

The required attributes for a LocalParameter_t object are:

  • id (name in L1)
Returns
1 (true) if all the required attributes for this object have been defined, 0 (false) otherwise.
void LocalParameter_initDefaults ( LocalParameter_t p)

Does nothing: this function initializes structures according to their defaults in SBML Level 2, but Local Parameters did not exist in SBML Level 2.

Parameters
pthe LocalParameter_t structure to be ignored.
int LocalParameter_isSetId ( const LocalParameter_t p)

Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's identifier is set.

Parameters
pthe LocalParameter_t structure to query.
Returns
1 (true) if the "id" attribute of the given LocalParameter_t structure is set, 0 (false) otherwise.
int LocalParameter_isSetName ( const LocalParameter_t p)

Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's name is set.

Parameters
pthe LocalParameter_t structure to query.
Returns
1 (true) if the "name" attribute of the given LocalParameter_t structure is set, 0 (false) otherwise.
int LocalParameter_isSetUnits ( const LocalParameter_t p)

Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's units have been set.

Parameters
pthe LocalParameter_t structure to query.
Returns
1 (true) if the "units" attribute of the given LocalParameter_t structure is set, 0 (false) otherwise.
int LocalParameter_isSetValue ( const LocalParameter_t p)

Predicate returning 1 (true) or 0 (false) depending on whether the given LocalParameter_t structure's value is set.

Parameters
pthe LocalParameter_t structure to query.
Returns
1 (true) if the "value" attribute of the given LocalParameter_t structure is set, 0 (false) otherwise.
int LocalParameter_setConstant ( LocalParameter_t p,
int  value 
)

Because LocalParameter_t structures don't have a 'constant' attribute, this function always returns LIBSBML_INVALID_ATTRIBUTE_VALUE, or LIBSBML_INVALID_OBJECT if p is NULL.

Parameters
pthe LocalParameter_t structure to leave unchanged.
valuethe integer value to ignore.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int LocalParameter_setId ( LocalParameter_t p,
const char *  sid 
)

Assigns the identifier of a LocalParameter_t structure.

This makes a copy of the string passed in the parameter sid.

Parameters
pthe LocalParameter_t structure to set.
sidthe string to use as the identifier.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with an sid of NULL is equivalent to unsetting the "id" attribute.
int LocalParameter_setName ( LocalParameter_t p,
const char *  name 
)

Assign the name of a LocalParameter_t structure.

This makes a copy of the string passed in as the argument name.

Parameters
pthe LocalParameter_t structure to set.
namethe string to use as the name.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int LocalParameter_setUnits ( LocalParameter_t p,
const char *  units 
)

Assign the units of a LocalParameter_t structure.

This makes a copy of the string passed in as the argument units.

Parameters
pthe LocalParameter_t structure to set.
unitsthe string to use as the identifier of the units to assign.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with units set to NULL is equivalent to unsetting the "units" attribute.
int LocalParameter_setValue ( LocalParameter_t p,
double  value 
)

Assign the value of a LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure to set.
valuethe double value to use.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int LocalParameter_unsetConstant ( LocalParameter_t p)

Because LocalParameter_t structures don't have a 'constant' attribute, this function always returns LIBSBML_INVALID_ATTRIBUTE_VALUE, or LIBSBML_INVALID_OBJECT if p is NULL.

Parameters
pthe LocalParameter_t structure to leave unchanged.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int LocalParameter_unsetName ( LocalParameter_t p)

Unsets the name of this LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure whose name is to be unset.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int LocalParameter_unsetUnits ( LocalParameter_t p)

Unsets the units of this LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure whose units are to be unset.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int LocalParameter_unsetValue ( LocalParameter_t p)

Unsets the value of this LocalParameter_t structure.

Parameters
pthe LocalParameter_t structure whose value is to be unset.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: