Next: Coefficients
Up: Specification
Previous: Initialization
Index
If the specification is stored in one of the supported storage formats,
one can omit all arguments in the constructor and load the specification
from the storage, using the method load(). It takes the following
arguments:
- resources
- - an object of class Resources. If the remaining
arguments are given, they will have priority over entries of the same name
in
resources.
- in_storage
- - an object of class Storage that overwrites the
one given in the constructor.
- in_table_name
- - name of the table/file where the specification should
be loaded from.
- variables
- - if this argument is given, it serves as a filter for the
variables loaded from the storage.
For each of the class properties variables, coefficients, equations,
submodels, and fixed_values, respectively, a table column is accepted on the storage (the first two are required,
the others are optional). The column
names are given in the resources entries 'field_variable_name',
'field_coefficient_name', 'field_equation_id', 'field_submodel_id', and 'field_fixed_value',
respectively. Default values for the column names are 'variable_name',
'coefficient_name',
'equation_id', 'sub_model_id', and 'fixed_value', respectively. If the table contains
columns of other names, they are loaded into the class attribute other_fields, each as a dictionary entry.
To store a specification into a storage, use the method
write(resources, out_storage, out_table_name). The behavior is
analogous to the load() method. If equations or/and submodels are not
used, the method stores values
in those columns.
Next: Coefficients
Up: Specification
Previous: Initialization
Index
info (at) urbansim.org