Converting a Sector-based Model to Modules
I generally do not use modules to build very small models (only a couple of stocks and flows), which may then lead me to use sectors as the model grows because they are very convenient. By the time I have three sectors, though, it starts to become clear that I should have used modules. I will then need to convert my sector-based model into a module-based model. Historically, I also have a number of sector-based models that are crying to be module-based.
Converting from sectors to modules is not very difficult:
- Make sure there are no connections or flows between sectors. Replace any of these with ghosts in the target sector.
- In a new model, create one module for every sector.
- Copy and paste the structure from each sector into its corresponding module.
- Connect the modules: At this point, the model structure has been rearranged into modules, but none of the modules are connected. The ghosts that were in the sectors became real entities when they were pasted into the modules. Go back to identify all of these connections and reconnect them in the module-based model.
Stepping Through a Sample Model
Let’s walk through an example. A small sector-based model is shown below (and is available by clicking here).

This model violates what I would call good sector etiquette: there are connectors that run between the sectors. This is often useful in a small model such as this because it makes the feedback loops visible. However, in a larger model, this can lead to problems such as crossed connections and difficulty in maintaining the model because sectors cannot be easily moved.



A module is a container for lower-level model structure. It is designed to support a process of top-down model design and development.
A module input is a variable that can become the ghost of another variable at a different level of the module hierarchy. It becomes the ghost when you assign it to that other variable. After it is assigned, it is referred to both as a cross-level ghost and an assigned module input. All of this is managed transparently if you use the ghost tool.
When a variable is designated as a module output, you are telling the software that this variable can be ghosted on a different level of the module hierarchy. While any variable can be a module output, it is important to carefully manage which variables you intend to be shared across modules.

