User's guide chapter 7



Previous: Chapter 6 Next: Chapter 8

Chapter 7 – Hierarchical Modeling / Submodels

See Using Submodels video tutorial.

7.1 – What is Hierarchical Modeling?

Hierarchical modeling is a modeling approach in which one activity in a model represents entire process. These processes are defined themselves as models in separate chart files which are linked to the activities representing them. A model that is linked to an activity in another model is referred to as a submodel. Submodels themselves may have activities representing other submodels in a hierarchical fashion (see figure below).

Hierarchical Modeling

When a simulation is run on the general model, linked submodels are also simulated as part of the entire model. Optionally you can disable any or all of the submodels and use the generalized time defined for the activity representing the submodel. Submodels can also be run independently to facilitate the building and verifying of submodels.

A hierarchical modeling methodology has the following advantages:

  • It allows you to focus attention on smaller, more manageable components of a process step. If a component is still too complicated, it
    can be further divided into smaller components until each module is of manageable size.
  • It reduces the risk of forgetting details of more complex modules, and confusing the interactions between modules.
  • Provided interactions are carefully defined in advance, several modelers can work simultaneously on a modeling and simulation project, since they can each work on different submodels.
  • It is easy to implement changes and corrections, as they should be made in one or a few simple submodels.
  • The modular structure enables partial testing of a model, i.e. testing component by component.
  • The modularly developed model is extremely convenient for documentation purposes.
  • The modular hierarchical approach enables the modeling of components that can be used in different models, not just in the models for which they were developed.

Submodels can be physical operations or simply used as ways to perform calculations or do complex decision making. A submodel may take simulated time or could be performed in zero time. All activity and route times could be set to zero and might only be used to set conditions, make calculations or write out statistics under varied conditions.

7.2 – Benefits of Using Hierarchical Modeling

Any number of hierarchical levels can be defined and any model can have any number of submodels, although the same model may only be referenced once in a model hierarchy. Hierarchical modeling provides the following benefits over single level modeling:

• Simplifies the steps to visualize large processes.

• Provides a structured way to organize a model.

• Permits reuse of common submodels.

• Enables people to work on portions of the same model without interfering with each other.

7.3 – Defining Hierarchical Models

Four Easy Steps

Defining hierarchical models in ProcessModel is easy. It is a simple four step process. These steps are listed below and explained in detail throughout this section.

1. Create the main model chart.

2. Create a submodel chart.

3. Reference the submodel chart from the main model.

4. Name all input and output connections of the representative activity in the main model with the same names as the corresponding connections in the submodel.

How It Works

With the activity connections in the main model mapped by name to connections in the submodel, entities arriving or routing to the activity in the main model will actually enter the activity in the submodel that has an input connection with the same name as the arrival or routing connection in the main model. The entity remains in the submodel until it encounters a routing having the same name as an output routing from the representative activity in the main model (see diagram on the following page). Entities can also be allowed to exit the system from within a submodel or go to lower submodels. Where appropriate, the same name can be assigned to multiple connections in a chart.

7.3.1 – Creating the Main Model Chart

By definition the main model is the model one level higher than the submodel in the hierarchy. If you have more than two levels, a submodel to an upper level may also be a main model to a lower level in the hierarchy. The only thing that distinguishes a main model from any other model is that at least one activity has been selected to represent a submodel, with the submodels chart file referenced in the Submodel tab of the properties dialog.

Usually a main model defines a process in general terms, the representative activities having a generalized time specified. The representative activity is only executed when you opt to disable submodels in the Simulation/Options dialog. When the model is simulated with the submodels, the representative activity is ignored and the detail of the submodel is executed.

7.3.2 – Creating the Submodel Chart

To create a subchart, simply begin a new flowchart in ProcessModel and place the activities, connections, and any other objects, defining the submodel on the layout.

Then enter the necessary data in the properties dialog for each object and save the file. You can graphically link each sub chart to the main chart so that a right-mouse click will move you from one level to the next.

How To – Create a Link to a Submodel

1. Open the SubModel tab for the process that will be represented by a subprocess.

2. From the Submodel tab, select the Browse button to link to an existing submodel or type in a new name to create a submodel.

3. Select the Activate button to move to the submodel.

Submodel tab in properties dialog of ProcessModel

 Submodel tab will not show on 50 object licenses.

4. If you are linking to an existing submodel, you will now see that model. If you are creating a new submodel, you will now see a blank layout. Build the subprocess on this layout.

5. Name the connecting routes. For more information on naming connecting routes see “Connection Naming” in Chapter 7.3.3.

Important information to be aware of Submodels may be created independently and linked at a later time by linking to an Existing File, however it is helpful to create the overall structure of the model at the beginning of the modeling project.

6. Saving and exiting from the subprocess will return you to the main process.

Important information to be aware of Always travel down to a submodel by using the activate button and close submodels when moving to a higher level model. The opening and closing of the models forces the update of Attributes and Variables in each model (i.e. the variables and attributes will be copied in both directions so that all action logic can be executed).

Important information to be aware of Always travel down to a submodel by using the activate button to make changes. Do not make changes directly to the submodel by opening it without opening from the main model.

Arrivals in the Submodel Chart

You can create a submodel with its own entities and arrivals if you want to test it independently. Arrivals get automatically replaced with inputs coming from the main model when linked into another model, unless no routings or arrivals in the main model map to the arrival in the submodel.

Arrivals and exits in a submodel

Remember that the routing of entities coming into the submodel from the main model is controlled by the routing or arrival defined in the main model. Likewise, the routing of entities coming from the submodel into the main model is controlled by the routing defined in the submodel.

Naming Variables and Attributes

When naming attributes and variables to be used in a model that will use hierarchical models, you should give each attribute and variable throughout the model a unique name to avoid confusion and unexpected results. Keep in mind that all variables are global. If you define the same attribute or variable in a submodel that was defined in the main model, there will be only one attribute or variable, and it may be used throughout the entire model.

So if you are creating complex models using hierarchical modeling, you may want to establish some internal naming conventions, especially where teams are involved in the modeling project.

Delete Attributes and/or Variables and/or Scenario Parameters

Linked hierarchical model files synchronize data when you save each file. When you delete a variable, attribute, or scenario parameter in one model file, it is added back in from the other linked files during synchronization.

  1. Unlink your hierarchical model files.
  2. Make your change in each file and save it.
  3. Re-link the hierarchical structure

7.3.3 – Connection Naming

Once you establish representative activities and reference them to the subchart, you need to name the connections into and out of the representative activity in the main model that will route to or from activities in the submodel. Then you need to assign matching names to the corresponding connections in the submodel.

The Name tab on the properties dialog for arrival and routing connections allows you to give the connection a name.

Connection naming in a submodel

Connection name: The name of the connection. Connections that route entities to the submodel or back to the main model may have the same name, but there can only be one connection to which the entities are routed as shown in the illustration below.