Next: ChoiceModel Class
Up: ChunkModel Class
Previous: The Run Method
Index
All models that are derived from the ChunkModel class must have the method run_chunk() implemented.
It has two non-keyword arguments: an integer array and an object of class Dataset. The first argument
is an index of elements within the second argument. The method can have additional keyword arguments.
The method is expected to return an array of the same size as the size of the first argument (i.e. the chunk size).
The
-th value of the result is expected to be associated with the dataset element indexed by index[
].
Optionally, the method get_agents_order() can be implemented in the child class. It determines the order in which
dataset elements are passed into chunks. This method takes a dataset as an argument which is an
object of class DatasetSubset containing only those elements of the
original dataset that are defined by dataset_index. It returns
an index of elements within the given subset determining the order in which the
elements should be processed. For example, if this method returns a randomized
index, the elements passed into run_chunk() will be processed in
randomized order.
An example of a user-defined ChunkModel is in Section 23.4.
Next: ChoiceModel Class
Up: ChunkModel Class
Previous: The Run Method
Index
info (at) urbansim.org