10.3 The Model
The simplest model is the empty one. You can get it by simply instantiating a MooseModel:
A model is also an entity, and thus, it can be stored in another model. By default, Moose offers a special root model object that is a singleton and that can be accessed via:
The root model is special because by convention it is used to store all other models. It acts as a repository, and its content are displayed in the MoosePanel user interface.
To add your model to the root model, you can simply do:
| myModel |
myModel := MooseModel new.
MooseModel root add: myModel.
Once an entity is placed in a model, it automatically stores the model in an instance variable accessible via
mooseModel. Thus, when a query requires information that is outside of the scope of the entity under study, you can obtain the information from the model.