Page 649 - ExtendSim User Guide
P. 649

Step 2: Build the submodel
To build a submodel in a hierarchical block, add blocks to the submodel pane using the same methods used to build the Reservoir model in the Tutorial on page 24. For instance, use the Library menu to add blocks to the sub- model pane (or drag them from library win- dows) and connect blocks in the normal fashion.
If you prefer, use the Copy and Paste com- mands from the Edit menu to copy a portion of an existing model into the submodel pane.
For example, the Water Sources hierarchical block in the example at right contains three connected blocks from the Value library: a Lookup Table block labeled Rainfall, a Ran- dom Number block labeled Stream, and a Math block set to add its inputs.
Step 3: Modify the icon
Presentation 623
Hierarchy
Hierarchical block structure window with submodel added
The hierarchical block starts with a default icon, a white square. You can modify this icon, for example by changing its shape or color, or you can delete it and create a new one. To do this, draw an icon with the drawing tools in the toolbar, or paste a picture from another program. For information on using the drawing tools, see “Graphic shapes, tools, and commands” on page 639.
Step 4: Add connectors
Since the model within a hierarchical block needs to be connected to the outside world, you must add the appropriate connectors. Some hierarchical blocks have both input and output con- nectors, while others have just one kind. Also, as is true for other blocks, hierarchical blocks use specific types of connectors (value, item, flow, etc.) depending on what they are connected to.
The steps for adding a connector to a hierarchical block are: 1) Decidethetypeofconnectortoadd.
2) Addtheconnector.
3) Determineiftheconnectorshouldbeaninputoranoutputconnector. 4) Connecttheblocksinthesubmodelpanetotheconnector’stextlabel.
How To


































































































   647   648   649   650   651