next up previous index
Next: Utilities Class Up: The opus_core Opus Package Previous: The Estimate Method   Index


Model Components

Opus models are designed in a highly modular way. It allows to easily change model behavior by exchanging components the model is composed from.

Components implemented as classes in opus_core are shown in their hierarchical structure in Figure 7.4. The shaded boxes are classes that do not provide much functionality themselves, but rather serve as abstract classes. All model components should have a method run(). Model components can be composed from other model components. Thus, Opus models (child classes of Model) are themselves model components.

Figure: Model components in Opus' opus_core.
Image corecomponents

Instances of model components can be created using the class ModelComponentCreator, by passing the class name into the method get_model_component(). In such a case the class name must be the same as the module name. If it is not the case, one can use ClassFactory for this purpose. There are a few child classes of ModelComponentCreator implemented in opus_core for creating specific model components.



Subsections
next up previous index
Next: Utilities Class Up: The opus_core Opus Package Previous: The Estimate Method   Index
info (at) urbansim.org