next up previous index
Next: Loading from and Writing Up: Specification Previous: Specification   Index

Initialization

The constructor of EquationSpecification takes the following arguments (they all have default value None):
variables
- an array of variable names.
coefficients
- an array of coefficient names.
equations
- an array of equations.
submodels
- an array of submodels.
fixed_values
- an array of fixed values. Any non-zero value is considered as a constant value of the corresponding coefficient, i.e. it is not to be estimated.
other_fields
- a dictionary holding additional columns of the specification table.
specification_dict
- the specification is specified in a dictionary format (see below). This argument is considered only if the argument variables is None. In such a case, all arguments above are ignored.
in_storage
- an object of class Storage for loading specification from a storage.
out_storage
- an object of class Storage for specification output.

All arguments are set as class properties.

The arrays variables and coefficients must have the same size. If submodels, equations and fixed_values are not omitted, they too must have the same length as variables. It is interpreted as the $ i$ -th variable is connected to the $ i$ -th coefficient in the $ i$ -th equation (if there are any) in the $ i$ -th submodel (if there are any). If the $ i$ -th fixed value is non-zero, the $ i$ -th coefficient is not to be estimated. All entries of other_fields must also be of the same size as variables. Values of equations and submodels should be strictly positive integers. Coefficients should have different names across equations, i.e. if there would be $ i$ and $ j$ for which the coefficients[i]==coefficients[j] and equations[i]<>equations[j] and submodels[i]==submodels[j], it would lead to errors when connecting specification and coefficients.

An alternative way of defining a specification is a dictionary format (passed to the constructor via the argument specification_dict). Keys of the dictionary are submodels. If there is only one submodel, the value $ -2$ should be used as key. The value for each submodel entry is a list containing specification for the particular submodel. The elements of each list can be defined in one of the following forms:

specification_dict can contain an entry '_definition_' which should be a list of elements in one of the forms above. In such a case, the entries defined for submodels can contain only the variable aliases. The corresponding coefficient names and fixed values (if defined) are taken from the definition section. Examples of specifications in a dictionary format can be found in the unit tests of the EquationSpecification class.


next up previous index
Next: Loading from and Writing Up: Specification Previous: Specification   Index
info (at) urbansim.org