|
Objects in this document may appear out of sequence if not viewed with Internet Explorer |
|
ORMSware NMOD hands-on tutorial: Chapter 4 |
|
|
If you wish to print this document, please set your browser page margins to <= 0.5 inches. |
In this chapter you will learn the following (though not necessarily in the order listed):
We will build networks of the model Primer described in NMOD Primer Chapter 12 (Working with Visio interface and NET file). We will identify this model as tPrimer in this turorial.
If you have not already read at least through Chapter 12 in the primer, we recommend that you do so now. If it gets to be too much to read in one stretch, you may want to switch between the Primer and here to understand things little by little, a few steps at a time.
If PrimerVSD window from the Primer is not already open, click here to bring it up so that we can use it as a guide to place objects in the exercise below.
| Note: When Visio 2002 creates Web files, lines around Support nodes that should show up with dashed gray lines around them show up as solid gray lines on some monitors. |
Bring up tFigure1.VSD from c:\ORMSware\Tutorial\Chapter4 folder. Save it as tPrimer.VSD in c:\ORMSware\Tutorial folder. To make tPrimer model consistent with Primer model, we need to move things around a little. Going through these steps will also give you plenty of experience in working with ORMSware's Visio interface.
| Caution: Be sure to save your work as we go along into c:\ORMSware\Tutorial, even though we do not suggest it with sufficient frequency in this tutorial. If you should not save your work while we are temporarily showing you something, we will indicate so. |
Move n[1] under n[3]. If you want to ensure that [1] stays at the same horizontal level, keep the Shift key down while dragging [1] to under [3]. You could also move it using right arrow key as we explained in Chapter 3 (Building ORMSware networks - basics). a[6] will now bend around [1], but no need to bother reconnecting it now (unless you want to, for practice), since we will be deleting it next.
|
Node colors indicating Type property values |
Delete a[6]. You can do so by selecting it and pressing the Delete key. Drag Node object from stencil to drawing area to get Visio to create a node object with ID value of 6 (recall Visio's last-out-next-in rule for assigning ID values for a newly created object). When on-drop mini dialog box pops up, enter/change property values per the list below:
Name : Initializations
Type : Start Node
Description : Initializations, etc.
Transformation/control : {}...
Notice that the node's color has changed to green. If you would like to find out colors of other node Types, double-click on the node and try different Type property values. While at it, also change the Role property of [6] to Support.
|
Ellipses indicating more property logic content in NET file |
The ellipses immediately following the right brace of the Transformation procedure property of n[6] above indicate that NETrans should look in the model's NET file (Primer.NET) for more logic describing the property. If we had the (planned) IDE, we could have clicked on the ellipses and a window would have popped up for entering/modifying logic complementing the one-line entry in the Node dialog box. In the absence of the IDE, we have to use a crude approach for creating and modifying NET files.
| Note: We have not created a NET file for model tPrimer, but we can do it anytime we want. So, let us hold off on that until a little later when we will let NETrans create the NET file for us with appropriate placeholders for all network objects in the model's Visio file [and their properties]. Then we can go in and modify the NET file as necessary. |
To make tPrimer model appear consistent with Primer use a[9] to connect [1] to [3], move [8] to connect [2] to [3] (you may want to move [7] out of the way first), and connect [4] to [5] with [7]..
Drag Arc object from the stencil and move its tail around the top edge of n[3]. Release the arc when the hot point is on the connection point in the middle of [3]'s top edge. A mini arc dialog box pops up. Change Type property to AND-arc (-->>|), delete Description??? in the Description text box and click OK. The ID of the arc should show up as 10. Connect [10]'s head to [5].
Duplicate [10], creating a[11]. Change its Type to OR (--->|) and use the arc to connect [6] to [2]. Double-click [11] and change the arc's Role property to Support (we will stop including "Click OK" always, since it goes without saying in instances such as this).
Duplicate [10] again. The object's ID will be 12. Connect [2] to [4] with [12]. Notice that this is a new relationship description. With this arc we are stating that labor cost per hour is a function of pieces per hour. a[12] does not have to be an AND arc, since calculations in [4] do not depend on anything else. There is no need to change [12] from AND to OR, however, but feel free to change it, if you wish, as we have.
Create an arc (its object ID will be 13), connect [2] to [1] with it, and modify its properties as below:
Type: -->>|
Description: Customer ID <= 1
Branch condition: {CustomerID() <= 1}
Role: Support
Network Name
To be consistent with Primer model let us drag the Network Name object from the stencil to the page next. It's object ID [14] will be displayed in light gray to the left of the name.
While we are at it, let us also change the name of the network/page. Double-click the tab at the bottom left of the drawing page. Network will be highlighted. Type in CostPerPiece [and hit Enter]. Reposition the page, if necessary, using scroll bars. Notice that the network name display has changed to [14] C:\ORMSware\Tutorial\tPrimer.vsd(p 1 of 1): CostPerPiece.
|
The Role property of a network object |
Create another arc ([15]), connect [5] to [2] with it, and change/enter its properties as follows:
Type: --->|
Description: CurveBuild mode AND PiecesPerHour < PiecesLim
Branch condition: {&L.CurveBuild}...
Trans: {@D.PiecesPerHour = @D.PiecesPerHour + &B.PiecesIncrement}
Role: Support
Duplicate previously created a[13] to create one final arc ([16]) and connect [2] to [3] with it (in parallel with [8]) and change/enter its properties as follows:
Description: Customer ID > 1
Branch condition: {CustomerID() > 1}
Recall from Primer Chapter 12 that we are setting up this model to calculate several CostPerPiece values by executing the sequence of calculations in the model several times; that after the first iteration, we did not want to execute n[1] again; that in order to trigger [3] during iterations 2 and higher without having to wait for flow from n[1], we wanted to create an OR flow from n[2] to n[3].
a[16] is the OR arc we are using to accomplish the above during iterations > 1. This role a[16] plays in the model is more of a "Support" nature than a "Primary" nature. While [16] is obviously essential for cranking the model, we may want to choose, to the extent it makes sense, just one arc to show the dependency of calculations in [3] on calculations in [2].
Since [8] is active in all scenarios (curve-building or single point calculation), it appears to be a good choice for this "Primary" role. Hence, we would like to push a[16] to the back of the viewer's mind. The cases of n[6], a[11], a[13], and a[15] are also similar to this. That is why we defined their Role to be Support as in the case of [16].
As you have seen, changing an object's Role property causes changes in its display properties. The arc line has changed to gray dashes and display of the Description property and other text have changed to gray as well. A Support network object has exactly the same functional properties as its Primary-role counterpart. The difference is only in display cosmetics..
|
Description property |
We will describe the obvious role of the Description property of network objects after we make the following change to [8].
We need to change the Branch property of [8]. The condition for travel along that arc is the same as that of the condition for traversal of [13]. We can leverage what we have already typed in elsewhere to make this change easily as follows:
If you made the optional change suggested above, or if you look at Description property of [13], [15], [16], etc., you will notice that [8]'s Description displays branch condition in quickly understandable terms as Customer ID <= 1. But, NMOD does not pay attention to Description property of network objects. It is strictly a device for the analyst to communicate what the model does with other stakeholders of the model.
To be understandable to NMOD, we have to express branch condition as we expressed in the Branch property text box. CustomerID() is a NMOD function that retrieves Customer ID property value of a customer token. NMOD functions (such as CustomerID) available to users are listed and explained in Appendix A of the Primer.
We need to create a network for calculating the number of pieces per hour required to support the production operation we are modeling with the tPrimer model. Then, we want to reference that network in the top level network we have been developing.
To accomplish this, change n[2]PiecesPerHour's Type to Network. Notice what happened to the node's color and line style (yellow and thicker).
When NETrans translates CostPerPiece network, it will see the reference to a network called PiecesPerHour imbedded in n[2]. So, it will look in tPrimer's html export file for a network/page with the name PiecesPerHour (we covered html report/export in Chapter 2 (Quick hands-on tour of the NMOD modeling process). NETrans will issue an error message and log it in tPrimer.ERN file if it does not find the referenced network.
So, let us create the PiecesPerHour network. When we go through the process below to create a new network/page, Visio will ask us for a page name. So, let us have the name ready in the clipboard so that we can just paste it in.
| Note: Alternatively, you can skip the first step above and go straight to insert a new page. When the Page Setup dialog box pops up, you can leave everything as is and click OK. You can change the name of the page at any time you wish as we did in the Network Name section earlier. |
A new blank page is displayed. Change the zoom level (towards the top right-hand side of the window) to the level you prefer. Switch to PrimerVSD window (click PiecesPerHour tab) for reference. Create network objects [and enter their contents] in the sequence presented below and position them as displayed in PrimerVSD window.
In [1]...
Name : Product A
Description : Number of pieces required per hour for Product A
Transformation/control : {#D.ProdApieces = 10}
In [2]...
Name : Product B
Description : Number of pieces required per hour for Product B
Transformation/control : {#D.ProdBpieces = 20}
In [3]...
Name : Dummy node
Type: Start Node
Description : Just a dummy node serving as start node of this network
Role: Support
In [4]...
Name : PiecesPerHour
Type: Return
Description : Total pieces required per hour
Transformation / control : {@D.PiecesPerHour = #D.ProdApieces + #D.ProdBpieces}
In [5]...
Type: AND (-->>|)
Description:
In [6]...
Type: AND (-->>|)
Description:
In [7]...
Description:
Role: Support
In [8]...
Description:
Role: Support
Drag & drop a Net Name object to the top left of the page. Notice that its Visio-assigned object ID of 9 is displayed in light gray to the left of the Net name.
| Note: We chose to display object IDs with the Net names so that when one scans for object ID sequences on a page, it is easy to see if a given ID value has been assigned to the Net name object on that page before looking at nodes and arcs. |
Save your work [as tPrimer.VSD into Tutorial folder]. If you did not change the name of this page to PiecesPerHour earlier, you may want to follow the process below to make the change (to avoid potential typing errors):
The Tab name changes to PiecesPerHour and Net name object display changes to [9] C:\ORMSware\Tutorial\tPrimer(p 2 of 2): PiecesPerHour.
|
Changing automatically laid-out positions of arcs |
Click CostPerPiece Tab. We have a few more steps to complete in the graphical part of this network before proceeding to creating complementary content in tPrimer model's NET file.
You may want to change the appearance of [13] and [15] to make the horizontal portions of the arcs symmetric about nodes 2 and 3 and/or arcs [8] and [16] as it appears in PrimerVSD window. To accomplish that click on (select) the desired arc and move the cursor over the green handle in the middle of the horizontal portion of the arc. The cursor changes to a small vertical line with arrowheads on both ends. Click down and drag the horizontal portion of the arc to where you want to position it and then release the button.
|
Changing default format of an arc's text block |
Let us also go through the process of changing the text block size and rotating of text on arcs.
Select (say) a[15]. Locate the big A icon on the tool bar. Be sure you are not choosing the big A with a thick underscore (when you put the mouse over the A we want, a bubble message will display Text Tool). Click on the down arrowhead to the right of the icon and choose Text Block Tool. The cursor changes to a plus sign and a tiny rectangle with horizontal lines in it, and the text block on the arc gets surrounded by green circles and rectangles.
When you move the mouse over the green squares, the mouse icon will change to double-headed arrows for changing text block size. When you move it over green circles, the mouse icon changes to a circular arrow for rotating text block. Notice that you can also move the entire text box vertically or horizontally by grabbing and moving the gray center point.
Experiment changing the text block width and rotating text to see how the two options work. You may want to change the text block widths of [8], [13] and [16] such that they appear as displayed in PrimerVSD window.
|
Callout object |
Select arrow icon towards the left of A icon on the tool bar.
Sometimes text blocks in nodes and arcs are insufficient to communicate important information about a model. As you can see in PrimerVSD window, we have used a callout object to communicate additional information about a[15] and model execution. We wanted to communicate to the reviewer that [15] is relevant only if we are generating arrivals of multiple customers (i.e. curve points in the case of this model). The way we modeled that was by defining the Type property of [2] to be Arrival. That is what we have described in the callout object.
Drag and drop a Callout object to any location you desire in tPrimer.VSD. Have it point to a[15].
Callout objects are comprised of 3 objects so ID values displayed in text portion of callout objects (top left) will reflect this fact, though when you first drop a callout object on the page, its ID number may show up as 7. This will change to correct ID value when the file is saved.
You can type over a Callout object's ID, but we recommend that you not do so (if you liked the explanation earlier of why object IDs are displayed in Net name objects). Double-click the callout object (or select and press F-2) to type in or copy & paste the following in its text block, and then size the object to your satisfaction:
CurveBuild mode is automatically set to True at the beginning of model run by user-supplied logic in n[6] whenever n[2]’s Type property is detected to be Arrival.
In the next chapter we will export the information we need from tPrimer's Visio networks into an html file. Then we can translate that html file with NETrans, as we did in Chapter 2, to create tPrimer's NET file. We can then use the placeholders created by NETrans to store additional content necessary to describe the behavior of some of the objects in tPrimer's networks.
Save tPrimer.VSD into C:\ORMSware\Tutorial\Chapter5. Close PrimerVSD window.
|
Click to go to Chapter 3: Building ORMSware networks - basics |
|
Click to go to Chapter 5: Storing more content in a model's NET and ADD... |
|
Click to go to Introduction and table of contents |