Download - Addendum ExtendSim

Transcript
Page 1: Addendum ExtendSim
Page 2: Addendum ExtendSim

ISBN: 978-0-9825040-3-1

Copyright © 2010 by Imagine That Inc. or its Licensors.

All rights reserved. Printed in the United States of America.

You may not copy, transmit, or translate this manual or any part of this manual in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retriev-al systems, for any purpose other than the purchaser's personal use without the prior express written per-mission of Imagine That Inc.

License, Software Copyright, Trademark, and Other Information

The software described in this manual is furnished under a separate license and warranty agreement. The software may be used or copied only in accordance with the terms of that agreement. Please note the following:

ExtendSim blocks (including icons, dialogs, and block code) are copyright © by Imagine That Inc. and its Licensors. ExtendSim blocks may contain proprietary and/or trademark information. If you build blocks, and you use all or any portion of the blocks from the BPR, Discrete Event, Flow, Item, Items (db), Mfg, Rate, SDI Tools, or Quick Blocks li-brary in your blocks, or you include those ExtendSim blocks (or any of the code from those blocks) in your libraries, your right to sell, give away, or otherwise distribute your blocks and libraries is limited. In that case, you may only sell, give, or distribute such a block or library if the recipient has a legal license for the ExtendSim product from which you have derived your block(s) or block code. For more information, contact Imagine That Inc.

Imagine That!, the Imagine That logo, ExtendSim, Extend, and ModL are either registered trademarks or trademarks of Imagine That Incorporated in the United States and/or other countries. Mac OS is a registered trademark of Apple Computer, Inc. Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation. GarageGames, Inc. is the copyright owner of the Torque Game Engine (TGE), Simulation Dynamics, Inc. is the copyright owner of SDI Industry, Wolverine Software Corporation owns the copyright for Proof Animation, and the copyright for Stat::Fit® is owned by Geer Mountain Software. TGE, SDI Industry, Proof Animation, and Stat::Fit are licensed to Imagine That, Inc. for distribution with ExtendSim. All other product names used in this manual are the trademarks of their respective owners. All other ExtendSim products and portions of products are copyright by Imagine That Inc. All right, title and interest, including, without limitation, all copyrights in the Soft-ware shall at all times remain the property of Imagine That Inc. or its Licensors.

Extend was originally created by Bob Diamond

Chief architects for ExtendSim 8:Bob Diamond, Steve Lamperti, Dave Krahl, Anthony Nastasi, Cecile Damiron, Peter Tag

Graphics, documentation, and production for ExtendSim 8:Carla Sackett, Pat Diamond, Kathi Hansen

Imagine That Inc. • 6830 Via Del Oro, Suite 230 • San Jose, CA 95119 USA408.365.0305 • fax 408.629.1251 • [email protected]

www.extendsim.com

Page 3: Addendum ExtendSim

Table of Contents

Page 4: Addendum ExtendSim

T2 Table of Contents

Table of Contents

About This Addendum

Using the ExtendSim 8 Addendum .........................................................................................2How the Addendum is organized ............................................................................................2Summary of ExtendSim 8 changes ..........................................................................................2

New features and blocks..................................................................................................................2Enhancements to the user interface and existing blocks ...................................................................3

Upgrading from ExtendSim 7 .................................................................................................4Installing ExtendSim 8 ....................................................................................................................4Running ExtendSim 8.....................................................................................................................5Legacy files......................................................................................................................................5

Upgrading from Extend 6 or earlier.........................................................................................6Legacy libraries and files ..................................................................................................................6New product names ........................................................................................................................6Installing and running ExtendSim 8................................................................................................7

Technical support....................................................................................................................7Sources of support...........................................................................................................................7Assistance from our support staff.....................................................................................................7

User Guide Addendum

Equations & Equation-Based Blocks ................................................................... 9Overview.................................................................................................................................10List of equation-based blocks...................................................................................................10Equation components .............................................................................................................10

Input variables.................................................................................................................................11Output variables..............................................................................................................................12

Equation Editor ......................................................................................................................13Debugging equations ..............................................................................................................14

Starting the tutorial .........................................................................................................................14Setting breakpoints..........................................................................................................................15Stepping through the code ..............................................................................................................15Getting to the overflow calculation..................................................................................................16Setting a conditional breakpoint......................................................................................................16

Include files for equations........................................................................................................17Queue Equation block ............................................................................................................18

How the block works ......................................................................................................................19Variables..........................................................................................................................................19Ranking rules ..................................................................................................................................20

Query Equation and Query Equation(I) blocks.......................................................................20How the blocks work ......................................................................................................................21Spawned items ................................................................................................................................21Variables..........................................................................................................................................22Ranking rules ..................................................................................................................................24

Page 5: Addendum ExtendSim

Table of Contents T3

Differences between the query blocks ..............................................................................................24DB Job Shop Query model .............................................................................................................25

ExtendSim Databases ...........................................................................................27Overview ................................................................................................................................ 28Database commands ............................................................................................................... 28

Edit Table Properties (Database menu)............................................................................................28Edit Field Properties (Database menu) ............................................................................................28Read/Write Index Checking ............................................................................................................28Show Reserved Databases (Develop menu) .....................................................................................28

Table Properties dialog............................................................................................................ 29Save and Next Field button..................................................................................................... 29New “Overwrite and Delete” button....................................................................................... 29Reserved databases .................................................................................................................. 29Improved DB Add-In ............................................................................................................. 29

Check Database Consistency...........................................................................................................30Find Database Table........................................................................................................................31Other Add-In enhancements...........................................................................................................31

Scenario Manager .................................................................................................33Scenario analysis ..................................................................................................................... 34How the Scenario Manager works........................................................................................... 34Tutorial I (dialog parameters).................................................................................................. 35

Steps ...............................................................................................................................................35Add the Scenario Manager block.....................................................................................................35Identify and add factors and values..................................................................................................36Identify and add targeted responses .................................................................................................38Determine what will be in the report...............................................................................................39Select the DOE and run scenarios ...................................................................................................39Analyze results.................................................................................................................................40Export the results (optional)............................................................................................................40

Tutorial II (database variables) ................................................................................................ 41Targets and sources..........................................................................................................................41Open the model ..............................................................................................................................43Create a database structure for the model ........................................................................................44Create a source list (optional) ..........................................................................................................45Link to the target table ....................................................................................................................45Enter database factors......................................................................................................................45Generate and run the scenarios........................................................................................................46

DOE methods ........................................................................................................................ 46Comparison with other analysis methods................................................................................ 46

Advanced Resource Management .........................................................................49Resource management ............................................................................................................ 50

Resources ........................................................................................................................................50Modeling resources .........................................................................................................................50How to model resources ..................................................................................................................50

Advanced Resource Management............................................................................................ 51How Advanced Resource Management works .................................................................................51

Page 6: Addendum ExtendSim

T4 Table of Contents

Definitions......................................................................................................................................52Tutorial ...................................................................................................................................53Phase I: Adding ARM to a model............................................................................................54

Add the Resource Manager block ....................................................................................................54Resource Pool..................................................................................................................................54Queue .............................................................................................................................................55Resource Pool Release......................................................................................................................56Save and run ...................................................................................................................................56

Phase II: Organizing resources.................................................................................................57Resource Pools ................................................................................................................................58Requirements tab of Resource Manager...........................................................................................59Create a string attribute...................................................................................................................60Save and run ...................................................................................................................................62Results ............................................................................................................................................62Gathering statistical information .....................................................................................................63

Phase III: An alternate method for creating pools ....................................................................63Use a Resource Manager to create a pool and resources ...................................................................63Create a resource requirement .........................................................................................................65

Additional information ...........................................................................................................67Groups ............................................................................................................................................68Resource orders ...............................................................................................................................69Status and transitions ......................................................................................................................69Properties ........................................................................................................................................70Release rules ....................................................................................................................................72Policies ............................................................................................................................................73

Resource requirements ............................................................................................................74Hierarchy of a resource requirement................................................................................................74Steps to take before creating ............................................................................................................74How to create a new resource requirement ......................................................................................75Filtering conditions .........................................................................................................................75Quantity expressions .......................................................................................................................76Resource requirements ....................................................................................................................79Default resource requirements .........................................................................................................80

Comparison of the three resource methods..............................................................................81The Advanced Resources database ...........................................................................................82Blocks that compose the ARM system.....................................................................................82Primary transactions for ARM.................................................................................................83

Item-initiated ARM transactions .....................................................................................................84Resource Pool-initiated ARM transactions ......................................................................................86Shift ................................................................................................................................................87

Block Changes ..................................................................................................... 89Hierarchical blocks..................................................................................................................90New blocks in libraries ............................................................................................................90Changed blocks in libraries .....................................................................................................91

Value library....................................................................................................................................91Item library .....................................................................................................................................92Rate library .....................................................................................................................................94Utilities library ................................................................................................................................94

Page 7: Addendum ExtendSim

Table of Contents T5

Odds and Ends .....................................................................................................953D animation ......................................................................................................................... 96

Stacking overflows...........................................................................................................................96Collision avoidance .........................................................................................................................96Hierarchical blocks and 3D animation ............................................................................................96Shelf object .....................................................................................................................................96

File menu change.................................................................................................................... 96Network License .............................................................................................................................96

Edit menu changes.................................................................................................................. 98Open Dynamic Linked Blocks command........................................................................................98Options command ..........................................................................................................................98

Develop menu changes ........................................................................................................... 99Show Reserved Databases................................................................................................................99

Run menu changes ................................................................................................................. 99Run Optimization or Scenarios .......................................................................................................99

Other interface changes .......................................................................................................... 99Getting Started model .....................................................................................................................99

Miscellaneous ......................................................................................................................... 100Other item properties......................................................................................................................100

Developer Reference Addendum

Programming Techniques .....................................................................................101Reserved databases .................................................................................................................. 102

Example ..........................................................................................................................................102Creating and editing .......................................................................................................................102

Remote access to dialog variables ............................................................................................ 103Custom remote blocks interfacing with a stand-alone block ............................................................103Custom stand-alone block referencing remote dialog variables ........................................................103

Registered blocks .................................................................................................................... 105COM DLL example ............................................................................................................... 105Integer arrays .......................................................................................................................... 106

Messages, Variables, and Functions ......................................................................107Menu and keyboard equivalents for developers ....................................................................... 108

Develop menu.................................................................................................................................108Run menu.......................................................................................................................................108

Menu command numbers for new commands ........................................................................ 108Messages ................................................................................................................................. 108

Simulation messages........................................................................................................................109Dialog messages ..............................................................................................................................1093D Animation messages ..................................................................................................................109

System variables ...................................................................................................................... 109CurrentScenario ..............................................................................................................................109NumScenarios.................................................................................................................................109

Functions................................................................................................................................ 110Function returns .............................................................................................................................110

Page 8: Addendum ExtendSim

T6 Table of Contents

Math functions ...............................................................................................................................110I/O functions ..................................................................................................................................111E3D animation ...............................................................................................................................111Blocks and inter-block communication ...........................................................................................112Models and notebook......................................................................................................................114Scripting .........................................................................................................................................115Database functions ..........................................................................................................................116Pointer functions.............................................................................................................................120

Index to the Addendum

Index .................................................................................................................... 121

Page 9: Addendum ExtendSim

User Guide Addendum

About This Addendum

Page 10: Addendum ExtendSim

2Using the ExtendSim 8 Addendum

Intr

o

Using the ExtendSim 8 AddendumThis Addendum reflects the changes made to ExtendSim for release 8. It is a supplement to the two printed manuals – ExtendSim User Guide and Developer Reference – which were released with ExtendSim 7.

The electronic versions of the User Guide and Developer Reference have been updated for release 8 and are located in the ExtendSim8\Documentation folder. To access those two documents, give the command Help > ExtendSim Help.

How the Addendum is organizedTo describe the features that are new to v8, the Addendum is organized into these main sections:

1) This Introduction gives a brief overview of the new features as well as information for those who are upgrading from releases prior to ExtendSim 8.

2) User interface and block-level changes and additions. Pages 10 to 100 of the Addendum sup-plement the printed User Guide. This section describes new and changed features and blocks that you can use when building models.

3) Changes and additions to the development environment. Starting on 102, this Addendum supplements the printed Developer Reference. In addition to new features, this section also describes the new or changed functions, message handlers, and system variables. You use these in equations or when modifying/building blocks.

Wherever possible, the appropriate page or section of the printed User Guide or Developer Refer-ence is noted. Note however that the electronic versions of the User Guide and Developer Refer-ence have been updated for release 8.

Summary of ExtendSim 8 changesRelease 8 added the following features and enhancements to release 7. (As noted below, some fea-tures and enhancements are specific to certain ExtendSim products.)

New features and blocks1) Enhanced equation capabilities (all products)

• Equation Editor. While you can still enter equations and use code completion in the block’s equation area, the new Equation Editor window can be resized to fit larger equa-tions, has tabs for indenting, and allows code colorization, matching braces, and more.

• Equation Debugger. This works like the current ExtendSim source code debugger, but is specific to equation-based blocks. You can set breakpoints and conditions for equations, step through lines of code, and examine values of variables.

• Include files for equations. You can now call an include file from an equation-based block. This simplifies maintenance when a set of commands (definitions, assignments, and functions) has more than one use. Like ModL in general, include files allow functions and message handlers to be overwritten and compilation to be conditional.

• More input and output variable types. These predefined variable types make it easier to create equations.

2) Scenario Manager (ExtendSim AT and Suite). The Scenario Manager block (Value library) is used to design and run experiments on models. The objective is to explore the projected out-comes that result when a model’s inputs are varied. Each experiment has a different set of

Page 11: Addendum ExtendSim

3Summary of ExtendSim 8 changes

Intro

inputs and thus different results. All data is stored in an ExtendSim database to facilitate analy-sis; data can be exported to JMP or Excel for further analysis.

3) A Getting Started model(all products). A new model file, Getting Started, appears as a win-dow each time you launch ExtendSim. Use it to open a recent model file, open a new model worksheet, view video clips, and access example models and other informative files.

4) Advanced Resource Management (ExtendSim AT and Suite). The Advanced Resource Man-agement System allows a sophisticated resource structure to be defined, including hierarchies of resource types and a complex set of requirements for how those resources get allocated to items. It provides interfaces for creation and editing (of resources, resource pools, groups of resources, resource properties, resource requirements and release rules), and produces auto-matic logs of resource allocations, release, and state transitions.

5) New Query Equation and Query Equation(I) blocks (ExtendSim AT and Suite). These blocks are used to rank the records in an ExtendSim database and intelligently select one record, based on a ranking rule entered in a user-defined equation. Query blocks are especially useful when a database holds information that is required for making decisions in a model.

6) New blocks (all products). Other new blocks include Block Info, DBStatistics, Link Alert, Model Interface, MYOB DB Dialogs, and Slider.

7) Preloading of libraries (all products). Depending on the particular product, the major librar-ies shipped with ExtendSim preload by default.

8) Shift-click support (all products). You can now Shift-click an appropriate dialog item to add variables to certain blocks. Developers can also add Shift-click support to their custom blocks.

9) New user-requested functions, system variables, and message handlers.

10) The annual Maintenance Plan now includes technical support, as well as upgrades to major releases, for all single-user (stand alone) licenses of ExtendSim.

Enhancements to the user interface and existing blocks1) Reporting and controlling block contents (Item library of ExtendSim OR, AT, and Suite).

Queue blocks and the Activity now have a Contents tab that displays either current contents or a historical log. You can also track any number of item attributes. The Executive block’s new Item Contents tab allows you to remotely control the settings (such as choosing current or his-torical log and which attributes) in the Contents tab of selected blocks.

2) Improved ExtendSim DB Add-In for Excel (ExtendSim AT and Suite). The ExtendSim DB Add-In now has new features to help when creating and using ExtendSim databases:

• Two new menu commands: Check Database Consistency and Find Database Table

• Enhancements for parent/child fields, including color-coding

• Improvements to the Status bar

• Faster run times when importing data

3) Enhancements to the ExtendSim Database (all products) include:

Page 12: Addendum ExtendSim

4Upgrading from ExtendSim 7

Intr

o

• A Save and Next Field button in the Field Properties dialog, so fields can be added more quickly to database tables.

• A new Table Properties dialog that allows records to be deleted at the beginning of a new simulation run or at the beginning of a multi-run simulation.

• A new “reserved database” feature so programmers can provide database capabilities with-out the modeler being aware of the database.

4) Improvements to the E3D animation (ExtendSim Suite).

• E3D window mount stack limit counts the number of objects; if more than a specified number, that number will appear on the top of the stack.

• Improved collision handling, including complete control over how collision works if you program custom code.

• A new interface that allows you to select multiple blocks within a hierarchical block to be represented by 3D objects.

5) Improved calculations in the Rate library (ExtendSim AT and Suite). The LP calculations have been enhanced and performance has been improved.

6) Enhancements to existing blocks (appropriate products). Significant enhancements to a number of blocks in the Item, Value, and Utilities libraries.

7) Copying and deleting rows in the middle of a data table. A new mechanism for copying and deleting rows in the middle of the table. Also, when the number of rows is increased, the contents of the original last row is used for the newly added rows.

☞ For a description of all the new features in ExtendSim 8, see the ExtendSim command Help > What’s New in ExtendSim or go to www.extendsim.com/prods_features_new.html.

Upgrading from ExtendSim 7Release 8 builds on the features of release 7. Thus there should be no major issues when upgrading. Some things to consider are:

Installing ExtendSim 81) While it is unlikely that there will be any problems, please back up before installing. Our tech-

nical support people often work wonders, but they can’t recover your lost or overwritten files.

2) Install ExtendSim 8 by following the instructions on the separate Installation Guide.

3) For Windows, the installer will separate the ExtendSim files into two different locations:

• The ExtendSim application and other files that are not meant to be modified (such as the User Guide and the License Agreement) will be installed in the folder Program Files\ExtendSim8.

• User-modifiable files, such as example models, libraries, and extensions, will be installed in your Documents folder. Typically this would be located at C:\Documents and Settings\My Documents\ExtendSim 8.

4) If you have created custom models, blocks, include files, DLLs, and so forth:

• Copy your models to the ExtendSim8 folder. (For Windows, this will be located in the My Documents folder.)

Page 13: Addendum ExtendSim

5Upgrading from ExtendSim 7

Intro

• Copy custom libraries to the ExtendSim8\Libraries folder. (For Windows, this will be located in the My Documents folder.)

• Copy your custom extensions into the appropriate folder within the ExtendSim8\Exten-sion folder. (For Windows, this will be located in the My Documents folder.)

It is strongly suggested that you store backup copies of custom files in a separate folder. That will allow recovery if you accidentally overwrite the files using ExtendSim 8.

5) After installing release 8 and moving your custom files, you may uninstall the ExtendSim 7 application and files. If you decide to instead keep ExtendSim 7 installed, see the next section regarding the Update Launch Control command.

Running ExtendSim 81) Because of the extensive architectural changes, once files have been saved in ExtendSim 8 they

cannot be read by older versions. If you want a file kept as readable by an older version, use the Save As command to rename the file or to save a copy of the file in a different location. The newly saved file can then be used in ExtendSim 8 without overwriting your older file.

If your models have links that were created using the command File > Paste DDE Link, changing the model name and/or location will break the links. Be sure to make a backup copy of any linked models before opening them in ExtendSim 8.

2) A new model file, Getting Started, appears when you first launch ExtendSim. It replaces the old Demo.mox file. Getting Started allows you to open a recent file, open a new file, view video clips, and access example models and other informative files.

3) Because ExtendSim now supports separate Options files, you will need to restate your prefer-ences. This is done in the Edit > Options menu command.

4) Only one instance of ExtendSim can run at a time. If you have more than one release of ExtendSim installed, and you want to open a specific instance of ExtendSim by double-click-ing a model or library file, use the File > Update Launch Control command. (Note: we do not provide technical support for older versions.)

Legacy filesAfter release 6, some libraries were no longer supported; these are called “Legacy” libraries. The Industry database was also replaced and moved to legacy status. And a new 3D animation capabil-ity replaced Proof Animation, the 2.5D product, in ExtendSim Suite.

• So that you can run models built in Extend 6 or prior, most of the Legacy libraries (Animation, BPR, Discrete Event, Generic, Mfg, and Quick Blocks) are included in ExtendSim 8.

• Some Legacy libraries (Flow, Items(DB), and SDI Tools), as well as the Industry database, are not included in release 8.

• Proof Animation is not included in release 8. If you upgraded from Extend Suite 6 to Extend-Sim Suite 7, and you still want to use Proof Animation, contact Imagine That Inc. for a Proof Animation (P4) code. Note: Proof Animation 5 (P5) is only available from Wolverine Corp.

• For help in transitioning out of the Legacy libraries, see the “v6 to v8 Equivalents” file located at ExtendSim8\Documentation. (For Windows, the Documentation folder is located in the Pro-gram Files folder.) This file lists each legacy block and the corresponding new block or feature.

Page 14: Addendum ExtendSim

6Upgrading from Extend 6 or earlier

Intr

o

Legacy libraries have not been updated since release 6, are not supported, and will not be shipped in later versions. They are only supplied in release 8 so that you can run older models. They should not be used when building new models.

Upgrading from Extend 6 or earlierThere were major and extensive changes between Extend 6 and ExtendSim 7. These changes have been carried forward and will affect how you use ExtendSim 8.

Legacy libraries and filesIn release 7, several libraries (Animation, BPR, Discrete Event, Flow, Generic, Items(DB), Mfg, Quick Blocks, and SDI tools) were replaced by new libraries. In addition, the Industry database was replaced by the new ExtendSim database and Proof Animation was replaced by the new 3D animation capability of ExtendSim Suite.

• The Item library replaced the BPR, Discrete Event, and Mfg (Manufacturing) libraries.

• The Value library replaced the Generic library.

• A Rate library replaced the Flow library.

• The Animation 2D-3D library replaced the old Animation library.

• Built-in features in ExtendSim, as well as in the Item and Value libraries, replaced the Items (DB) and SDI Tools libraries.

• An ExtendSim database capability replaced the Industry database that was included in Extend Suite and Extend Industry.

• A 3D animation feature replaced the Proof Animation software that was in Extend Suite.

Collectively the replaced files are called Legacy files. Those files are no longer supported and should not be used except to run models built in prior versions.

1) So that you can run models built in Extend 6 or prior, most of the Legacy libraries (Animation, BPR, Discrete Event, Generic, Mfg, and Quick Blocks) are included in ExtendSim 8. They are located in the folder \Libraries\Legacy.

2) Some Legacy libraries (Flow, Items(DB), and SDI Tools), as well as the Industry database, are not included in release 8.

3) Proof Animation is not included in release 8. If you are upgrading from Extend Suite 6 to ExtendSim Suite 8, and you still want to use Proof Animation, contact Imagine That Inc. for a Proof Animation (P4) code. (Proof Animation 5 ((P5) is only available from Wolverine Corp.

4) For help in transitioning out of the Legacy libraries, see the “v6 to v8 Equivalents” file located at ExtendSim8\Documentation. (For Windows, the file will be located in the Program Files folder.) This file lists each legacy block and the corresponding new block or feature.

Legacy libraries have not been updated since release 6, are not supported, and will not be shipped in later versions. They are only supplied in release 8 so that you can run older models. They should not be used when building new models.

New product namesWith release 7, Extend was re-branded as ExtendSim and some product names changed. The new product lineup is:

1) ExtendSim CP is the upgrade from Extend CP

Page 15: Addendum ExtendSim

7Technical support

Intro

2) ExtendSim OR is the upgrade from Extend OR

3) ExtendSim AT is the upgrade from Extend Industry

4) ExtendSim Suite is the upgrade from Extend Suite

Installing and running ExtendSim 8Follow the instructions for upgrading from release 7, above.

Technical support

Sources of support• Printed and electronic documentation

• ExtendSim help – in-product block help and tool tips plus online support pages and FAQs (see Support at www.ExtendSim.com)

• Networking –ExtendSim user forums, networks, and blogs (see Links at www.ExtendSim.com)

• From our wonderful support staff (see below)

Assistance from our support staffAfter a 60 day complimentary support period, assistance from our support staff is available either under an annual Maintenance Plan or on a Per-Incident basis.

For concurrent-user (network) licensesFor concurrent-user (network) licenses of ExtendSim – an annual Maintenance Plan for support and upgrades is required. For the first year, the Maintenance Plan is included in the price of the product; it must be renewed annually after the first year. Maintenance Plans cover basic usage questions and troubleshooting by our support staff as well as upgrades to major releases.

For single-user (stand alone) licensesFor single-user (stand alone) licenses of ExtendSim – an annual Maintenance Plan for support and upgrades is optional but highly recommended.

☞ In addition to support and upgrades, a Maintenance Plan provides discounts on special ExtendSim webinars and trainings as well as first looks at upcoming products and features.

1) If a Maintenance Plan is purchased for the license

Maintenance Plans cover basic usage questions and troubleshooting by our support staff as well as upgrades to major releases. A Maintenance Plan subscription can only be purchased when a new single-user license or upgrade is purchased or within 60 days of that purchase.

2) If a Maintenance Plan is NOT purchased for the license

• Our support staff will provide complimentary technical assistance for installation ques-tions or bug reports related to the current release.

• Our support staff will provide complimentary assistance for basic usage questions and troubleshooting for a limited time. This support expires 60 days after the purchase of a new product or upgrade. (A Maintenance Plan may be purchased during this period.)

• For usage questions and troubleshooting after the first 60 days, purchase support on a per-incident basis; each incident is a discussion and resolution of one issue. Per-Incident Sup-port can be purchased from our sales staff or through the ExtendSim store at http://www.extendsim.com/store.

Page 16: Addendum ExtendSim

8Technical support

Intr

o

Page 17: Addendum ExtendSim

User Guide Addendum

Equations & Equation-Based Blocks

Page 18: Addendum ExtendSim

10 Equations & Equation-Based BlocksOverview

Equ

atio

ns

OverviewThere have been several enhancements to the set of equation-based blocks, including new Query blocks, an equation editor, an equation debugger, and the ability to call include files.

List of equation-based blocks

The two new equation-based blocks in release 8 are:

• Query Equation (Value library for ExtendSim AT and ExtendSim Suite only)

• Query Equation(I) (Item library for ExtendSim AT and ExtendSim Suite only)

Equation components☞ Because there were extensive changes to the equation-based blocks in release 8, including more pre-

defined variables and changed terminology, the “Equation components” section of the User Guide has been rewritten. ▲ printed User Guide, page 602-603

The components of an equation are the input variables, the equation, and the output variables.

All of the equation-based blocks have a scrollable area for entering the equation. Most equation-based blocks also have a separate Equation Editor for viewing and editing the equation; it is dis-cussed on page 13.

While you can define local (temporary) input and output variables in the equation area or the Equation Editor, most equation-based blocks also have two tables, Input Variables and Output Variables, for specifying static (permanent) variables. As described below, ExtendSim provides sev-eral pre-defined types of input and output variables you can use in equations.

Block Library Purpose

Equation Value Computes user-defined equations and outputs the results

Equation(I) Item Computes user-defined equations when an item arrives, then outputs the results

Queue Equation Item Stores items and releases them based on the results of user-entered equations. See “Queue Equation block” on page 18.

Query Equation Value (AT & Suite) A user-defined equation selects one record from an ExtendSim database table

Query Equation(I) Item (AT & Suite) A user-defined equation selects one record from an ExtendSim database table when an item arrives

Optimizer Value Finds the optimum value (lowest cost or highest profit)

Buttons Utilities Used to create a push-button interface to a model. Has several predefined buttons plus the ability to define or modify a button using user-defined equations.

Page 19: Addendum ExtendSim

Equations & Equation-Based Blocks 11Equation components

Equations

Input variablesInput variables are the model values used in an equa-tion. With the exception of the Buttons and Optimizer blocks, the equation-based blocks have a table for creat-ing the input variables. Each row in the Input Variables table (shown on right) has a popup menu for selecting a pre-defined type of input variable and a field for its name and value. Variables created here are static (per-manent).

Add rows to the table by clicking the green +/- resize button in the table’s bottom right corner; you can select a different input option for each row.

The Variable Type popup provides many options for input variables, as shown below. For more information about each option, see the blocks’ Help.

Input Variable Type

Equ

atio

n

Equ

atio

n(I)

Que

ue E

quat

ion

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Connector – value input connector X X X X X

DB read value – reads a value from a fixed location in a database table. Specify location in the Variable Value column.

X X X X X

DB read value using attrib – reads a value from a variable database location specified by a DB address attribute

X X X

DB read PRI – reads the Parent Record Index (PRI) from a cell in a Child field. Read location is fixed and is specified in the Variable Value column. See note below.

X X X X X

DB read PRI using attrib – reads the PRI from a variable database location specified by a DB address attribute. See note below.

X X X

DB address – a database address chosen in the Variable Value column. X X X X X

DB database index – a database index chosen in Variable Value column X X X X X

DB table index – a database table chosen in the Variable Value column. X X X X X

DB field index – a database field chosen in the Variable Value column. X X X X X

DB record index – a database record chosen in Variable Value column. X X X X X

Static first run init – a static variable that gets initialized to its starting value only at the beginning of the first run. Specify starting value in the Variable Value column.

X X X X X

Input Variables table

Page 20: Addendum ExtendSim

12 Equations & Equation-Based BlocksEquation components

Equ

atio

ns

For the Variable Name column, use the default names, assign names that have more relevance to the model, or select a name from a popup, depending on the type of variable selected. The type of input variable selected also determines the options for the Variable Value field: enter a value directly, select the value from a database location, and so forth.

☞ The notation PRI (Parent Record Index) is used in blocks that interface with the ExtendSim data-base. It describes the type of value that is being read or written when dealing with a Child field.

☞ The Queue Equation, Query Equation, and Query Equation(I) blocks have additional specific input variable types. See “Queue Equation block” on page 18 or “Query Equation and Query Equation(I) blocks” on page 20 of this Addendum.

Output variablesOutput variables are where the results are recorded when the equation is calculated. With the exception of the Buttons and Optimizer blocks, the equation-based blocks have a table for creating the output variables. Each row in the Output Variables table (shown at right) has a popup menu for selecting a pre-defined type of output variable and a field for its name and value. Variables created here are static (permanent).

Add rows to the table by clicking the green +/- resize button in the table’s bottom right corner; you can select a different output option for each row.

The Variable Type popup provides many options for output variables, as shown below. For more information about each option, see the blocks’ Help.

Static mult run init– a static variable that gets initialized to its starting value at the beginning of each run. Specify starting value in the Variable Value column.

X X X X X

Static open model init – a static variable that gets initialized to its start-ing value when the model is opened. Specify starting value in the Vari-able Value column.

X X

Attribute – the value of the attribute named in Variable Name. X X X

Item quantity – the item’s quantity value. X X X

Item priority – the item’s priority value. X X X

Item index – the item’s index value from the Executive’s item array. X X X

3D object ID – the index of the item’s 3D object. X X X

Input Variable Type

Equ

atio

n

Equ

atio

n(I)

Que

ue E

quat

ion

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Output Variables table

Page 21: Addendum ExtendSim

Equations & Equation-Based Blocks 13Equation Editor

Equations

For the Variable Name column, use the default name, assign a name that has more relevance to the model, or select a name from a popup, depending on the type of variable selected. The Variable Value field reports the results for the selected output variable. In the Equation(I) block there is also a column to specify what should happen to the result if an output is needed but there is no item to trigger the equation’s recalculation.

☞ The notation PRI (Parent Record Index) is used in blocks that interface with the ExtendSim data-base. It describes the type of value that is being read or written when dealing with a Child field.

☞ The Queue Equation, Query Equation, and Query Equation(I) blocks have additional specific output variable types. See “Queue Equation block” on page 18 or “Query Equation and Query Equation(I) blocks” on page 20 of this Addendum.

Equation EditorAs discussed earlier, all of the equation-based blocks have a scrollable area for entering equations. Other than the Optimizer (Value library) and Buttons (Utilities library) blocks, the equation-based blocks also have a separate Equation Editor window for viewing and editing the equation.

Although the equation could be edited within the block’s dialog, there are advantages to editing the equation in the Equation Editor window:

• The Equation Editor window can be resized to fit larger equations

• Tabs can be used for indenting

• Code colorization is allowed, so code is more understandable

Output Variable Type

Equ

atio

n

Equ

atio

n(I)

Que

ue E

quat

ion

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Connector – value output connector X X X X X

DB write value – writes a value to a fixed location in a database table. Specify location in the Variable Value column.

X X X X X

DB write value using attrib – writes a value to a non-fixed database location specified by a DB address attribute

X X X

DB write PRI – writes a Parent Record Index (PRI) to a fixed location in a database table. Specify location in the Variable Value column. PRI is the index of the parent cell that is being written to the child.

X X X X X

DB write PRI using attrib – writes the PRI (see above) to a non-fixed database location specified by a DB address attribute. See note below.

X X X

Attribute – the value of the attribute named in Variable Name X X X

Item quantity – the item’s quantity value X X X

Item priority – the item’s priority value X X X

3D object ID – the index of the item’s 3D object X X X

Page 22: Addendum ExtendSim

14 Equations & Equation-Based BlocksDebugging equations

Equ

atio

ns

• Other editing commands, such as matching braces, are supported

☞ Code completion is enabled in both the equation area and the Equation Editor window (which also has a Code Completion button). Code completion (F8) makes it easier to recall function names and their arguments

To see the Equation Editor:

Open the Reservoir 3 model located at \Examples\Tutorials\Continuous

In the model, open the dialog of the Equation block; it is labeled Calculate Overflow

In the block’s dialog, click Open Equation Editor. The window that opens is shown in the screenshot to the right.

As you can see, the con-tents of the window auto-matically uses the indenting and code colorization features. The Code Completion button at the bottom of the window is useful when searching for a function or to get the correct argument list. To use code completion, type the first part of the function name in the code pane, then click the Code Completion button or press F8. If the function that appears isn’t the one you want, click F8 again until the correct function appears.

Debugging equations▲ printed User Guide, page 618

The equation-based blocks allow you to enter equations that are simple logic statements (if x, then y) or complex calculations that control the model using ModL functions. While in many cases you won’t need to debug the equation, ExtendSim provides an equation debugger so you can deter-mine if equations are performing as expected. This works like the Source Code Debugger Extend-Sim developers use, but it is specific to the equation-based blocks used by many modelers.

The equation debugger allows you to:

• Set breakpoints for equations. A breakpoint is where the debugger initially stops execution of the equation so you can step through the code.

• Set breakpoint conditions for equations. Setting a breakpoint condition causes the breakpoint to stop execution only under certain circumstances.

• Step through lines of code and examine the variables. Step commands allow you to trace the exe-cution of the equation and examine the effects on the variables defined in the code.

Starting the tutorialOpen the Reservoir 3 model located at \Examples\Tutorials\Continuous

So that you don’t overwrite the original model, save the model as Equation Debugging

In the model, open the dialog of the Equation block; it is labeled Calculate Overflow

☞ Although the following tutorial uses a continuous model, the equation debugger can be used with any of the equation-based blocks. For a list of equation-based blocks, see page 10.

Equation Editor window showing overflow equation

Page 23: Addendum ExtendSim

Equations & Equation-Based Blocks 15Debugging equations

Equations

Setting breakpointsTo step through each line of code, it is first necessary to stop the code execution. In this example, it requires placing a breakpoint before the “if ” statement at the beginning of the equation:

In the dialog of the Equation block, check the Enable Debugger check box

Click the Set Breakpoints button

This recompiles the equation in debugging mode and opens two windows:

• The Set Breakpoints window is where you set the breakpoints

• The Breakpoints window lists the breakpoints that have been set. It is used later in this tutorial, for “Setting a conditional breakpoint” on page 16.

☞ Code in the Set Breakpoints window cannot be edited.

The gray breakpoint lines in the left mar-gin of the Set Break-points window indicate the only places where break-points can be set.

In the left margin of the Set Break-points window, click the break-point line that is at the left of the if statement. This turns the gray dash into a red circle.

If you click at the wrong line of code, just click it again to remove the breakpoint.

Close the Set Breakpoints window.

Run the simulation. The simulation will run until the breakpoint is reached.

Stepping through the codeWhen the breakpoint is reached, the Debugger window opens.

• In the Source pane at the bottom of the window, a green arrow is placed at the left of the break-point. This indicates that the code before the green arrow has been executed.

☞ The green arrow indicates which line of code will be executed next, once the run is continued.

• The Variables pane at the top right shows the variables used in the equation and the value of each variable at the point before the line of code at the breakpoint is executed.

• Along the top of the window are five buttons. These are used to continue the run, to step over,

Set Breakpoints window showing breakpoint at “if”

Debugger window showing breakpoint and variable

Page 24: Addendum ExtendSim

16 Equations & Equation-Based BlocksDebugging equations

Equ

atio

ns

into, or out of functions, and to stop the run. (These buttons are explained fully in the Devel-oper Reference.)

• The Call Chain pane at the upper left tells where control is in the chain of command. It is not used for debugging equations unless there are blocks in the model that have debugging code.

The “if ” statement has not yet executed. To watch the statement execute:

Repeatedly click the Step Over button at the top of the Debugger window; the button is shown on the right. Alternatively, use the right arrow to step over the function.

The green arrow in the Source pane indicates the flow of the code; the Variables pane shows the change in value for the variables.

☞ Hovering the cursor over a variable in the Source pane will also show its current value.

Getting to the overflow calculationThe next step is to set a breakpoint to find out when the overflow value first gets calculated.

In the Debugger window:

Remove the first breakpoint by clicking its red circle

Add a new breakpoint at the “overflow = con-tents...” line

Click the Continue button at the top of the Debugger window. or use Shift+right arrow.

Although the breakpoint is set at the overflow cal-culation line, the green arrow indicates that the cal-culation has not yet been performed. Thus the overflow value will not be current.

In order to see the current overflow value:

Click the Step Over button to execute that line of code. The calculated overflow value is shown in the Variables pane.

Setting a conditional breakpointConditional breakpoints cause a calculation to break only when the overflow value is calculated and within a specified range or specific value. The Breakpoints win-dow is for setting breakpoint conditions. It allows you to:

• See which breakpoints have been set and where they have been set

• Add conditions to a breakpoint

• Click a breakpoint’s red circle to disable or enable any breakpoint, without deleting it. (In place of the red circle, disabled breakpoints have an open circle.)

• Delete a breakpoint by selecting it’s name and clicking the Delete or Backspace key

Debugger window breaking at first overflow

Breakpoint window

Page 25: Addendum ExtendSim

Equations & Equation-Based Blocks 17Include files for equations

Equations

To set a condition on the breakpoint so it will break only if the overflow is greater than 0.0:

In the Debugger window:

Remove the existing breakpoint by clicking its red circle in the Debugger window.

Add a new breakpoint to the Debugger window after the entire “if ” and “else” statement; in this case at the ending brace that is below the “overflow = 0.0” statement.

The next step is to write a comparison statement that will compare the overflow value to zero.

In the Breakpoints window:

Double-click the area to the right of the breakpoint. This opens the Conditional Break-point window, shown below.

In the Variable A column of the Conditional Breakpoint window, select the overflow vari-able as A.

Since you want the condition to determine when the overflow is greater than zero, choose A>B as the comparison.

Check the Use constant for B check box and enter 0.0 as the constant.

Click OK

Notice that the breakpoint’s red circle in the Debug-ger window has changed to a half circle, indicating there is a condition on the breakpoint.

Since you have set conditions, and you want to find the first time the condition is met, the calculation must start again from the beginning. To start the run over:

• Click the red Stop Executing button on the Debugger window. This closes the window and stops the model run.

• Run the simulation. The first overflow value will be displayed in the Variables pane.

As an additional exercise, try using different values for the overflow condition, such as 2.0, to see when that value first appears.

☞ Advanced modelers might benefit from reading about the Source Code Debugger in the Developer Reference.

Include files for equationsIt is common that several blocks would use the same or similar variable definitions and functions. Include files simplify programming tasks that are repeated in multiple blocks. They are especially helpful when you define your own functions for one block and want other blocks to have access to those functions.

For those who are building complex equations, most of the equation-based blocks have an inter-face for adding include files. This feature is implemented in the Equation and Query Equation blocks (Value library), Equation(I), and the Queue Equation, and Query Equation(I) blocks (Item library).

The finished Conditional Breakpoint window

Page 26: Addendum ExtendSim

18 Equations & Equation-Based BlocksQueue Equation block

Equ

atio

ns

Include files in equations are similar to the standard ModL include header files used when creating a block and discussed in the Developer Reference. They can contain ModL symbol definitions such as #define, conditional compilation statements such as #ifdef, and function definitions.

The main differences between the two methods of using include files are:

• Include files used with equations are normally saved in the same location as the model using them; this makes it easy to move both the model and the includes it uses to a different location. Include files used in block code should be saved in the Extensions/Includes folder.

• Include files used in equations only support local variable declarations. They should not have any static variable declarations - variables that are declared outside the boundaries of a function or procedures definition. Include files used in block code sometimes do have static variables; these are usually placed at the top of a block’s ModL code.

• Include files are added to block code via the #include syntax in the code, such as #include “file-name.h”. However, include files in equations are added via an interface (Use include files) in the equation block’s dialog. You cannot use the #include syntax in an equation block.

To create a new include file for an equation-based block:

Check Use include files in the block’s Equation tab

Click the Create New button

Give the new include file a name

In the window that appears, enter the procedure or function. For instance:

//**********************************

//START: Equation Include Prototypes

procedure myproc();//this will be displayed in the prototype list

//END: Equation Include Prototypes

//**********************************

procedure myproc()

{

userError("Hello World");

}Use the procedure in the equation. In this case, when the equation is called the block will dis-play a user error that says Hello World.

☞ If you have ExtendSim OR, ExtendSim AT, or ExtendSim Suite, see also the Equation Include File model; it is located at \Examples\Discrete Event\Tips.

Queue Equation block☞ Because there were extensive changes to the Queue Equation block in release 8, this section of the

User Guide has been rewritten. ▲ printed User Guide, page 133-135

The Queue Equation block (Item library) is used to release items in an order that is based on a ranking rule. Items enter the queue and are stored in the order of their arrival (FIFO). However, instead of the items leaving in FIFO order, an equation in the block’s dialog determines which item (if any) should leave the queue next. The equation is automatically calculated once for each item in the queue and the results are used to assign a ranking for each item. The item with the best ranking is the one that is allowed to leave next.

Page 27: Addendum ExtendSim

Equations & Equation-Based Blocks 19Queue Equation block

Equations

How the block worksImportantly, only the equation results from the winning item are used for that particular calcula-tion cycle. For example, if the queue currently holds 10 items, the equation will be calculated 10 times and 10 individual sets of equation results will be collected. But only the equation results from the item with the best ranking will be used; results from the other 9 items are discarded.

So that the item leaving next will be properly chosen, by default a new calculation cycle is initiated every time an item enters or leaves the queue or when a value input connector receives a message. To override the default behavior, the factors that initiate calculation cycles can be controlled through check boxes in the block’s Option tab.

The tables below describe a number of equation input and output variables that are unique to the Queue Equation block. Along with the common input and output variables described in “Equa-tion components” on page 10, these variables are designed to help users write equations that will properly select the next leaving item. In particular, the QEQ item rank variable is used to assign a ranking to each item in the queue.

☞ At least one QEQ item rank output variable must be defined for this block to function properly.

Once each item has been assigned a ranking, the items are released from the queue according to the ranking rule selected in the Options tab’s Release popup; the ranking rules are listed on page 20. The block's internal data structure keeps track of the ranking assigned to each item.

☞ Giving an item a Blank ranking makes it an ineligible candidate for leaving the queue for that par-ticular query cycle

VariablesThe Queue Equation block has several types of input and output variables.The tables that start on page 11 (input variables) or page 12 (output variables) describe the common set of variables shared by all equation-based blocks. The following variables are unique to the Queue Equation block.

Input variables.

Input Variable Uses

QEQ arrival time The time the item arrived to the queue

QEQ FIFO position The item’s first-in, first-out (FIFO) position in the queue

QEQ current best item rank The best (highest or lowest) item rank result for the current cal-culation cycle

QEQ attrib last item to exit Provides the chosen attribute value of the last item to exit the block

QEQ num items in queue The number of items currently in the queue

QEQ static calc cycle init A static variable that gets initialized to its starting value at the beginning of every calculation cycle. Changes to this variable remain fixed (static) across equation calculations.

AR requirement is avail This boolean variable is True if an advanced resource (AR) requirement is available for the current item. See note below.

AR num requirements avail Provides the number of advanced resource (AR) requirements available for the current item. See note below.

Page 28: Addendum ExtendSim

20 Equations & Equation-Based BlocksQuery Equation and Query Equation(I) blocks

Equ

atio

ns

☞ The AR variables are only shown in the Queue Equation block if Advanced Resources (AR) is enabled in the block’s Options tab and the model contains a Resource Manager block. (See also “Advanced Resource Management” on page 51.)

Output variables

As mentioned earlier, while you can specify other equation results, one of the output variables has to be of the type QEQ item rank. Furthermore:

• Only the results for the item ranked best will be output.

• You can use more than one QEQ item rank variable; the secondary ranking variable will be used to arbitrate in the case of tied ranking.

☞ These variables are only available for the item that is currently being released.

Ranking rulesThe Release popup on the Options tab provides the following selections to determine which item should be released first:

• Highest ranked item. Each item’s rank value is calculated by the equation and the item with the highest ranking is allowed to exit.

• Lowest ranked item. Each item’s rank value is calculated by the equation and the item with the lowest ranking is allowed to exit.

• The first True ranked item. The equation will be calculated once for each item until either an item receives a True ranking or there are no items left to evaluate.

• All True ranked items. All items receiving a True ranking are moved to an internal departures list where they are immediately and permanently available to be moved downstream.

• The results are saved for each item in the departures list. These results are used (or broad-cast) at the time the item exits the queue.

• Items in the departures list are no longer evaluated by the equation. This can reduce the number of times an item is evaluated, reducing run times.

• Items are released in FIFO order.

▲ printed User Guide, pages 133-135

Query Equation and Query Equation(I) blocksThe Query Equation blocks are used to rank the records in an ExtendSim database table and intel-ligently select one record, based on a ranking rule. A user-defined equation in the block’s dialog is

Output Variable Uses

QEQ item rank Defines each item’s rank (position) in the queue. At least one of the output variables must be of this type.

QEQ halt calculation cycle If set to True, this variable will prematurely halt the current cal-culation cycle.

AR allocate requirement If set to True, the current item’s advanced resource (AR) require-ment will be allocated to it. See note above.

Page 29: Addendum ExtendSim

Equations & Equation-Based Blocks 21Query Equation and Query Equation(I) blocks

Equations

calculated once for each record in the table; the results are used to assign a ranking for each record. The record with the best ranking is the one that gets selected.

The query blocks are used when a database holds information that is required for making decisions in a model. While the querying and ranking behavior could be accomplished using the Equation blocks, the equations would be long and complicated. Furthermore, the query blocks provide crit-ical pieces of information that support writing more powerful queries.

There are two query blocks:

• Query Equation (Value library of ExtendSim AT and ExtendSim Suite)

• Query Equation(I) (Item library of ExtendSim AT and ExtendSim Suite)

The major differences between these two blocks is presented in the table on page 24.

The Query Equation blocks are advanced modeling tools. They only available in the ExtendSim AT and ExtendSim Suite packages.

How the blocks workA query cycle is the point in time when a query block executes its equation to pick the next “win-ning” record.

• In the case of the Query Equation(I), this occurs every time an item passes through.

• For the Query Equation block, its Options tab has choices for controlling the initiation of the query cycle.

Importantly, only the results of the equation for the winning record are used for that particular query cycle. For example, if the query table has 10 records, the equation will be calculated 10 times, and 10 individual sets of equation results will be collected. However, only the equation results from the record with the best ranking are used and the results from the other 9 records are discarded.

The blocks’ input and output variable types are specifically designed to help modelers write equa-tions that will properly rank the records and select the winning record. So that each record will have a ranking, the user-defined equation is calculated once for each record.

The records are ranked according to the ranking rule selected in the block’s Options tab; the rules are listed on page 24. The block's internal data structure keeps track of the ranking and any other results of the equation for each record.

☞ At least one DBQ record rank output variable is required so that each record can have a ranking.

Spawned itemsA feature unique to the Query Equation(I) block is the ability to optionally create additional items. These spawned items can then be used for special purposes in the model. This is an indepen-dent and parallel system to how the items that pass through the block got created.

Typically items are created outside of the block and pass through the block. These items are called pass-through items. In some instances, you might want to create additional action items, called spawned items, based on equation logic and what has been found in the query table. If a spawn is created for a particular record, an equation can be defined in such a way that results particular to the spawned record may be saved as attributes on the spawned item.

To use this feature, enable spawning on the Options tab. This causes a new item output connector to appear on the top edge of the block's icon. It also causes some additional equation variable

Page 30: Addendum ExtendSim

22 Equations & Equation-Based BlocksQuery Equation and Query Equation(I) blocks

Equ

atio

ns

types, with the prefix DBQS (for database query spawn), to be available. Those variables are shown in the table on page 23.

☞ The equation results for pass-through items are calculated independently from those for spawns.

Pass-through results are associated with the pass-through item and spawn results are associated with the spawned item. For example, results for the pass-through item might get taken from record 6 (because 6 possessed the best pass-through record rank), while the spawn might use results from record 2 (because 2 possessed the best spawn record rank).

When a spawned item is created, it represents a record from the query table. Consequently, you can think of this newly created item as a “spawned record”.

VariablesThe Query Equation blocks have several types of input and output variables.While the tables that start on page 11 (input variables) and page 12 (output variables) describe the set of variables shared by all equation-based blocks, the following variables are unique to the query blocks.

Input variables.

Input Variable

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Uses

DBQ read value X X Requires the user to choose a field in the query table. As the query block starts to loop through each record, this variable automatically takes on the value found in that field for the current record. (This is easier than calling DBDataGetAsNumber() to reference information resid-ing in the query table for the current record.)

DBQ read PRI X X The Parent Record Index value from the specified field for the current record. See note below.

DBQ start record X X The record to start the query cycle. (The default behavior is to start at record 1.)

DBQ num records X X The number of records in the query table.

DBQ current record index X X The index of the record currently being evaluated in the query cycle.

DBQ static query init X X A static input variable that gets initialized at the begin-ning of every query cycle.

DBQ current best rank result X X Current best record rank result in the current query cycle.

DBQ num non-blank ranks X X Number of non-blank ranked records at this point in the current query cycle.

DBQS current best rank result X Current best spawn rank result in the current query cycle.

Page 31: Addendum ExtendSim

Equations & Equation-Based Blocks 23Query Equation and Query Equation(I) blocks

Equations

☞ The notation PRI (Parent Record Index) is used in blocks that interface with the ExtendSim data-base. It describes the type of value that is being read or written when dealing with a Child field.

Output variables

As mentioned earlier, while you can specify other equation results, at least one of the output vari-ables has to be of the type DBQ record rank. Furthermore:

• Only the results for the record ranked best will be output.

• You can use more than one DBQ record rank variable; the secondary ranking variable will be used to arbitrate in the case of tied ranking. This is useful if you are concerned with tie breaking

DBQS num non-blank ranks X Number of non-blank spawn ranked records at this point in the current query cycle.

Output Variable

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Uses

DBQ record rank X X Rank result for the current record

DBQ halt query X X A True value halts the current query cycle

DBQ next record X X Tells block which record to query next

DBQS record rank X Spawn rank for the current record

DBQS attribute X For assigning attribute values to a spawned item. If the record's spawn rank is good enough to merit a spawning, then results from that record can be attached to the spawned item in the form of DBQS attributes. See “Spawned items” on page 21.

DBQS item quantity X Item quantity to be placed on spawned item. Also see DBQS attribute, above.

DBQS item priority X Item priority to be placed on spawned item. Also see DBQS attribute, above.

DBQS 3D object ID X 3D object ID to be placed on spawned item. Also see DBQS attribute, above.

Input Variable

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Uses

Page 32: Addendum ExtendSim

24 Equations & Equation-Based BlocksQuery Equation and Query Equation(I) blocks

Equ

atio

ns

for two or more records having the same primary. What constitutes a tie can also be defined on the Options tab with the parameter Records ranked within +/- X are equal.

• If the Spawning option is enabled, at least two output variables are required – one variable of DBQ record rank type plus one variable of DBQS record rank type.

Ranking rulesThe rules that determine which record is selected are given on the block’s Options tab:

For a pass-through item• Highest pass-through record rank. Each record’s rank value is calculated by the equation. The

one with the highest rank is chosen.

• Lowest pass-through record rank.Each record’s rank value is calculated by the equation. The one with the lowest rank is chosen.

• First True record rank. The equation will be calculated once for each record until either:

• A record receives a True ranking

• Or, there are no records left to evaluate

For a spawned item• Highest spawn record rank. Each record’s rank value is calculated by the equation. The one

with the highest rank is chosen.

• Lowest spawn record rank.Each record’s rank value is calculated by the equation. The one with the lowest rank is chosen.

• First True spawn record rank. The equation will be calculated once for each record until either:

• A record receives a True ranking

• Or, there are no records left to evaluate

• True spawn record ranks. Any record receiving a spawn rank ≥ 0.5 will be spawned. This makes it possible to create any number of spawned action items for one pass-through item.

Differences between the query blocks

Description

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

Query cycle initiated only when an item arrives (similar to the Equation(I) block). X

Query cycle initiation is controlled using options on the Options tab (similar to the Equation block).

X

Supports Spawning X

Works in continuous models X

Works in discrete event models X X

Page 33: Addendum ExtendSim

Equations & Equation-Based Blocks 25Query Equation and Query Equation(I) blocks

Equations

DB Job Shop Query modelThe DB Job Shop Query model is located at \Examples\Discrete Event\Routing.

The model simulates three parts, each with their own process sequence, being routed through five potential processes. Depending on the part, a process sequence is made up of some combination of milling, drilling, lathing, cutting, and exiting. For example, the process sequence for part 100-3 is cut, mill, lathe, drill and then exit, while the sequence for part 100-1 only contains a milling step before exiting. Each step in the process has a random delay that is unique to each part type.

All the information needed to drive this model is located in the ExtendSim database named Data-base 1. The table structure of that database is shown here.

• The Products table contains the names of the three parts that are modeled.

• The Production Schedule table is used by the Create block (through linking) to create parts by schedule.

Works in discrete rate models X X

Description

Que

ry E

quat

ion

Que

ry E

quat

ion(

I)

DB Job Shop Query model

Table structure of Database 1

Page 34: Addendum ExtendSim

26 Equations & Equation-Based BlocksQuery Equation and Query Equation(I) blocks

Equ

atio

ns

• The Operations table contains a list of the five different potential operations – mill, drill, lathe, cut, and exit.

• Each of the three part types has an associated Production Specs table. This is used to define the steps in a part's production sequence and the delays associated with each step. The From and To fields are used to define the appropriate destination given a particular origin: “If you come from here, go to there next.”

In the model, one Query Equation(I) block is used to find the current part's next process step and its associated delay. Both pieces of information are then stored as attributes on the pass-through item. When the next item/part arrives, the query block starts looping through the Production Specs table associated with that part.

In this example, the query block is looking for the record whose From value matches the currStep attribute found on the item. Once that is found, the block then finds the associated To and Process Time values for that record and stores them as attributes on the item.

The equation in the query block is:

if(currStep == fromField)

{

rank = True;

currStep = toField;

activityDelay = delayField;

}

else

{

rank = False;

}Given the complexity of what the query block is doing, the code is very simple.

Page 35: Addendum ExtendSim

User Guide Addendum

ExtendSim Databases

Page 36: Addendum ExtendSim

28 ExtendSim DatabasesOverview

Dat

abas

es

OverviewExtendSim databases are internal repositories for storing, managing, and controlling model data. They are especially useful for complex models and for models that contain a large amount of data. The ExtendSim DB Add-In allows an exported ExtendSim database file to be edited in Excel.

Release 8 has new Database menu commands and properties dialogs as well as a new Reserved Databases feature for programmers. The DB Add-In for Excel, discussed on page 29, has also been improved.

☞ The ExtendSim database feature is available in all ExtendSim products; unless it is purchased sepa-rately, the DB Add-In for Excel is only available in ExtendSim AT and ExtendSim Suite.

Database commandsThe following commands are used with databases and are new in release 8:

Edit Table Properties (Database menu)Opens a dialog, discussed below in “Table Properties dialog”, for editing table properties. This command works the same as right-clicking a database table and selecting Edit Table Properties.

▲ printed User Guide, page 702

Edit Field Properties (Database menu)Opens the Field Properties dialog. This is useful for editing the information, such as the field’s name and type, that was entered into the Field Properties dialog when the field was created. This command works the same as double-clicking a table’s field while the Database window is in Struc-ture mode.

▲ printed User Guide, pages 642, 649, and 700-702

Read/Write Index CheckingFor database read/write functions, the Database menu command “Read/Write Index Checking” can enable error messages if a read/write function call has illegal indexes. This is a good tool to find illegal indexes and leaving this check on does not impact the speed of a simulation run. Leave it off if it is preventing a legacy model from running. New models have this check on by default.

▲ printed User Guide, page 703

Show Reserved Databases (Develop menu)Causes the model’s reserved databases, if any, to be listed at the bottom of the Database menu and in the Database List. Reserved databases allow programmers to use database capabilities without the model-user being aware of the database. Since reserved databases can only be created and mod-ified through the ExtendSim database API, they are discussed on page 102.

▲ printed User Guide, pages 700-702

Page 37: Addendum ExtendSim

ExtendSim Databases 29Table Properties dialog

Databases

Table Properties dialogExtendSim database tables now have a Table Proper-ties dialog that allows you to:

• Edit the table’s name. This works the same as the command Database > Rename Table.

• Delete all the records. If selected, the initial-ization is done at the beginning of each run or at the beginning of a multi-run simulation.

• Enter a Tooltip. This is the same as entering text in the field at the right side of the Data-base window’s header. The text will be dis-played in the Table Viewer or when a cursor is hovered over the table.

The Table Properties dialog can be accessed through the new menu command Database > Edit Table Properties or by right-clicking a database table and selecting Edit Table Properties.

▲ printed User Guide, page 641

Save and Next Field buttonThis button, located in the Field Properties dialog, allows you to start a new field immediately after you save the properties of the field you have been working on. This is faster than saving a field and returning to the Database window to append a new field.

▲ printed User Guide, page 642

New “Overwrite and Delete” buttonWhen one database is imported into a database with the same name, buttons allow you to choose how the import should be handled. If the original database had more tables than the imported one, a new button (Overwrite and Delete), removes the extra tables.

Reserved databasesReserved databases allow programmers to use database capabilities without the model-user being aware of the database. Since reserved databases can only be created and modified through the ExtendSim database API, they are discussed on page 102 of this Addendum.

Improved DB Add-InThe ExtendSim DB Add-In allows an exported ExtendSim database file to be read into an Excel workbook, where its data and structure can be edited before it is exported back to ExtendSim.

☞ The DB Add-In for Excel is included only in ExtendSim AT and ExtendSim Suite; it can also be purchased separately.

As discussed in detail below, the new features in release 8 of the DB Add-In include:

• Two new menu commands: Check Database Consistency and Find Database Table. And check-ing consistency generates an Errors Summary worksheet with hyperlinks to the errors.

• Enhancements for parent/child fields

• Improvements to the Status bar

• Faster importing of databases into Excel and improved error checking while a database is being imported

Page 38: Addendum ExtendSim

30 ExtendSim DatabasesImproved DB Add-In

Dat

abas

es

▲ printed User Guide, page 650-651

☞ At the time of this printing, the DB Add-In only works on Windows and requires Office 2007 or better. (Office 2008 for the Macintosh no longer supports Visual Basic Add-Ins and the Extend-Sim DB Add-In does not work with earlier versions of Office on either Windows or Macintosh).

Check Database ConsistencyOne of the new DB Add-In menu options is “Check Database Consistency”. This command per-forms validations of the database and its parent/child relations. This ensures that the database structure and data content are internally consistent and valid.

If errors are found they are recorded in an Errors Summary worksheet and a message is displayed at the completion of the check. The Errors Summary worksheet has hyperlinks to the errors so you can fix them.

The four validationsThe Check Database Consistency command performs the following checks.

1) Parent/child data content

For each child field, the contents are checked to ensure that corresponding values exist in the parent fields of the parent tables. Each instance of a child field value without a corresponding parent field value is recorded in the Errors Summary worksheet.

2) Parent/child relations

The user-defined parent/child relations in the Indexed Fields table are validated. This check ensures that each child and parent table and each parent and child field referenced in the Indexed Fields table actually exists in the database workbook.

3) Table and field name uniqueness

This ensures that each table name in the workbook is unique and each field name is unique for the given table. Each instance of a non-unique table and field name is recorded in the Errors Summary worksheet.

☞ The DB Add-In only operates on one database at a time. It is therefore possible that other data-bases could have a table with the same name as a table in the workbook’s database.

4) Each value unique

This looks at the record contents for each field that has Each value unique checked in its Field Properties dialog. The validation ensures that all values in the corresponding tables are unique. Non-unique values are reported in the Errors Summary worksheet.

Exporting the fileThe DB Add-In will not allow you to export a database from a workbook until the database struc-ture and content have been successfully validated.

Page 39: Addendum ExtendSim

ExtendSim Databases 31Improved DB Add-In

Databases

Find Database TableThis command allows users to quickly find and go to a database table in their workbook. Selecting the command opens the Find Database Table form which displays a list of all the tables in the selected worksheet.

☞ Each worksheet is equivalent to one of the tabs in the imported database.

To select one of the database tabs, click the Work-sheet popup list, which displays all of the tables on the selected worksheet. To view a list of all tables in the database, select the <All worksheets> option.

When you select a table name in the list of tables, the active cell of the workbook will be set to the location where the database table is defined.

Other Add-In enhancements

Parent/child fields• Parent and child fields are now color-coded in the workbook. This matches the parent/child

color coding in ExtendSim – red for parent fields and green for child fields.

• When the database is imported and/or database consistency is checked, child field names are now hyperlinked to their parent fields. For example, clicking on a child field’s green header takes you to the linked field in the parent table. This allows users to quickly find parent tables and view the list of valid child values.

Status barDuring importing, the Status bar at the bottom of the workbook reports the current table as well as the number of the record being imported and the total number of records that will be imported.

Validation and performance while importing• The imported database is checked for unique fields. If some fields are not marked as unique, and

there are parent/child relationships, the DB Add-In displays a warning message during import. When the file is exported back to ExtendSim, the Add-In will resolve any parent/child conflicts by linking the child to the first appropriate parent field it locates.

• The VBA code that manages the DB Add-In has been rewritten for faster performance when importing files.

Page 40: Addendum ExtendSim

32 ExtendSim DatabasesImproved DB Add-In

Dat

abas

es

Page 41: Addendum ExtendSim

User Guide Addendum

Scenario Manager

Page 42: Addendum ExtendSim

34 Scenario ManagerScenario analysis

Scen

ario

s

Scenario analysisScenario analysis is a method for systemically and strategically examining the outcome of different model configurations. The purpose is to support the exploration and analysis of alternatives, gain-ing insight into why your system behaves the way it does and how it can be improved and man-aged. ExtendSim facilitates scenario analysis through the Scenario Manager block (Value library) which can be added to any model to control all aspects of the analysis. The Scenario Manager essentially keeps track of multiple what-if models, all based on the same model. It offers a highly flexible framework for experimentation and analysis.

The Scenario Manager is an advanced tool that is only available in the ExtendSim AT and Extend-Sim Suite packages.

The ExtendSim Scenario Manager is a data storage and analysis system that supports analysts as they input, view, manage, and analyze various scenarios. It allows them to use a single model to explore and evaluate an unlimited number of options while providing precise control over model changes as well as easy access to the results. And it provides automated methods for quickly chang-ing variable information and for generating scenario reports. It does this by assigning a named sce-nario to each combination of variables you choose to examine. For example, you can create best-, worst-, and typical-case assumptions for input values. Then recall each of these scenarios to see how the model behaves under different conditions. You can also recall scenarios in combination, such as, best-case sales and worst-case costs.

The ExtendSim database is a central part of the Scenario Manager's data storage and organization. A database named Scenario DB is automatically created when a Scenario Manager block is added to the model. This database is used to store the inputs and results for the scenarios. The Scenario Manager also facilitates using a design of experiments (DOE) methodology for more efficient per-formance.

The Scenario Manager is one of three ExtendSim analysis tools; see “Comparison with other anal-ysis methods” on page 46 for differentiators. While the Scenario Manager will meet the needs of most ExtendSim modelers, like most ExtendSim blocks it is open source. Thus a programmer can modify and enhance it should the need arise.

▲ printed User Guide, page 572 (between Sensitivity Analysis and Optimization).

How the Scenario Manager worksFor scenario management you evaluate and compare a number of model configurations or scenar-ios, where each scenario is one set of model inputs or factors. These factors are typically specific dia-log parameters (such as the maximum number of items in an Activity) but can also be complete databases, tables, fields, or records. A scenario can have any number of factors and each factor can have any number, or levels, of different values that it can take on. (For example, setting the maxi-mum number of items in the Activity to 2, 6, or 10 would be 3 levels.)

At the beginning of each set of simulation runs, or replications, the Scenario Manager copies the model factors for the current scenario into the appropriate locations in the model. Typically each scenario is run multiple times to capture any stochastic behavior. At the end of each of these repli-cations, the results of interest (responses) are generated, recorded, and summarized. After all replica-tions have completed, the scenario results are stored in tables in the Scenario DB database. You can also generate a report and export the data to a different ExtendSim database, an Excel workbook, or JMP.

Page 43: Addendum ExtendSim

Scenario Manager 35Tutorial I (dialog parameters)

Scenarios

☞ It is best to set aside some time for all of the scenarios to run. Depending on the size and complex-ity it may take minutes to hours to complete the entire set of runs. You should also be careful not to create too many scenarios. This is particularly easy to do if you create a full factorial design.

Tutorial I (dialog parameters)☞ Most analysts would only use dialog parameters in their scenarios, so this tutorial focuses on those.

For advanced analysis, you can also use databases, tables, and so forth, as discussed on page 41.

The following example uses the Final Car Wash model from the User Guide’s Discrete Event tuto-rial to investigate how changes in a number of factors affect the average wait time and throughput.

The table below shows the model factors and how they will be varied:

Each scenario will be run 5 times to capture the variation in the results between one run and the next. To evaluate all of the possible combinations requires 675 replications (135 scenarios ((3 x 3 x 3 x 5 levels)) at 5 runs each).

☞ Fortunately, this model runs very quickly so this number of replications is not a problem. However, if the model took significantly longer to run or if there were more factors, a design of experiments (DOE) should be used to reduce the number of scenarios.

StepsThe steps for performing scenario analysis are:

1) Adding a Scenario Manager block (Value library, ExtendSim AT and ExtendSim Suite only) to a model

2) Identifying and adding the factors (model inputs) to be included in the analysis

3) Identifying and adding the responses (model results) to be analyzed

4) Determining what you want in the report

5) Determining the DOE (design of experiments), then generating and running the scenarios

6) Analyzing the results

7) Optional. Exporting the scenarios to JMP, Excel, or an ExtendSim database for further analysis

Add the Scenario Manager blockOpen the model named Final Car Wash (\Examples\Tutorials\Discrete Event)

Save the model as “Final Car Wash Scenarios” so you don’t overwrite the original model

Place a Scenario Manager block (Value library, ExtendSim AT and ExtendSim Suite only) in the model. The block can be placed anywhere but the top of the model will provide easiest access.

Since all the other blocks are labeled, label the block “Scenario Manager”

Factor Values

Number of attendants 1, 2, 3

Wash only time 5, 6, 7

Wash and wax time 6, 7, 8

Car interarrival rate 3, 3.5, 4, 4.5, 5

Page 44: Addendum ExtendSim

36 Scenario ManagerTutorial I (dialog parameters)

Scen

ario

s

☞ As shown at the bottom of the Database menu, adding a Scenario Manager block to a model auto-matically creates a database named Scenario DB. This is where the results of each individual sce-nario, as well as model factors, are stored. See “Analyze results” on page 40 for more information.

Your model should now look similar to the following screen shot:

Open the dialog of the Scenario Manager block

As seen above, the Scenario Manager has tabs for Factors, Responses, Scenarios, and Export. These represent the steps in using the Scenario Manager.

Identify and add factors and valuesThe next step is to determine and add to the Dialog Factors table any dialog factors (model param-eters) you want to include in the analysis. The information is in the following table.

Block Name (Label) Parameter Factor Name Values

Resource Pool (Attendant Resource) Initial number Attendants 1, 2, 3

Activity (Wash Bay) Delay (D) Wash Time 5, 6, 7

Activity (Wash/Wax Bay) Delay (D) Wash&Wax Time 6, 7, 8

Model with Scenario Manager block

Dialog of Scenario Manager block

Page 45: Addendum ExtendSim

Scenario Manager 37Tutorial I (dialog parameters)

Scenarios

Methods for referencing dialog variables as factorsThere are 3 ways to add a dialog variable as a factor to the Dialog Factors table:

• Shift-click. Shift-click the target parameter in the target block’s dialog and select where it should go.

• Clone-drop. Drag a clone of the target parameter from the target block’s dialog and drop it onto the Scenario Manager’s icon.

• Manual. Manually enter the dialog variable name into the factors table.

Attendants factor☞ This section uses Shift-click to associate the parameters with the Scenario Manager. The response

section that follows uses clone-drop.

Go to the dialog of the Resource Pool block (labeled Attendant Resources)

While holding down the Shift key, click the Initial number dialog variable (2)

In the popup menu that appears, shown at right, select Scenario Manager: Add Factor

In the dialog that appears, name the factor Attendants as shown at left. Then click OK

Go to the Scenario Manager’s Factors tab

Notice that the Dialog Factors table now con-tains all the information about the Attendants factor – the block it came from, the variable value it is currently set at, and so forth.

☞ By default, the Attendant’s minimum value is set to its current variable value, the maximum value is 1 more than that, and the step is 1. These numbers will be changed later in this tutorial.

Other factorsRepeat the steps used for the Attendants factor, above, to place the remaining three factors (Wash Time, Wash/Wax Time, and Car Interarrival Time) in the Scenario Manager’s Dialog Factors table. See the table on page 36 for the parameters to use and which blocks. they are in.

With its default values, the Dialog Factors table should now look like this:

Create (Dirty Cars) Mean Car Interarrival Time 3, 3.5, 4, 4.5, 5

Block Name (Label) Parameter Factor Name Values

Portion of Dialog Factors table

Page 46: Addendum ExtendSim

38 Scenario ManagerTutorial I (dialog parameters)

Scen

ario

s

Entering valuesNow that the factors have been entered, it is time to enter their proposed values. There are two methods for entering values:

• Directly in the columns of the Scenarios table. To do this, enter a value for each factor and every scenario in the Scenarios table of the Scenarios tab.

• Automatically using a DOE (design of experiments) method. To use the Scenario Manager's DOE features, you need to choose the minimum, maximum, and step (the increment between the minimum and maximum values) for each dialog variable factor.

Since this example uses the Full Factorial DOE method:

Go to the Factors tab of the Scenario Manager block

Enter the new minimum, maximum, and step values for each of the factors as shown below

Identify and add targeted responsesThe next step is to add responses to the Scenario Manager.

☞ While you could use any of the 3 options from page 37, this section uses the clone drop method to associate the parameters with the Scenario Manager.

The responses (results of interest) are in the following table:

In the Queue block’s Results tab, click the dialog variable field for Length: Average

Right-click the variable field and select Clone Tool

While holding the cursor on the parameter field, drag the field to the Scenario Manager’s icon.

When the icon becomes selected, release the cursor

In the dialog that appears, select Response

Name the response Average Length

Notice that the Dialog Responses table in the Scenario Manager’s Responses tab now contains all the information about the Average Length variable.

In a similar manner, use either the Shift-click or the clone-drop method to add the response named Average Wait to the Scenario Manager

Factor Name Minimum Maximum Step

Attendants 1 3 1

Wash Time 5 7 1

Wash&Wax Time 6 8 1

Car Interarrival Time 3 5 0.5

Block Name (Label) Tab Parameter Response Name

Queue (Wait for Attendant) Results Length: Average Average Length

Queue (Wait for Attendant) Results Wait: Average Average Wait

Page 47: Addendum ExtendSim

Scenario Manager 39Tutorial I (dialog parameters)

Scenarios

The Dialog Responses table in the Responses tab should look like the following:

Determine what will be in the reportThe fourth step is to determine what type of report you want and what you want in the report.

The Dialog Responses table in the Responses tab is where you specify what level of statistics you want the report to calculate and which responses you want included in the report.

• To run a JMP DOE, set the Min/Max column to the desired JMP analysis type: Maximize, Match Target, Minimize, or None.

• The Report Set column determines which report is run for the specific response. The default is to only show the mean or average value of the response for each scenario, but more detailed statis-tics can be added by selecting a different report set.

• The Include in Report column is for choosing which responses will be included in the report.

For this example:

Keep the default settings

Select the DOE and run scenariosThe Scenarios tab of the Scenario Manager block is for choosing a method for the DOE as well as for creating and running the scenarios. As described more on page 46, there are three DOE meth-ods you can choose:

• Manual design

• Full factorial design

• JMP custom design – which has two options

The two options for the JMP custom design allow you to either create then run the scenarios (and later export the report to JMP), or create and immediately run the scenarios, automatically export-ing the report to JMP and storing it in ExtendSim. Both options require JMP from SAS Corpora-tion to generate the design and analyze the results.

In the Run Control section, choose DOE method: Full factorial design

Click the Create Scenarios button

This generates all of the combinations of the factor values. There will be a total of 135 rows (3 x 3 x 3 x 5 levels) in the Scenarios table. By default all of the scenarios are selected; to not run a specific scenario, uncheck its Select check box.

Since you want all of the scenarios to run, leave all of the Select check boxes selected

Enter Runs per scenario: 5

Suggestion: Use the Animation Off button or uncheck the Run > Show 2D Animation com-mand to turn 2D animation off

Click the Run Scenarios button.

This process may take some time as 675 replications are required to complete the scenario analysis!

Portion of responses table

Page 48: Addendum ExtendSim

40 Scenario ManagerTutorial I (dialog parameters)

Scen

ario

s

☞ Suggestions:

The scenarios will run a LOT faster if animation is not on.

Uncheck Play Sound at End of Run in the Edit > Options > Model tab before the run.

When the scenarios have completed running, you should see the following in the Scenarios table:

Analyze resultsThe Scenario DB database, listed in the Database menu, automatically stores all the responses of each scenario in a series of tables. The tables correspond to the rows of the Scenario Name column in the Scenarios table. The All Scenarios table of the Scenario DB contains information about all the model factors and responses. You can use the Scenario DB to perform analysis, or export selected information to a different database, to Excel, or to JMP, as discussed on page 40.

Some additional things to notice for your analysis are:

• Uncheck Include in Report in the Responses tab to not include certain responses in the Report

• Each response will have the type of report indicated in the Report Set column of the Responses tab. The default is to display the mean value for each response variable but you can also display the confidence interval, standard deviation, and so forth.

☞ Changing a Report Set after the scenarios have been run causes the Scenario Manager to recalculate the results with the new set. This is useful if you change your mind about the report you want.

• Depending on what has been selected as the Response tab’s Report Set, each response will have one or more columns in the Scenarios table of the Scenarios tab. These columns summarize the results of each set of replications for each scenario. The type of report, for example CI for confi-dence interval, is indicated in parentheses in the header of the column.

• On the Scenarios tab, the Details column in the Scenarios table opens a database table contain-ing the original data that was used to calculate all the statistics. The table is from the Scenario DB database that was created when the Scenario Manager block was first placed in the model.

• By default all of the scenarios are selected in the Scenarios table; to not run a specific scenario, uncheck its Select box

Export the results (optional)The form of the Scenario DB database tables may not be exactly what you want. To do additional analysis using a different format, export a report on the Export tab. For example, you could export complete results, including the values from every scenario, to JMP. Then use JMP's analysis capa-bilities to compare the different scenarios. To export the results:

Choose the type of report.

• Complete Results exports the contents of the Scenario DB database – the factors and responses for every run in every scenario.

Portion of scenarios table

Page 49: Addendum ExtendSim

Scenario Manager 41Tutorial II (database variables)

Scenarios

• Displayed Statistics exports the statistics for each scenario as shown in the Scenarios table. What gets displayed depends on what is selected in the Response tab’s Report Set column.

• Complete Statistics exports all of the available statistics for each scenario. This is every possi-ble statistic allowed by the Report Set column of the Responses tab.

Select the destination for the report: an ExtendSim database, Excel, or JMP.

☞ So that you don’t accidentally overwrite the data, it is suggested that you do not export to the Sce-nario DB database.

Set the destination parameters for the exported data. This varies based on the selected export destination.

Click Export Report

Once you have exported the results, analyze the scenarios by sorting, plotting, or generating com-parison statistics.

Tutorial II (database variables) This section assumes you understand how to create ExtendSim databases, including how to link to them and how to enter parent/child relationships. Databases are described in the User Guide.

So far you have controlled only dialog variables with the Scenario Manager. While most analysts would use only dialog parameters as factors and responses, a select few of you will want to do more advanced analysis. With the Scenario Manager you can use entire databases or a subset of a data-base (database tables, fields, or records), as factors and/or responses. These database variables can be used in addition to, or instead of, dialog variables.

☞ Using database variables is more complicated than using dialog parameters. However, it is very use-ful when you have sets of data, rather than single variables, that you want to swap in and out for each scenario. For example, several production schedules for a manufacturing model.

To use the Scenario Manager with a database variable, you must create an ExtendSim database and any necessary tables, fields, and records (this tutorial assumes you already know how to do that). You also need to specify targets and sources, as discussed below.

Targets and sourcesThe concept of targets and sources is specific to the Scenario Manager and allows more sophisti-cated analysis.

Definitions• A database variable is a variable that references an entire database or a subset of a database, such

as a database table or field.

• A source is a database variable that gets copied to a target

• Factor sources are the set of values that a database variable can take for all the different sce-narios. They contain all of the information for all of the scenarios.

• A response source is the value of a database output variable for a particular replication. Each response source only has the information for the current set of replications.

• A target is a database variable whose value is defined by a source

• A factor target is a database input variable whose value has been defined by a particular fac-tor source. Each factor target only has the information for the current set of scenario repli-cations.

Page 50: Addendum ExtendSim

42 Scenario ManagerTutorial II (database variables)

Scen

ario

s

• Response targets are a collection of output database variables where each variable’s value is defined by a particular response source. They contain all of the results for all of the scenar-ios.

Overview• The architectures of the targets and the sources must match. For example, if the source is a data-

base table, the target must also be a database table with the same number of fields.

• A minimum number of sources and targets must be created for the model:

• For database factors, at least two sources and at least one target. (Each set of data is a source so having one source does not make any sense when there are sets of data.)

• For database responses, one source and a number of targets. The number of targets depends on whether ExtendSim creates the source and targets or you do it manually. If Auto-Create Target is selected in the Database Responses table, ExtendSim will create a new database target for every simulation run. If manually, create one source and one target per scenario.

• If you run the model for testing purposes without using the Scenario Manager, the identified variables can be used in the model. However, these variables are just placeholders and their con-tents will change when you use the Scenario Manager.

• Factor target. When testing the model, use the target database factor in your blocks. (Either link a parameter or data table to the target variable or use a Read or Write block to refer-ence the target variable.)

• Response source. Similarly to the above, build the model as if you will be using a placeholder database response variable. However, use the source rather than the target.

• Sources are always copied to targets. When and how this happens depends on whether the data-base variable is a factor or a response.

• Factor. At the start of each set of scenario replications, the Scenario Manager copies the contents of the source database factor variable into the target database factor variable. This is done automatically by the Scenario Manager.

• Response. At the end of each simulation run the database variables used in the model are copied from the source to the target database variables for that scenario.

☞ The contents of the table, rather than the table itself, is copied. Thus the index of the target data-base variable does not change.

Page 51: Addendum ExtendSim

Scenario Manager 43Tutorial II (database variables)

Scenarios

Diagram of sources and targetsThe following diagram shows how sources and targets are related to factors and responses.

☞ Database factors are copied from the sources to the target at the start of each scenario run. Data-base responses are copied from the source to the targets at the end of each run.

Steps for scenario analysisThe steps for performing scenario analysis using database variables are:

1) Open a model

2) Create the required database, tables, fields, and records for the model

3) Optional. If you plan to perform DOE, create an additional table for each database variable, where each table has a list of the possible values for that variable

4) Create links between the model and the database variables

5) Enter information in the Database Factors table

6) Enter information in the Database Responses table (this example does not do this step)

7) Generate and run the scenarios

8) Optional. Export the report

☞ The above steps assume database tables are used for factors and responses. You can also use fields or records, or even entire databases, as targets and/or responses.

Open the modelIn the previous tutorial you built a model using dialog variables as factors and responses. This tuto-rial starts where the previous tutorial ended.

☞ Instead of starting with your previous model, this tutorial uses a similar model that already has the required database structure in it.

Open the Scenario Manager Final Car Wash model (\Examples\Tutorials\Discrete Event)

Like the model you built in the previous tutorial, the Scenario Manager block in this model has:

• Four factors in its Dialog Factors table: Attendants, Wash Time, Wash&Wax Time, and Car Interarrival Time

• Two responses in its Dialog Responses table: average wait time and throughput

This tutorial will keep these dialog factors and responses but will add a fifth factor (the percentage of cars wanting Wash or Wash/Wax) and put it in the Database Factors table.

Sources for DB Factors

Targets for DB ResponsesTargets for 

DB ResponsesSources for DB Factors

Sources for DB Factors

DB variables used by model Targets for DB Responses

Target forDB Factors

Source forDB Responses

Page 52: Addendum ExtendSim

44 Scenario ManagerTutorial II (database variables)

Scen

ario

s

In the model, the proportion of cars wanting either wash only or wash and wax is set in the empirical table of the Random Number block (labeled “Preference Percentage”). The table is shown at right.

For this tutorial the Wash or Wash/Wax factor will have three combi-nations of percentages, which represent 3 levels:

1) 75% wash and 25% wash & wax – the base case

2) 90% wash and 10% wash & wax – the more wash case

3) 50% wash and 50% wash & wax – the less wash case

As in the earlier tutorial, each scenario will be run 5 times to capture the variation in the results between one run and the next. To evaluate all of the possible combinations now requires 2,025 replications (405 scenarios ((3 x 3 x 3 x 5 x 3 levels)) at 5 runs each).

Create a database structure for the modelAs shown at the bottom of the Database menu, the Scenario Manager Final Car Wash model already has two databases:

• The Scenario DB database. This was automatically created when the Scenario Manager block was added to the model; it is discussed on page 40.

• A Model Data database. So that you can focus on the tutorial, the required database has already been created for this model. The Model Data database stores the different options and probabil-ities for the wash or wash/wax factor in 6 tables:

• A Parent table, Wash Type, that lists the options for the two wash types: wash only and wash & wax. Its contents are shown on the right.

• Three factor source tables, each of which has one of the probability combinations: Base Case (75% wash/25% wash&wax), Less Wash (50%/50%), and More Wash (90%/10%). These are Child tables that get their wash type information from the Wash Type table.

• A factor target table named Wash Preference. Each record in the factor target table has a wash type field and a probability field associated with that wash type. This table is used as a placeholder for model data. Thus before the scenario runs begin, the table is identical to the Base Case source table.

• A factor sources list table, named Preference Sources, that is a list of the three factor source tables. The contents of this table is shown at right. This table is used when performing DOE, so that you will know which tables to select from when creating the design. See “Create a source list (optional)”, below, for more information.

☞ Because they would commonly be used, the Model Data database has two tables that weren’t strictly required for the example: the Parent table (Wash Type) and the list of source tables (Prefer-ence Sources).

Page 53: Addendum ExtendSim

Scenario Manager 45Tutorial II (database variables)

Scenarios

The structure of the Model Data database is shown below.

Create a source list (optional)If you plan to perform DOE, create an additional table for each database factor variable, where each table has a list of the possible values for that variable. This is a table of tables, or a factor source list.

Using a factor source list allows you to choose from a subset of database variables rather than from all of the database variables in the model. This makes it easier to create the scenarios manually and to use DOE. Without this list of factor sources, any table in the database would be listed in the Database Factors table as a possible factor source table.

As discussed earlier, a factor source list, named Preference Sources, has already been created for this example. As you will see later, checking Use Source List in the Database Factors table limits the pos-sible entries to those in the source list (in this case, to the Preference Sources database table).

Link to the target tableTo control the model’s wash preference probabilities, the Random Number block’s empirical prob-ability table must be linked to the target table – Wash Preference:

Click the Link button in the Random Number block’s Preference/Probability table

In the Link dialog popup menu, select Link To: Database Table

Select the database named Model Data

Choose the table named Wash Preference, then click Link

Close the Random Number dialog

Enter database factorsYou cannot Shift-click or clone drop a database variable. However, you can enter the information manually. The Database Factors table also has popups for selecting the appropriate information.

Check the Database Factors check box to enable the Database Factors table

Use the +/- resize button to add one row to the table

FactorTarget

FactorSources

List of Factor Sources

Page 54: Addendum ExtendSim

46 Scenario ManagerDOE methods

Scen

ario

s

Enter the following information in the Database Factors table:

Generate and run the scenariosGenerate and run the scenarios as you did in “Select the DOE and run scenarios” on page 39. If you use the Full Factorial method and have 5 runs per scenario, 405 scenarios should be created and it will take 2,025 replications.

DOE methodsAs discussed onpage 39, the Scenarios tab of the Scenario Manager block allows you to choose the DOE method. These are described more fully below.

Comparison with other analysis methodsThe Scenario Manager is just one of the ExtendSim analysis tools. As described in the table below, each tool has a different purpose.

Column Header Enter or Select This Information

Target Name Wash or Wash/Wax

Target Type Table

Target Database Model Data

Target Table Wash Preference

Target Field (leave this cell blank)

Target Record (leave this cell blank)

Use Source List X (check the box; see page page 45 for more about source lists)

Source Database Model Data

Source Table Preference Sources

Source Field Wash Preference Table Name

DOE Method Description Sequence

Manual Enter factors for each scenario manually Create, Run, Export

Full factorial Create Scenarios creates one scenario for each combination of factor values. Since every possible combination of factors is generated, this takes the longest to run.

Create, Run, Export

JMP custom Create Scenarios opens JMP and causes it to create the design. This results in far fewer scenarios than full factorial, but it should be sufficient for most practical applications.

Create, Run, Export

JMP custom – create and run

Create and Run Scenarios opens JMP, causes it to create the design, runs the scenarios, and displays the factors and responses in both ExtendSim and JMP.

Create and Run

Page 55: Addendum ExtendSim

Scenario Manager 47Comparison with other analysis methods

Scenarios

Technique Sensitivity Analysis Scenario Manager Optimization

Purpose Study the behavior of the model in response to changes in a single input parameter

Study and compare the behavior of the model in response to changes in multiple input parame-ters. Learn how the system behaves under different conditions.

Determine the best config-uration of model parame-ters, given a specific goal (usually to minimize cost or maximize profit)

Question If a parameter had this value, how would it effect model outputs?

If several parameters had these values, how would that effect model outputs?

What configuration allows a model to behave opti-mally?

Advantages Easiest to specify

Included in all ExtendSim products

Gives the most complete understanding of how the model reacts to different factors

Factors can be from data-bases as well as dialog vari-ables

Automatically records each response for every simula-tion run

Design of experiments can reduce the number of sce-narios required to study factor interactions

Determines the optimum model configuration

Constraints can be added to filter out infeasible model configurations

Included in all ExtendSim products

Disadvantages Evaluating more than one factor is cumbersome

Additional modeling is required to record model results

A set of scenarios must be created by the modeler

May require many simula-tion runs to evaluate all of the scenarios

Only available in Extend-Sim AT and ExtendSim Suite

An objective function is required

Does not record the results of each individual run

There is a practical limit on the number of factors, and their possible values, that can be examined

May require many simula-tion runs to determine the optimal configuration

Refer to Printed User Guide, pages 568-572

Printed User Guide, pages 572-586

This Addendum

Page 56: Addendum ExtendSim

48 Scenario ManagerComparison with other analysis methods

Scen

ario

s

Page 57: Addendum ExtendSim

User Guide Addendum

Advanced Resource Management

Page 58: Addendum ExtendSim

50 Advanced Resource ManagementResource management

Res

ourc

es

Resource managementResource management is the efficient and effective deployment of resources when, where, and to the extent they are needed. The management of resources is essential whenever supply and demand is an issue. The objective is to maximize the utilization of resources to achieve goals while perform-ing the necessary activities.

Resources▲ printed User Guide, page 95

Resources are the means by which process activities and operations are performed. Typical resources include equipment, personnel, space, energy, time, and money. Resources can be avail-able in unlimited quantities but are most often limited or constrained. They can be consumed in the process or kept for reuse.

In ExtendSim, a resource that is required for a process or activity to take place can be modeled either as an item or as a unit in a pool:

• Item resources get batched with the items that require them (Resource Item method).

• A resource pool contains a count of the resources that are available to the model. The count can be a number in a Resource Pool block (Resource Pool method) or the number of records in an internal ExtendSim database (Advanced Resource Management method).

See the chapter on Resources and Shifts in the ExtendSim User Guide for more information.

Modeling resources▲ printed User Guide, page 209

Resources are the means by which process activities and operations are performed. Different parts of a model can share the same resource, just not at the same time. While a particular resource is being used in one place in a model, it is not available for any other part of the model. Thus the availability or lack of availability of resources causes constraints in a model.

How to model resourcesAs seen in the following sections, there are many ways to simulate resources when building models – some are explicit and some are implicit. Resources can be explicitly modeled using specialized resource management blocks; this has the advantage of direct access to features like automatic cost-ing and utilization calculations. In some situations, however, it could be simpler or provide more control to model resources just as any other item in the model or by limiting block capacity.

Explicit methodsThe ExtendSim discrete event architecture supports three explicit methods for modeling resources:

• Resource Pool method. As a count of the resources that are available in a pool. By keeping track of the available resource pool units, this method controls the flow of items that require the resources. This is accomplished using the resource pool blocks (Resource Pool, Queue [in resource pool queue mode], and Resource Pool Release), as shown in the “Resource Pool method” section of the User Guide.

• Resource Item method. As one or more resource items that are available to another item. This method involves batching resource items from the Resource Item block with the items that require them and, typically, unbatching the resource when it is no longer needed, as described in the “Resource Item method” section of the User Guide.

Page 59: Addendum ExtendSim

Advanced Resource Management 51Advanced Resource Management

Resources

• Advanced Resource Management method. As records in a table in an internal database, where each record represents a resource with individual properties and statistics. The Resource Man-ager block provides the interface for managing advanced resources. This resource management system is an advanced tool that is only available in the ExtendSim AT and ExtendSim Suite packages. It is described below.

These methods are compared in the table on page 81.

Implicit methodsIn addition to the explicit methods listed above, ExtendSim provides additional ways to model resources, as discussed in the “Other methods for modeling resources” section of the User Guide.

☞ Resource-type blocks should only be used in a model if their presence is required for the system. Otherwise, use an implicit method.

Advanced Resource ManagementIn ExtendSim, Advanced Resource Management (ARM) is an integrated system for organizing resources, distinguishing between them, and allocating them throughout a model. ARM provides a convenient and straightforward method for defining complex resource requirements for items as well as a flexible set of rules for how resources get allocated to them. And it provides automated methods for quickly changing resource information and generating statistical reports.

The ARM system is an advanced tool that is only available in the ExtendSim AT and ExtendSim Suite packages. It is new in ExtendSim 8.

The ExtendSim database feature provides the ARM system’s architectural framework. ARM uses an Advanced Resources database to represent, manage, and track the status and properties of resources, pools, and groups, as well as allocation and release rules. The database is automatically created when a Resource Manager block is added to a model.

☞ In the ARM system, resources are records that are stored in the Resources table of the Advanced Resources database.

In addition to the database, several blocks (listed on page 82) form integral parts of ARM. The Resource Manager is the central component of the system. It provides a dialog-based interface for creating and managing resources, requirements, policies, and release rules. Other blocks (Queue, Queue Equation, Resource Pool, Resource Pool Release, Shift, and Statistics) control or report various aspects of resources. Together with the ExtendSim database feature, these blocks comprise the ExtendSim Advanced Resource Management system.

☞ The ARM system can co-exist with the other resource modeling systems (items as resources and non-ARM resource pools). Thus models can use a mixture of resource modeling methods.

How Advanced Resource Management worksThe basic mechanism for allocating and releasing resources using ARM is:

1) The model has multiple types of resources with specified properties

2) Resource requirements are defined; each resource requirement is a specification of how many and what types of resources are needed

3) A Queue is set to be an advanced resource queue

4) Depending on their needs, items in the Queue request resources, then wait until their resource requirements can be satisfied

Page 60: Addendum ExtendSim

52 Advanced Resource ManagementAdvanced Resource Management

Res

ourc

es

5) Once resources are allocated to items, the items are released from the Queue

6) Resources remain allocated to items until the resources are released by Resource Pool Release blocks

7) Shift blocks can be used to bring advanced resources on and off schedule

8) The management of resource states and quantities and the allocation and release of resources is controlled by the Resource Manager

9) As the model runs, discrete transactions occur between the advanced resource blocks and an internal advanced resource database. These transactions are driven by item arrivals in the Queue and Resource Pool Release blocks, shift changes, and resource pool quantity changes.

☞ The primary ARM transactions are illustrated and described in more detail starting on page 83.

DefinitionsThe following definitions and abbreviations are used regarding the ARM system. Italicized words are defined in the table.

Term Definition

Advanced resource (AR) A resource that is part of the Advanced Resource Management (ARM) sys-tem.

Filtering condition(FC)

A specified condition of a resource or group property that gets saved. A fil-tering condition becomes a component of a quantity expression. It is thus the smallest (atomic) component of a resource requirement. When applied during the simulation run, the filtering condition limits the collection of resources to those that meet the condition.

Group A means for organizing resources. Groups can be used to control which types of resources are allocated to and released from items. Although a resource can only belong to one pool, it can be a member of many different groups.

Properties A method for distinguishing one resource, group, pool, or item from the oth-ers.

Quantity expression(QE)

A component of a resource requirement that specifies the desired number of resources to be selected from a list of those that meet the filtering conditions. A resource requirement has a quantity expression that consists of a specified quantity of one or more filtering condition results.

Resource The means by which process activities and operations are performed. Typi-cal resources include equipment, personnel, space, energy, time, and money.

Resource order A request by an item to satisfy a resource requirement. This causes the Resource Manager to assign the item a unique Resource Order ID.

Resource Order ID The location (record index) of a resource order in the Orders database table.

Resource pool A means for organizing resources. Pools can be used to control which types of resources are allocated to and released from items, as well as to capture statistics. A resource can only belong to one pool but it can be a member of many groups.

Page 61: Addendum ExtendSim

Advanced Resource Management 53Tutorial

Resources

TutorialThe purpose of the following tutorial is to highlight some of the advantages of advanced resources and illustrate ARM capabilities that could not easily be accomplished using the Resource Item or Resource Pool methods. To do this, the tutorial focuses on the problem of worker training strate-gies. In particular, the Final Car Wash model is modified and experimented with to determine how many people to hire and what mix of skills (only washing cars, only waxing cars, or cross-trained to do both) the workers should be trained on.

The tutorial is divided into three phases, described below.

Phase I: Adding ARM to a model

This phase just adds advanced resource capability to the Final Car Wash model, without changing any underlying assumptions. It starts on page 54.

1) Adding a Resource Manager block to the model

2) Changing the dialogs of the model’s Resource Pool, Queue, and Resource Pool Release blocks to supply, require, and release advanced resources, respectively

Phase II: Create more complex requirements and specialized resource types

Starting on page 57, Phase II shows how to create complex resources and resource requirements.

1) Creating three resource pools to represent three types of resources

2) Using the Resource Manager to create two complex resource requirements

3) Creating a new string attribute that links to the table of resource requirements and changing blocks to accommodate it

Phase III: Using the Resource Manager to create pools and requirements

The final phase shows how to use the Resource Manager block to create pools, resources, and resource requirements. It starts onpage 63.

1) Creating a pool and resources using the Resource Manager block

2) Defining a new resource requirement

☞ To understand the ARM system, it is important to go through the tutorial. For comparison to your work, example models that correspond to the tutorial are located at Examples\Tutorials\Discrete Event\Advanced Resources. Also see the Auto Club Emergency Service model located at Exam-ples\Discrete Event\Resources and Shifts\Advanced Resources.

Resource requirement (RR)

A named rule that specifies how many of what types of resources to allocate to an item. The rule could be simple (1 washer/waxer is required per car) or it could be a complex expression involving several resources, groups, and so forth. A resource requirement can be composed using one or more quantity expressions.

Resource release rule A customizable mechanism for controlling which resources to release when items enter Resource Pool Release blocks. Each resource release rule is asso-ciated with a specific resource requirement and is designed to control the release of resources at the quantity expression level of the resource requirement.

Term Definition

Page 62: Addendum ExtendSim

54 Advanced Resource ManagementPhase I: Adding ARM to a model

Res

ourc

es

The following tutorial assumes that you have completed the Discrete Event Tutorial (Car Wash) and that you are comfortable working with string attributes and the ExtendSim database. These topics are covered in the User Guide.

Phase I: Adding ARM to a modelThis phase changes dialog settings of the blocks in the Final Car Wash model, causing the model to use advanced resources without changing its basic behavior. When finished, running the new model should result in exactly the same outputs as running the original model.

Add the Resource Manager blockThe advanced resource capability is not enabled until the model has a Resource Manager block.

Open the model named Final Car Wash (\Examples\Tutorials\Discrete Event)

Save the model as “Final Car Wash RM” so you don’t overwrite the original model

Place a Resource Manager block (Item library, ExtendSim AT and ExtendSim Suite only) in the model. The block can be placed anywhere, but the top of the model will provide easiest access.

Label the block Resource Manager

☞ In the dialog of the Resource Manager block, notice that, other than the Resources tab, the tabs are disabled. The tabs in this block are meant to be used sequentially. Until the model has advanced resources, the other tabs will remain disabled.

Resource PoolThe next step is to create an advanced resource pool and some resources. This is done by changing the settings in the Resource Pool block that is already in the model.

☞ Because using them automates many of the steps, Resource Pool blocks provide a quick and effi-cient entry to using the ARM system.

Change block settingsIn the dialog of the model’s Resource Pool block (labeled Attendant Resource):

Change the resource pool behavior to: advanced resource pool

Create a new pool:

Select Advanced pool name: New advanced resource pool

In the dialog that appears, name the advanced resource pool Washer/Waxer

Define the properties for the pool’s resources as follows:

Initial status: Idle (the default)

Shift: none (the default)

Initial number: 2

Click OK to close the block’s dialog

The dialog that appears is a message that the properties of this pool have been changed. Click OK to accept the changes and close that dialog.

Page 63: Addendum ExtendSim

Advanced Resource Management 55Phase I: Adding ARM to a model

Resources

The resource pool of 2 who can wash and wax cars has now been replaced by an advanced resource pool of 2 who can wash and wax cars.

What happenedThis process created a new advanced resource pool, named Washer/Waxer, that has 2 resources. Both resources have an initial status of Idle and no Shift. When the pool was created, the ARM system automatically named the resources Washer/Waxer_1 and Washer/Waxer_2, stored them as records in the Resources table of the Advanced Resources database, and listed them in the Resource Manager block so they can be edited. (As will be discussed later, the ARM system also automati-cally created a default requirement for the pool’s resources.)

Look at the Resource Manager: Resources tabTo see how the Washer/Waxer pool’s resources are stored in the Resource Manager:

Go to the Resources tab of the Resource Manager block

Select Mode: Edit resources

In the Set resource filters frame:

Choose Pool name: Washer/Waxer as the filter

Leave the rest of the filtering fields as they are

The Edit filtered resources table at the bottom now lists the two resources that are in the Washer/Waxer pool, along with their initial properties. This table is where resource properties can be edited.

Do not change any of the initial properties

Click OK to close the Resource Manager’s dialog

QueueThe Queue is where item/cars wait until the required types of resources, in the specified quantities, are available.

Change block settingsIn the dialog of the Queue block (Wait for Attendant):

Change the queue behavior to: advanced resource queue

Choose Get resource requirement from: List selection (the default)

In the list selection popup, choose: RR_Washer/Waxer

Click OK to close the dialog

This tells the Queue that it must hold each car until the resource(s) specified by RR_Washer/Waxer are available. Requiring one Washer/Waxer per car is the default resource requirement.

What happenedWhen a Resource Pool block is used to create a pool, the ARM system automatically creates an associated default resource requirement. The default is that one resource is required from the asso-

2 resources

Page 64: Addendum ExtendSim

56 Advanced Resource ManagementPhase I: Adding ARM to a model

Res

ourc

es

ciated pool in order for the item to be released from the Queue. And the default requirement is given the same name as the resource pool, preceded by “RR_”. Thus the default resource require-ment is named RR_Washer/Waxer and, again by default, each car requires one Washer/Waxer. (If a more complex resource requirement is needed, it must first be defined on the Resource Manager’s Requirements tab, as discussed in Phase II of this tutorial.)

If a pool has been created using a Resource Pool block, the ARM system automatically specifies a default resource requirement, with a quantity of 1 resource, as being required for each item. If the pool is instead created using the Resource Manager block, this automated process is optional. For more information, see “Default resource requirements” on page 80.

Look at the Resource Manager: Requirements tabIt is helpful to see how the Resource Manager handles resource requirements.

Go to the Requirements tab of the Resource Manager block

Check to enable Create/modify resource requirements (the top check box)

The dialog expands to show the resource requirements popup, some operators, and an expression area. This frame is where resource requirements can be created or edited, but it is also useful for getting a quick look at the exist-ing requirements. For instance, RR_Washer/Waxer is the name of the default resource requirement that was automatically defined when the new pool was created. The expression area indicates that RR_Washer/Waxer requires 1 resource from the Washer/Waxer pool for each car to exit the Queue.

Click OK to close the Resource Manager’s dialog

Resource Pool ReleaseIn the dialogs of both of the Resource Pool Release blocks (Release Attendants):

For the release behavior, select Release: advanced resources

For the release rule, choose Release: all resources (the default setting)

Click OK

Save and runSo that the changes to the Advanced Resources database will be saved, save the model

Run the simulation (it will run a lot faster if you turn off animation)

The new model is now fully converted to run using advanced resources but retains the information of the original model. If the same random seed value is entered in the Run > Simulation Setup > Random Numbers tab, the converted model will produce identical results to the original model.

In order for the new pool and its resources to be saved, the model must be saved. This action also saves the Advanced Resources database, which contains all the information about the pools and their resources.

What happenedAs each car gets to a Resource Pool Release block, its release rule causes all resources (in this case, 1 Washer/Waxer) to be released. The Washer/Waxer resource then becomes idle and is made avail-able for the next item waiting in the Queue.

Page 65: Addendum ExtendSim

Advanced Resource Management 57Phase II: Organizing resources

Resources

Look at the Resource Manager: Release Rules tabThe Resource Pool Release blocks have three mechanisms for releasing advanced resources. The options are to release:

• All resources

• All resources from a specific resource order

• Resources using a custom rule

While not needed in this tutorial, custom release rules can be cre-ated and saved on the Resource Manager’s Release Rules tab. For more information, see “Release rules” on page 72.

Look at the Resource Manager: Policies tabWhen a resource transitions to the idle status, it immediately attempts to service one of the items waiting for advanced resources. If multiple items are waiting, they are serviced in an order governed by settings on the Resource Manager’s Policies tab.

The default setting is that items are sorted first by the ranking of the resources that they require and secondarily by their arrival time to the queue. (Since the default resource requirement rank is 1, and absent any other conditions the advanced resource queue behaves as if items are released in first-in, first-out order, the sorting order has no effect on the cars waiting in this model.)

While not needed for this example, the Policies tab provides additional flexibility when building advanced resource models. For more information, see “Policies” on page 73.

Phase II: Organizing resourcesIf the ARM system only substituted for the Resource Pool method it wouldn’t be very useful. The advanced resource management system provides a mechanism for implementing far more compli-cated resource requirements. The next part of the tutorial has two purposes:

• Showing how to allocate resources by type

• Using attributes to set resource requirements

These are described below.

Allocating resources by typePhase II of the tutorial has a generalist who can both wash and wax cars plus two specialists, one of whom can only wash while the other can only wax. The purpose of the simulation is to explore how many workers need to be cross-trained as generalists.

Because some resources are specialized, complexity will be added to the resource allocation logic:

• Cars that need washing only will require either one Washer or one Washer/Waxer

• Cars that need washing and waxing will require either one Washer and one Waxer or one Washer/Waxer

To enable this, three different resource pools will represent the different skill sets of the car wash workers. The first pool consists of workers who can only wash cars, the second pool consists of workers who can only wax cars, and the third consists of workers who can both wash and wax cars.

Page 66: Addendum ExtendSim

58 Advanced Resource ManagementPhase II: Organizing resources

Res

ourc

es

☞ While not necessary for this tutorial example, resources from different pools can be organized into groups with rankings and skill levels. This is discussed in “Groups” on page 68.

Using attributes to set resource requirementsWhile Phase I showed how to select the resource requirement from a popup list, the following sec-tion shows how to set the resource requirement as a string attribute and use that attribute to spec-ify item requirements – cars that require either one Washer or one Washer/Waxer and cars that require either one Washer/Waxer or both a Washer and a Waxer.

Resource PoolsThree pools are required for this phase of the tutorial: Washer/Waxer, Washer, and Waxer. Each pool will have one type of resource (washer/waxer, washer, or waxer) available for the model.

☞ This tutorial uses three Resource Pool blocks to represent the three pools. However, Resource Pool blocks are optional in the ARM system and pools can be created using the Resource Manager, as shown in Phase III.

Change the original Resource PoolThis phase of the tutorial uses the same model created in Phase I – the Final Car Wash RM model.

Continue with the Final Car Wash RM model created in Phase I

In the dialog of that model’s Resource Pool block (labeled Attendant Resource):

Change the initial number to 1

Change the label of the block to Washer/Waxer

Click OK to close the dialog

A dialog appears with a message that one of the original two resources from the pool will be deleted. Click OK to accept the change.

Add two additional poolsThe next step is to add resources that are specialized:

Add a second Resource Pool block to the model. (The easiest way to do this is to duplicate the existing Resource Pool block.)

In the block’s dialog, define the advanced resources as follows:

Select Advanced pool name: New advanced resource pool

In the dialog that appears, name the advanced resource pool Washer

Enter Initial number: 1 but leave the rest of the set-tings at the default

Change the label of the block to Washer

Click OK to close the dialog

If the new Resource Pool block is a duplicate of the original, a dialog appears with a reminder that the properties of this pool have been changed. Click OK to accept the changes and close that dialog.

Add a third Resource Pool to the model and repeat the above process, except:

Page 67: Addendum ExtendSim

Advanced Resource Management 59Phase II: Organizing resources

Resources

Name the third advanced resource pool Waxer

Change the label of the block to Waxer

Save the model

Requirements tab of Resource ManagerSome cars need only to be washed and some need waxing as well as washing. The next step is to define those resource requirements. Now that there are three Resource Pool blocks in the model, there are also three default resource requirements: RR_Waxer, RR_Washer, and RR_Washer/Waxer. These are listed in popup menus in the Queue’s dialog and in the Create/modify resource requirements frame of the Resource Manager’s Requirements tab. (Default resource requirements are discussed more on page 80.)

☞ The ARM system created default resource requirements as well as the default building blocks (the filtering condition and quantity expression) that compose that resource requirement.

Cars requiring washing onlyThese cars can be washed by either a washer/waxer or by a washer. This model then needs a new resource requirement that will request either one washer/waxer or one washer.

Go to the Requirements tab of the Resource Manager.

Check Create/Modify Resource Requirements. This enables a section where operators and logical expressions are used to define requirements.

Notice that the popup list of resource requirements has the three default resource requirements (each of which is 1 resource from the pool) that were automatically created for the three pools in this model.

To create a new resource requirement:

Select Choose resource requirement: New resource requirement. The popup changes to “unsaved resource requirement” – a reminder that the requirement must be saved to be usable.

From the popup labeled Insert quantity expression, choose1 from Washer/Waxer. This places that quantity expression in the expression area.

☞ Mistakes can be cleared clicking Clear Last or Clear All.

Click the OR button to cause that operator to be placed in the expression area

From the Insert quantity expression popup, choose 1 from Washer. This places that quantity expression in the expression area after the OR operator.

The expression should look like this:

Click the Save As button

In the dialog that appears, name the requirement Wash Requirement

This creates a new resource requirement named Wash Requirement. The expression area indicates that this requirement can be satisfied using either 1 resource from the Washer/Waxer pool or 1 resource from the Washer pool. If both the resources are available, the Washer/Waxer resource will be used first.

The expression is evaluated from left to right. Thus resources towards the left of the expression will be used before those on the right. This evaluation affects model results, as discussed on page 62.

Page 68: Addendum ExtendSim

60 Advanced Resource ManagementPhase II: Organizing resources

Res

ourc

es

Cars also requiring waxingThe next step is to create a new resource requirement for the cars that also want waxing. Those cars can use either one washer/waxer or one washer and one waxer.

To create the new resource requirement:

Select Choose Resource requirement: New resource requirement

To open a parenthesis in the expression area, click the left grouping operator “(”

From the Insert quantity expression popup, choose 1 from Washer

Click the AND operator

From the Insert quantity expression popup, choose 1 from Waxer

To close the parenthesis, click the grouping operator “)”

Click the OR operator

From the Insert quantity expression popup, choose 1 from Washer/Waxer

The expression should look like the screen-shot to the right.

Click the Save As button

Name the requirement Wash/Wax Requirement

When executed, this requirement will first attempt to allocate one resource from the Washer pool and one resource from the Waxer pool. If these resources are not both available, it will then attempt to allocate one resource from the Washer/Waxer pool.

Click OK to close the dialog

Create a string attributeIn the original Final Car Wash model, the preference for washing only or for wash-ing and waxing is set as a string attribute named Prefer-ence. By pointing to either row 1 or 2 in a table in the Executive’s Attributes tab (shown at the immediate right) the attribute routes cars to the correct bay.

As you will see below, the two new resource requirements (Wash Requirement and Wash/Wax Requirement) are in records 4 and 5, respectively, of the database’s Requirements table, shown above right.

This section shows how to create a new string attribute that points to records 4 and 5 in the data-base table. The goal is to link the Executive’s string values table to the database’s table of resource requirements. This will give the Resource Manager a mechanism to point to the records that con-tain the resource requirements for the model.

☞ An alternative method would be to use a Lookup table as is done in the Auto Club Emergency Ser-vice model located at \Examples\Discrete Event\Resources and Shifts\Advanced Resources

Resource Requirements tableof Advanced Resources database

String values tableIn Executive block’s Attributes tab

Page 69: Addendum ExtendSim

Advanced Resource Management 61Phase II: Organizing resources

Resources

When the string attribute is changed, settings in the following blocks must also be changed to use the new attribute:

• Set

• Random Number

• Queue

• Select Item Out

☞ These changes are only necessary because the attribute needs to be changed. If the model had been originally constructed to use the ARM system, there would be no reason to make these changes.

Set blockIn this model, the attribute is set in the Set block (Set Attribute). In the block’s dialog:

In the Property Name column, select the Preference cell to open the popup menu

From the list of properties, select New String Attribute

Name the new attribute Requirements and click OK. This opens the Executive block’s Attributes tab. The string values table on the right is now named Requirements.

In the string values table (Requirements), click the Link button to open the Link dialog

Choose Link To: Database Table

Select the database named Advanced Resources and click OK

Choose Table Name: Resource Requirements. This displays a table listing all the resource requirements that have been created for this model.

Click Link. This causes the Executive’s Attributes tab to appear. It also causes the Resource Requirements table to be linked to the Requirements string attribute, as indicated in the string values table shown at right.

Close the Executive’s dialog. Notice that in the Set block’s dia-log the Property Name is now Requirements.

Close the Set’s dialog

Save the model

Random NumberThe resource requirement now comes from the value of a string attribute named Requirements. However, the Random Number block originally looked at the Preference attribute to determine how often the requirement would be for wash only or for wash and wax. The block must be changed to use the correct values of the new string attribute.

In the dialog of the Random Number block (Preference Percentage):

In row 0, select Wash Requirement from the popup. That requirement will now be selected 75% of the time.

In row 1, select Wash/Wax Requirement from the popup. That requirement will be selected 25% of the time.

Close the dialog

Table with attribute strings

Page 70: Addendum ExtendSim

62 Advanced Resource ManagementPhase II: Organizing resources

Res

ourc

es

QueueThe Queue is where items in this model get their resource requirements. Instead of from a list selection, the block must now get the resource requirement from the new string attribute.

In the dialog of the Queue block (Wait for Attendant):

Choose: Get resource requirement record from: Attribute value

For the attribute name, select Requirements

Close the dialog

Select Item OutThe Select Item Out block is where items get routed to one bay or the other. This step is to select the item routing method using the new string attribute.

In the dialog of the Select Item Out block (Select Route):

For the selection condition, choose Select output based on: property (it should already be selected)

For the property, choose the string attribute Requirements

In the Requirements column of the Select options table:

For row 0, choose Wash Requirement

For row 1, choose Wash/Wax Requirement

Notice that the To Block column indicates where cars with that requirement will be routed.

Close the dialog

Save and runSave the model

Run the simulation and observe the results

ResultsGo to the Results tab of the Resource Manager block

In the resource results frame, examine the results displayed in the table

Notice that Washer/Waxer_1 and Washer_1 are much more heavily utilized than Waxer_1. This is because:

• Waxer_1 can only wax cars and cars that need to be waxed represent only 25% of the cars com-ing into the car wash.

• Washer/Waxer_1 and Washer_1 can both be used when cars only need washing as well as when they need washing and waxing. Thus the remaining workload is distributed evenly between Washer/Waxer_1 and Washer_1.

• How the resource requirement expression is composed impacts which resources get selected.

Since the ARM system attempts to satisfy resource requirement expressions in left to right order, and the model contains resource requirements that use OR logic, changing the way the statement for the requirements is written impacts the behavior of the system.

Select Item Out table

Page 71: Addendum ExtendSim

Advanced Resource Management 63Phase III: An alternate method for creating pools

Resources

For example, there are three possible ways the Wash Requirement could have been written:

1) 1 from Washer/Waxer OR 1 from Washer

2) 1 from Washer OR 1 from Washer/Waxer

3) 1 from Washer

Likewise, there are two possible ways the Wash/Wax Requirement could have been written:

1) (1 from Washer AND 1 from Waxer) OR 1 from Washer/Waxer

2) 1 from Washer/Waxer OR (1 from Washer AND 1 from Waxer)

Thus from a resource requirements perspective alone, there are six (3 x 2) different ways to config-ure this model.

Try experimenting with each configuration to determine which one produces the best system per-formance. (The Scenario Manager would be especially useful for doing that.) Use the Event Log-ging tab of the Resource Manager block to generate a resource transaction log in order to observe which resources are getting allocated to specific orders.

Gathering statistical informationThe ARM system provides extensive data for analysis and there are a number of ways to observe and analyze results for this model:

• The Resource Manager’s Results tab contains individual and pool level statistics for advanced resources in the model. These statistics apply to the current simulation run and include utiliza-tion, the number of resource orders serviced, and so forth. The same information will be dis-played if a Statistics block (Value library) is added to the model before the simulation runs.

• The Results tab of Resource Pool blocks provide statistics on the total number of resources in the pool, how many are in use or are available, and their average utilization.

• If the Resource Manager’s Event Logging tab is enabled when the simulation is run, it records specified information about the resource transactions that occurred. The type of transaction is user-selected in the dialog. To view the results, click View Database, then select and open the Resource Transaction Log table.

Phase III: An alternate method for creating poolsResource Pool blocks are useful for quickly creating an ARM system. Additionally, the default resource requirements that are automatically created when a those blocks are used can be helpful.

However, models would soon get too busy if Resource Pool blocks were the only method for creat-ing pools. And it is unlikely that every resource requirement would be for only 1 of one type of resource, as happens with the default requirements.

This phase of the tutorial shows how to use the ARM system without the help of Resource Pool blocks and their default resource requirements.

Use a Resource Manager to create a pool and resourcesResource Pool blocks provide a quick entry into the ARM system. The Resource Manager block, however, is more flexible and allows for more robust configurations.

Create the poolOpen the Final Car Wash RM model that was used in the previous two phases

Go to the Resources tab of the Resource Manager block

Page 72: Addendum ExtendSim

64 Advanced Resource ManagementPhase III: An alternate method for creating pools

Res

ourc

es

Choose Mode: Create resources

In the Specify default resource properties frame:

Select Pool name: new resource pool

In the dialog that appears, name the pool My New Pool

A second dialog asks if you want to create a default resource requirement for the new pool. (Default resource require-ments are discussed on page 80.)

Click No. (It doesn’t matter if you accidentally click Yes; the default resource requirement can be ignored or deleted).

In the Resources tab dialog, notice the following:

• The option to Make names distinct is checked by default

• The default name for the pool’s resources is the same as the pool’s name; this is the root name of individual resources created for the pool

Create the resources

Change the name and set the propertiesWhichever name is entered in the Resource name field will be the root name for all the resources created for this pool. In addition, whichever default properties are set will apply to every resource in the pool. (Names and properties can be changed later, as seen below.)

In the Specify default resource properties frame:

Enter Resource name: My Resources

Do not change the default properties

Create the resourcesIn the Create resources with the specified properties frame:

Enter 5 as the number of new resources for the pool

Click Create

Five resources are created and displayed in the table. Notice the following:

• Since Make names distinct is checked, each resource has the root name (My Resources) followed by a dif-ferent number.

• Every resource has the default properties.

Modifying resource propertiesBy default, the newly created resources all have the same properties and they all use the same root name. There are two methods for changing resource properties, including names:

1) Change the properties in the Create resources table while the tab is still in Create resources mode. Only the newly created resources for the selected pool will appear in the table. If you close the block or switch modes, the table will reset to empty.

Page 73: Addendum ExtendSim

Advanced Resource Management 65Phase III: An alternate method for creating pools

Resources

2) Change the mode to Edit resources, filter for the pool (leaving Resource name blank), and change properties in the Edit filtered resources table. All of the resources for the selected pool will appear in the table.

☞ Once resources have been created, changes to their properties are automatically and immediately saved to the database. (The model file must still be saved.)

It is not necessary to change any resource properties for this tutorial

Save the modelIn order for the new pool, its resources, and their properties to be saved:

Save the model

This action also saves the Advanced Resources database, which contains all the information about the pools and their resources.

Create a resource requirementThe previous section purposefully chose to not have the ARM system create a default resource requirement for the pool. This section shows how to manually create a resource requirement.

Resource requirements are built in three steps.

1) The first step is to create and save a filtering condition. A filtering condition is a specified aspect of a resource or group property. For instance, a filtering condition could be that the resource comes from a particular pool. Think of creating filtering conditions as a way to make collections of resources. When used in a quantity expression, filtering conditions limit the col-lection to a selected list of resources that meet the specific conditions.

2) The second step is to define and save a quantity expression. Quantity expressions are logical statements consisting of the desired number of resources and one or more filtering conditions, such as 2 resources from a particular pool.

3) The goal is to arrive at a resource requirement. In the simplest case, the resource requirement could be the same as the quantity expression. It could also be a complex expression that selects resources with specific properties from several pools and/or groups.

☞ This section of the tutorial gives a quick overview. For more information about creating resource requirements, see “Resource requirements” on page 74.

Create a filtering conditionThe Resource Manager’s Requirements tab has three check boxes that are unchecked by default. Because resource requirements can be very complex, it is easiest to work in this tab if only one frame is open at a time.

In the Requirements tab:

Check the box to enable Create/modify filtering conditions.

Choose filtering condition: new filtering condition

The popup changes to “unsaved filtering condi-tion” and the text is in red – a reminder that the fil-tering condition must be saved to be usable. Creating a new filtering condition

Page 74: Addendum ExtendSim

66 Advanced Resource ManagementPhase III: An alternate method for creating pools

Res

ourc

es

Choose to Filter using properties of: resources

Using the popups, create the expression Property: Pool = My New Pool

Click Save As and save the filtering condi-tion as Any New Pool Resources

Click Test. This opens the Viewer, displaying which resources the filtering condition would select at this time. (New resources might be added, or existing ones deleted, before the filtering condition actually gets applied.)

Close the Viewer

Disable the Create/modify filtering conditions frame by unchecking its check box

Create a quantity expressionCheck the box to enable Create/modify quantity expression

Choose quantity expression: new quantity expression

The popup changes to “unsaved quantity expression” and the text is in red – a reminder that it must be saved to be usable.

Enter Quantity = 2

Click SELECT

This places the expression in the expression area. The expression indicates that two resources will be selected. Since there is no limit on the type of resources, any two resources from the Resources table could be chosen.

To limit the resources to those specified by a filtering condition:

Click WHERE, causing it to be placed in the expression area

From the Insert resource filtering condition popup, choose Any New Pool Resources

The expression indicates that two resources will be selected from the Resources table where the pool name is My New Pool.

Save the quantity expression as 2 from My New Pool

A dialog appears asking if you want a resource requirement to be created for this quantity expres-sion. The choices are:

1) Choose Yes if you want the resource requirement to be the same as what is described in the quantity expression. In this case, the resource requirement would be for any two resources as long as they were from the pool named My New Pool.

2) Choose No if you want a resource requirement that is more complex than what is described in the quantity expression.

(For more information about default resource requirements, see page 80.)

In the dialog, choose No. (If you instead chose Yes, the resulting resource requirement can be ignored or deleted.)

Creating a filtering condition

Page 75: Addendum ExtendSim

Advanced Resource Management 67Additional information

Resources

Click Test. This opens the Viewer, displaying which resources might be selected. As indicated in the table, without any other conditions being present the system will choose the first two resources in the list.

Close the Viewer

Close the Create/modify quantity expression frame by unchecking the check box

Create a resource requirementCheck the box to enable Create/modify resource requirements

Choose resource requirement: new resource requirement

The popup changes to “unsaved resource requirement” and the text is in red – a reminder that the requirement must be saved.

Select Insert quantity expression: 1 from Washer

Click OR

Select Insert quantity expression: 2 from My New Pool

Save the new resource requirement as New Resource Requirement

Click Test. The Viewer indicates which resources will be selected to fulfill the requirement. All other things being equal, one washer will be selected or the first two resources in My New Pool will be selected.

For more detailed information about creating resource requirements, see “Resource requirements” on page 74.

☞ The purpose of Phase III was just to show how to create pools, resources, and resource require-ments using the Resource Manager block. Since the new resource requirement is not used in the model, it has no affect on model behavior.

Even if a model has no Resource Pool blocks, it should probably have Resource Pool Release blocks. Use of Resource Pool Release blocks is optional only if the resources are considered to be consumed and the accumulation of excess records for the non-disposed resources does not cause concerns for model size and memory usage.

Don’t lose your workThe new resource requirement is automatically saved in the Advanced Resources database. How-ever, for the database to be saved:

Save the model

End of the tutorialFor another advanced resources example, see the Auto Club Emergency Service model; it is located at Examples\Discrete Event\Resources and Shifts\Advanced Resources.

Additional informationThe following areas were not covered, or not completely covered, in the tutorial; they are discussed below.

• Groups

• Resource orders

Page 76: Addendum ExtendSim

68 Advanced Resource ManagementAdditional information

Res

ourc

es

• Status and transitions

• Properties of resources, pools, groups, and items

• More information about creating a resource requirement

• Release rules

• Policies

GroupsGroups provide a means for organizing resources from different pools or from the same pool. If included as part of a filtering condition, groups can be used to control which resources are selected for a resource requirement.

☞ Although a resource can only belong to one pool, it can be a member of many different groups.

Creating groups and grouping resourcesTo create a new group that includes some resources:

Go to the Resources tab of the Resource Manager block

Select Mode: Manage groups

Optional: in the Set resource filters frame, choose filters to limit which resources are displayed

In the Create/modify groups frame, choose Group: New resource group

Name the new group

In the dialog that appears, choose whether or not the system should create a default resource requirement for the group. This option is explained in “Default resource requirements” on page 80.

In the Select resources to group frame, check the Select box for each resource you want to include in the group

Click the arrow button. The button, shown at right, is located between the Select resources for groups and the Create/modify groups frames. Clicking the button causes the selected resources to become members of the group.

Assigning properties to groupsAs discussed on page 72, each member of a group can be assigned a Skill Level and/or a Resource Rank. These group properties are used to prioritize which resource to select first from the group, when a group requirement is executed.

Any number, including 0 (zero) and decimals, can be assigned to a group member as its Skill Level or Resource Rank.

Deleting groups or their membersGo to the Resources tab of the Resource Manager block

Select Mode: Manage groups

Optional: in the Set resource filters frame, choose filters to limit which resources are displayed

In the Create/modify groups frame, choose the group you want to delete

To delete the entire group, click Delete Group

Page 77: Addendum ExtendSim

Advanced Resource Management 69Additional information

Resources

To remove only certain members, check the appropriate Select boxes and click Remove Selected Members

☞ Deleting a group and its members, or removing individual members from a group, does not delete the resources.

Using a group in a resource requirementA filtering condition can be created that filters on a group property, either Skill Level or Resource Rank. That filtering condition can then be used as a component of a quantity expression, but only in conjunction with a second filtering condition that filters on a specific resource group. For more information, see “Using group filtering conditions” on page 78.

Resource ordersIf each item could only have one resource requirement, and if each resource requirement could only be selected by one item, statistical information could be obtained just from the resource requirement’s usage. Instead, the ARM system allows each item to have multiple resource require-ments and even the same resource requirement multiple times but at different Queues. Addition-ally, several different items can each have the same resource requirement. To track data and calculate statistical information, the ARM system uses resource orders.

A resource order is the association of a particular item with a specific resource requirement; it is rep-resented by a unique Resource Order ID (discussed on “Item properties” on page 72). Resources are allocated to orders and each item can have multiple resource orders.

When an item gets to a Queue, the Queue makes a request to the Resource Manager for the resources specified by the item’s resource requirement. The Resource Manager then:

• Converts that request into a resource order

• Creates a corresponding record in the Resource Orders table that refers to the resource request and identifies which Queue the order came from, when it was ordered, and so forth

• Assigns a Resource Order ID to the item

• Attempts to satisfy the item’s resource requirement

• When a resource is successfully assigned to an item, the Resource Order ID field in the Resources table is updated. That information is used to track the resource’s last allocation.

This architecture allows the ARM system to track data and calculate statistical information such as when a resource was requested and the average length of time it took to satisfy.

For more detailed information, see “Primary transactions for ARM” on page 83.

Status and transitionsA resource’s status provides information about its current state. The status usually changes dynami-cally during a simulation run. Resources can have any one of five different status settings:

1) Idle

2) Busy

3) Off Shift

4) Down

5) Disabled

Page 78: Addendum ExtendSim

70 Advanced Resource ManagementAdditional information

Res

ourc

es

Idle or Disabled can be set as the initial status when the resource is created or edited. Busy is a func-tion of the resource’s use in the model. Off Shift and Down are controlled by the Shift and Shut-down blocks (Item library), respectively. The Resource Manager’s Results tab gives information about the amount of time each selected resource was busy, idle, and so forth.

Except that a resource cannot transition from disabled to down, each status can transition to any of the others. This gives a total of nineteen status transitions. To track status transactions, check Resource status transition in the transaction type table on the Resource Manager’s Event Logging tab.

PropertiesIndividual resources, pools, groups, and items each have their own properties. Properties provide a means to distinguish between them and characterize their behavior. As the simulation runs, infor-mation about properties is displayed in the Resource Manager’s Results tab.

Resource propertiesThe Resources table of the Advanced Resources database stores each resource as a distinct record, sorted by Resource ID. The fields of this table represent resource properties, which can be static or dynamic.

☞ The ARM system has a list of pre-defined static and dynamic resource properties. Custom resource properties can also be added, as discussed below.

Static propertiesStatic properties are specified when the resources are created, either in the Resource Pool block or on the Resources tab of the Resource Manager. Their values remain fixed during the simulation run.

The Resource ID property is automatically defined by the system. It uniquely identifies the resource and is not modifiable by the modeler. Other static properties are definable by the modeler:

• Resource name. The name does not have to be unique unless Make names unique (Resources tab of Resource Manager block) is checked when the resource is created.

• Pool. The pool name must be unique.

• Initial status: idle or disabled.

• Shift, if the Shift block (Item library) is present in the model.

• Groups. If a resource is a member of more than one group, the Groups column of the Select resources to group table (Resources tab, Manage groups mode) will display a popup menu listing the groups.

• Cost per unit of time.

• The time unit used for costing.

• Cost per use.

These static properties are also part of the filtering conditions used to create or modify resource requirements.

Dynamic propertiesAs the simulation runs, the ARM system tracks status information and calculates resource statis-tics. This data is stored as dynamic resource properties, which include:

• Status and status start time

Page 79: Addendum ExtendSim

Advanced Resource Management 71Additional information

Resources

• Pending status and pending status start time

• Total orders serviced

• Total idle/busy/disabled status time

• Total down or off-shift time

• Utilization

• Total cost

Aside from being useful for analysis, these dynamic properties are made available when creating or modifying filtering conditions.

Custom resource propertiesIn addition to the dynamic resource properties that are pre-defined in the ARM system, custom dynamic resource properties can be added.

To create a custom dynamic resource property:

In the Resource Manager’s Resources tab, choose either Mode: Create resources or Mode: Edit resources

Check the box to Display groups, pools, and proper-ties

In the new frame that appears to the right, change its mode from Groups to Properties

Click Add New and name the new property

Select a data type from the popup menu shown at right

The new property is now available for any resource. It will be displayed in the property popup menu when a resource filtering condition is created (Requirements tab of Resource Manager block).

Editing resource propertiesTo edit resource properties, choose Mode: Edit resources in the Resource Manager’s Resources tab. In this mode, the tab is divided into two sections – the top is for narrowing the list of resources that will be displayed in the table that is at the bottom.

• For individual resources, change the appropriate settings in that resource’s row

• To change one or more properties for several resources:

Choose whether column heading selections should apply only to the selected rows or to all rows

If selected rows is chosen, check the Select boxes for the resources to be changed

Use the popup menu in the column heading to choose the new setting. For example to change all of the displayed resources to the disabled state, choose that setting in the Initial Status column.

☞ The fields in the Groups column are only for information; they cannot be changed.

Pool propertiesA pool can have an ID, a Name, and a Parent ID. The Name and Parent ID are user-modifiable. The Name must be unique. Pools can be structured hierarchically; if one pool is part of another pool, the Parent ID identifies the next highest pool in that hierarchy.

Page 80: Addendum ExtendSim

72 Advanced Resource ManagementAdditional information

Res

ourc

es

The Pools table of the Advanced Resources database lists all the pools in the model as well as a summary of the results from the simulation run (total idle time, total utilization, and so forth) for each pool.

Group propertiesGroup properties are stored in the Group Resources table of the Advanced Resources database. The group properties are Name, Skill Level, and Resource Rank, all of which are user-modifiable. While they are considered group properties, the Skill Level and Resource Rank are assigned to the individual members (resources) of the group.

Group properties are useful when creating or modifying filtering conditions. Both the Skill Level and the Resource Rank are used to prioritize which resource to select first from the group, when a group requirement is executed. The Skill Level or Resource Rank can be any number, including 0 (zero) and decimals.

The Groups table of the Advanced Resources database lists all of the model’s groups. The Group Resources table displays all of the groups in the model as well as the properties and Resource ID of each of their members. (Remember, a resource can be included in more than one group.)

For information on creating and managing groups, see “Groups” on page 68.

☞ While the principle is the same, a group’s Resource Rank is not the same as a resource’s Resource Requirement Rank.

Item propertiesIn addition to the item properties discussed in the User Guide, every item at an advanced resource queue has a unique Resource Order ID assigned to it. The ID is automatically stored in a special item property and refers to a record index in the Resource Orders table of the Advanced Resources database. (See “Resource orders” on page 69.)

While not an item property, resource requirements have a resource requirement rank that controls the order in which idle resources search for waiting items to service. A resource requirement with a better rank will have first choice of any available items that require that resource. For more infor-mation, see “Resource allocation policy” on page 73.

Release rulesA Resource Pool Release block has three choices for controlling which resources to release when items enter the block. The options are:

• Release all resources

• Release all resources from a specific resource order

• Release resources using a custom rule

Custom Resource release rules provide a user-definable mechanism for controlling which resources to release. They are designed to control the release of resources at the quantity specification level of a resource requirement. Consequently, each resource release rule is associated with a specific resource requirement.

To create or modify a release rule:

Go to the Resource Manager’s Release Rules tab

Choose an existing resource release rule or create a new one

Select the resource requirement that the rule should be associated with

Page 81: Addendum ExtendSim

Advanced Resource Management 73Additional information

Resources

In the Quantity Expression table, specify the Release Quantity

PoliciesWhen a resource transitions to the idle status, it immediately attempts to service an item that is waiting for advanced resources. If multiple items are waiting, they are serviced in an order gov-erned by settings on the Resource Manager’s Policies tab.

As discussed in more detail below, the Policies tab is for:

• Setting a resource allocation policy that determines which item gets the next idle resource

• Overriding the resource requirement rank. (The original resource requirement rank is entered on the Requirements tab when the resource requirement is created.)

Resource allocation policyThe top section of the tab is for determining which item, from a sorted list of all the waiting items in the model, gets the resource. How the items are sorted affects which item gets the resource.

Sorting criteriaItem properties are used to control the order in which waiting items are sorted. The properties are:

• Item priority – the lowest number, including negative values, is the highest priority

• Value attribute

• DB Address attribute

• Queue arrival time

• Resource requirement rank. When a resource requirement is created, it gets a ranking value that is set in the Requirements tab’s Resource requirement rank field. And before a waiting item can be released from an advanced resource queue, it must be associated with a resource requirement. Since each item has one or more resource requirements where each has a rank, the resource requirement rank can be used to “sort” waiting items. A resource requirement rank must be ≥ 0; the default resource requirement rank is 1. (Also see “Overriding the resource requirement rank” on page 74.)

Items can be sorted by any one of these properties, in ascending or descending order. A secondary sorting order is also allowed.

☞ The default is to sort items by the ranking of their resource requirements and then by the time the item arrived to the queue.

AllocationThere are two possibilities for item selection:

• By default, the resource picks the first item in the sorted list whose entire resource requirement can be met by available resources. If the first item doesn’t qualify, the next item’s qualification is assessed, and so forth. If none of the items qualify, the resource waits until a qualifying item appears in the Queue.

• If Only try the top sorted item is selected, the resource will only look at the first item in the sorted list. If its entire resource requirement can be met, it is picked. If not, the resource waits until a qualifying item appears at the top of the sorted list of waiting items.

Page 82: Addendum ExtendSim

74 Advanced Resource ManagementResource requirements

Res

ourc

es

Overriding the resource requirement rankOne of the properties that waiting items can be sorted by is the resource requirement rank, discussed in “Sorting criteria” on page 73. The resource requirement rank is a single value that applies by default to every resource that is part of the particular resource requirement. A resource require-ment rank must be ≥ 0; the default resource requirement rank is 1.

On the Resource Manager’s Policies tab, the resource requirement rank can be overridden for an individual resource. This means that, only for the specified resource, a resource requirement’s rank will differ from the original value entered on the Requirements tab. Since a resource requirement could be composed of multiple resources, each resource that is part of a resource requirement can override the resource requirement’s rank with a different value.

Overriding is accomplished by changing the values in the RR Rank column in the Override resource requirement rankings table.

☞ The original ranking values are displayed in square brackets in the RR Rank column.

Resource requirementsA resource requirement is a named rule that specifies how many of what types of resources to allo-cate to an item. An advanced resource queue will only release an item if the resources required by the item are available. Resource requirements are created:

• Manually, as discussed below

• By default, as discussed starting on page 80

Hierarchy of a resource requirementResource requirements are developed in the Requirements tab of the Resource Manager block. They are created using a three-level hierarchy of components:

1) Resource requirements are the top level component. They consist of quantity expressions.

2) Quantity expressions are components that are created at the middle level of the hierarchy. They consist of filtering conditions.

3) Filtering conditions are created at the bottom level of the hierarchy.

Steps to take before creatingBefore creating a resource requirement, it is helpful to perform the following steps:

1) Identify the components that will be needed:

a)Determine how many distinct collections of resources are required

b)Identify the criteria that are common to each resource collection

c)Determine the quantity required from each collection

d)Determine if alternative collections could be considered if the quantity cannot be obtained from a particular collection

e)Identify the criteria for any of those alternative collections

f )Determine the quantity required from any of the alternative collections

Wash/Wax resource requirement is ranked higher

Page 83: Addendum ExtendSim

Advanced Resource Management 75Resource requirements

Resources

2) Use the results of the process above to determine how many quantity expressions are needed. A quantity expression will be required for each distinct resource collection from which a quantity will be selected.

3) Once the quantity expressions have been identified, determine how many different criteria are needed to represent all of the distinct resource collections referred to in step 1. Each criterion is expressed as a condition on the values of a resource or group property and is referred to as a fil-tering condition. Filtering conditions are used in quantity expressions to generate the collec-tion of resources from which the specified quantity is selected.

How to create a new resource requirementAs was shown starting on page 65 the steps in manually creating a resource requirement are:

Create the filtering conditions needed by the quantity expressions

Create the quantity expressions needed by the resource requirement

Create a resource requirement using the quantity expressions

Filtering conditionsFiltering conditions are the smallest component of a resource requirement and creating one or more filtering conditions is the first step in defining a resource requirement. A filtering condition is a specified aspect of a resource or group property. For example, a filtering condition could be that the resource comes from a particular pool or that a group member has a skill level higher than a certain number.

Saved filtering conditions are used in quantity expressions, discussed later. When a quantity expression with a filtering condition gets executed, the population of resources is narrowed to a list of resources that meet the specific condition that was filtered for.

The Create/modify filtering conditions frame (Resource Manager’s Requirements tab) is where filtering conditions are created and edited.

Types of filtering conditionsFiltering conditions filter on properties. There are two types of filtering conditions, depending on whether the properties belong to resources or group members:

1) A resource filtering condition filters on one specified resource property, as shown in the screenshot to the right. A resource property is one of the dynamic or static properties in the Resources table. Examples of resource properties are: pool, total idle time, or a group. (See “Resource properties” on page 70.)

2) A group filtering condition filters on one specified group prop-erty – either Skill Level or Resource Rank. (See “Group prop-erties” on page 72.) There must be at least one group in the model to enable group filtering conditions.

Note that a group filtering condition is not associated with a particular group. Instead, it is a condition on the properties of group members generally. As discussed in “Using group filter-ing conditions” on page 78, a group filtering condition must have a corresponding resource filtering condition that limits the collection of resources to a specific group.

Creating a new filtering condition

Page 84: Addendum ExtendSim

76 Advanced Resource ManagementResource requirements

Res

ourc

es

Creating a filtering conditionOn the Requirements tab, check the Create/modify filtering conditions frame to enable it. Then either choose an existing filtering condition from the popup menu and modify it or create and name a new filtering condition.

Each filtering condition is composed of one conditional operator applied to one property. The conditional operators are: =, >, <, >=, <=, and != (not equal). The property can be a resource prop-erty or a group property. (See “Properties” on page 70). Note that group properties are only enabled if the model has at least one group of resources.

☞ Each filtering condition filters for one condition of one property.

TestingOnce the property and condition selections have been made, use the Test button to apply the selections to the model’s resources. This opens a table displaying all the resources that match the selected filtering condition. For a group filtering condition, every resource that has the specified group property will be displayed, no matter what group it is in.

For the definition of a filtering condition, select it in the Choose filtering condition popup menu of the Resource Manager’s Requirements tab. The settings will be for the selected filtering condition.

SavingA new or modified filtering condition won’t be available for use until the Save or Save As button has been clicked. Until the filtering condition is saved, its name will be displayed in red.

☞ Saving the filtering condition saves it to a database. To save the database, save the model.

Deleting a filtering conditionIf you try to delete a filtering condition, it may give an error message that it is being used by a quantity expression. Before the filtering condition can be deleted, any quantity expressions that use it must also be deleted. And before those quantity expressions can be deleted, any resource require-ments that use them must also be deleted.

Default filtering conditionsBy default one filtering condition is automatically created for each pool that was created using a Resource Pool block; default filtering conditions are optional if pools or groups are created using the Resource Manager block. Default filtering conditions have “FC_” before the name of the pool or group. See “Default resource requirements” on page 80.

Examples of filtering conditionsExamples of filtering conditions include:

• FC#1 – filter using a resource property Pool that has the condition = Pool 2

• FC#2 – filter using a resource property Total Idle Time that has the condition > 10

• FC#3 – filter using a group property Skill Level that has the condition = 2

• FC#4 – filter using a resource property Group that has the condition = Group A

As discussed below, saved filtering conditions are used to create a quantity expression.

Quantity expressionsDefining quantity expressions is the second step towards creating a resource requirement. A quan-tity expression is a logical statement that is used to select a certain quantity of resources from an identified collection of resources. The collection of resources is limited by the combination of fil-tering conditions that is entered in the expression, which can be quite complicated. However, for

Page 85: Addendum ExtendSim

Advanced Resource Management 77Resource requirements

Resources

each quantity expression only the specified quantity of qualifying resources will be drawn from the entire identified collection.

Each quantity expression consists of three clauses:

1) A Quantity clause that specifies how many resources to select from a resource collection.

2) A WHERE clause that generates the resource collection. The WHERE clause contains the cri-teria that resources must satisfy in order to be selected. The criteria are specified using one or more filtering conditions.

3) An optional Order By clause that is used to sort the collection of resources generated by the WHERE clause. The collection of resources is sorted based on the values (in ascending or descending order) of a selected resource property.

When the simulation is run, the quantity expression will be applied as shown below:

The Create/modify quantity expressions frame (Resource Manager’s Require-ments tab) is for specifying the quan-tity of resources to be drawn from a set of resources defined by filtering conditions. The result is then saved as a quantity expression for use when building a resource requirement.

Choices for the Quantity clauseThe quantity is entered using a popup menu at the right of the SELECT button, shown in the screen shot above. As seen in the screen shot to the right, the choices for popup menu are:

• All the resources

• A quantity determined from a named attribute

• A quantity that is user-input

Unless it is limited by a WHERE clause in the quantity expression, the selected number of resources will be drawn from all the resources in the Advanced Resourcess’ Resources table.

How a quantity expression gets applied during the simulation run (“Order By” is optional)

Page 86: Addendum ExtendSim

78 Advanced Resource ManagementResource requirements

Res

ourc

es

Choices for the Order By clauseOrdering the resources is optional. If chosen, any one of the resource properties listed on page 70 can be used to sort the resources. The resources at the top of the sorted list will be used first.

The default is that an ascending value of utilization is used to sort the resources. This causes resources that are being utilized the least to be selected first.

Creating a quantity expressionOn the Requirements tab, check the Create/modify quantity expressions frame to enable it. Then either choose an existing quantity expression from the popup menu and modify it or create a new quantity expression.

To create a new quantity expression:

First determine if the expression should start with all the resources from the Resources table or only a specified number of those resources (see “Choices for the Quantity clause”, above).

Also decide if the resources should be sorted by a property (see “Choices for the Order By clause” on page 78). Resources at the top of the list will be chosen first.

Then click the SELECT button to place the quantity in the expression area.

At this point, the quantity expression requires a specified quantity (all or a number) of resources. However, the collection of resources is all the resources in the Resources table of the Advanced Resources database. In complex models, that could mean a very large number of resources.

☞ In models with large numbers of resources, it will speed simulation run times if the first part of the expression uses a filtering condition that limits the search area to a pool or group.

To narrow the search area, click the WHERE operator. Then insert a filtering condition; typically this would be a resource filtering condition that references a Pool or Group (for example, Property: Pool = Pool 2).

To use additional filtering conditions, use the AND/OR operators in conjunction with grouping parentheses. The result is displayed in the expression area.

☞ See below if group filtering conditions are used.

ExampleThe quantity expression named Pool2_IdleResources is shown in the screen shot below. It was cre-ated using a quantity of 3 and two of the filtering conditions (FC#1 and FC#2) that were shown in “Examples of filtering conditions” on page 76.

The quantity expres-sion states that 3 resources will be required and that each resource must come from Pool 2 (FC#1 is True) and have a total idle time > 10 (FC#2 is True).

Using group filtering conditionsWhen creating a quantity expression, group filtering conditions must be used in conjunction with a resource filtering condition that specifies a particular group. This is accomplished by choosing Group as the property for the resource filtering condition.

Page 87: Addendum ExtendSim

Advanced Resource Management 79Resource requirements

Resources

For example, assume the members of Group A and Group B all have Skill Level = 2. If the quantity expression includes a condition that filters on the group property (Skill Level = 2), it must also include a second condition that filters on a resource property that is the Group (either Group = Group A or Group = Group B).

☞ When creating a quantity expression, group filtering conditions must be used in conjunction with a resource filtering condition that specifies a particular group. And the resource filtering condition must be specified before the group filtering condition can be added to the expression.

TestingThe application of a quantity expression selects a specified quantity of specified resources. It is then used to create the resource requirement. To determine if the expression selects the resource that is wanted, use the Test button.

SavingA new or modified quantity expression won’t be available for use until the Save or Save As button has been clicked. Until the quantity expression is saved, its name will be displayed in red.

☞ Saving the quantity expression saves it to a database. To save the database, save the model.

Deleting a quantity expressionIf you try to delete a quantity expression, it will probably give an error message that the quantity expression is being used by a resource requirement. Before the quantity expression can be deleted, any resource requirements that use it must also be deleted.

Default quantity expressionsOne quantity expression with a default quantity of 1 is automatically created for each pool created using a Resource Pool block; default quantity expressions are optional if pools or groups are cre-ated using the Resource Manager block. A corresponding resource requirement is optionally cre-ated when a new quantity expression is created. See “Default resource requirements” on page 80.

Resource requirementsThe final step is to create the actual resource requirement – what the Queue requires so that it can let its items leave and continue traveling through the model. Resource requirements are logical expressions consisting of one or more quantity expressions combined using AND/OR operators in conjunction with grouping parentheses.

The Create/modify resource requirements frame (Resource Manager’s Require-ments tab) is for specifying what resources are required for items to leave the Queue. The result is saved as a resource requirement.

Resource requirement rankWhen it is created, each resource requirement gets a resource requirement rank. The resource requirement rank must be ≥ 0; the default rank is 1. This ranking is used for sorting items that are waiting for resources, as discussed in “Resource allocation policy” on page 73. It can be overridden for a particular resource, as discussed in “Overriding the resource requirement rank” on page 74.

Creating a resource requirementOn the Requirements tab, enble the Create/modify resource requirements frame. Then either choose an existing resource requirement from the popup menu and modify it or create a new one.

Page 88: Addendum ExtendSim

80 Advanced Resource ManagementResource requirements

Res

ourc

es

To create a resource requirement, either choose a quantity expression from the popup menu or start with a grouping operator. Use the AND and OR operators between quantity expressions; use the grouping operators to group quantity expressions. The resource requirement rank can be changed from the default of 1.

ExampleThe tutorial on page 67 showed how to create a resource requirement. To determine if the expres-sion selects the resources that are wanted, use the Test button.

SavingA new or modified resource requirement won’t be available for use until the Save or Save As button has been clicked. Until the resource requirement is saved, its name will be displayed in red.

☞ Saving the resource requirement saves it to a database. To save the database, save the model.

Default resource requirementsUnder certain circumstances the ARM system creates a default resource requirement. In some cases this is done automatically and in other cases it is optional.

The circumstances when a default resource requirement could be created are:

• Every time a new pool is created using a Resource Pool block

• Optionally when a new pool is created using a Resource Manager block

• Optionally when a new group is created using a Resource Manager block

• Optionally when a new quantity expression is created using a Resource Manager block

When a new pool or group is createdWhen a default resource requirement is created for a new pool or group, 3 components are created:

1) A filtering condition named “FC_[name of pool or group]”, with the condition that:

• For a new pool, the resource must come from the new pool (“Filter using properties of resources, where the property = [the new pool]”).

• For a new group, the resource must come from the new group (“Filter using properties of resources, where the property = [the new group]”).

2) A quantity expression named “1 from [name of pool or group]”, indicating that the require-ment is for exactly 1 resource from the pool or group.

3) A resource requirement named “RR_[name of pool or group]”. (When a resource requirement is automatically created for a new pool or group, it is the same as the quantity expression.)

Because the default filtering condition is the newly created pool or group and the default quantity expression is 1 resource from that pool or group, the default resource requirement is that 1 resource is required from the new pool or group.

☞ The default resource requirement for a new pool or group is that one resource will be required.

When a quantity expression is createdWhen a new quantity expression is created, the option is given to create a corresponding default resource requirement. The default resource requirement will be the same as the quantity expres-sion, but its name would be preceded by “RR”. The name of the resource requirement can be changed before the requirement is saved.

Page 89: Addendum ExtendSim

Advanced Resource Management 81Comparison of the three resource methods

Resources

Comparison of the three resource methods

Technique Resource Item Block Resource Pool Method Advanced Resource Management

ResourceRepresentation

Resources are represented by items that are created and reside in Resource Item blocks. The Resource Item block maintains sta-tistics. Attributes can be used to store properties and statistics for individual resources.

Resources are represented as a quantity in a pool in the Resource Pool block. Individual resources can-not have properties and are thus indistinguishable within a pool. The Resource Pool block main-tains statistics.

Resources are represented in a table in an internal database. Each resource is a record in this table. The fields in the table are used to store property values and statistics for individual resources.

RequirementsSpecification

There is no dedicated user interface for specifying resource item require-ments. Typically, Queue Equation or Queue Matching blocks are used to hold items until the required resource items are available. Then, released items are batched with resource items.

Requirements are speci-fied using a data table in the Queue. The table spec-ifies the required quantities from one or more pools. The required pools are selected using the settings in the dialog. The required counts can be specified using attribute values or connectors.

Requirements are speci-fied using logical expres-sions created in the dialog of the Resource Manager block. These expressions consist of components that specify required quantities and filtering conditions that limit the set of resources to those wanted.

Advantages 1. Because resources are items, they can have prop-erties that allow them to be distinguished individually.

2. Modelers have full con-trol over the logic govern-ing how resources are utilized.

1. Does not require con-nections to blocks.

2. Does not need complex routing logic to control the allocation and release of resources.

3. Resources automatically know which items are waiting for them.

4. Provides the capability to globally prioritize the allocation of resources to the highest ranked items.

1. Does not require con-nections to blocks nor complex routing logic.

2. Resources automatically know which items are waiting for them.

3. The allocation of resources to the highest ranked items is globally prioritized; multi-tiered ranking is supported.

4. Resources have proper-ties that allow them to be distinguished individually.

5. Allows for very complex resource requirements and provides a flexible mecha-nism for creating resource release rules.

6. All information about resources is globally avail-able to the model; details can be logged in the data-base.

Page 90: Addendum ExtendSim

82 Advanced Resource ManagementThe Advanced Resources database

Res

ourc

es

The Advanced Resources databaseThe Advanced Resources database provides the architectural framework for the ARM system. ARM uses the database to represent, manage, and track the status and properties of resources, pools, and groups, as well as resource allocation and release rules. The database is automatically created when a Resource Manager block is added to a model. It is easily accessed by clicking the View Database button in the Resource Manager’s tabs or through the ExtendSim Database menu.

There are several tables in the database. The most relevant to the modeler are described below.

Also see “Primary transactions for ARM” on page 83.

Blocks that compose the ARM systemWhile the Resource Manager block is central to the ARM architecture, several other blocks per-form important functions.

Disadvantages 1. The Resource Item block must be connected in the model such that the resources it outputs can be batched with the items that require them.

2. A resource item cannot “see” the items waiting for it. Routing blocks must be used to direct the resource item to the correct Batch or Unbatch block.

1. Does not allow the use of attributes or other prop-erties to track information about individual resources.

2. It is more difficult to control the complex sched-uling of competing resources across a number of different queues using resource pools.

1. The complexity of this method requires more learning time compared to the other methods.

2. Advanced Resource Management is only avail-able with the ExtendSim AT and ExtendSim Suite packages.

Table Description

Pools Summarizes the results from the simulation run (total idle time, total utilization, and so forth) for each pool.

Resources Lists each resource and its properties, current status, and statistical information.

Resource Transaction Log Depending on the settings in the Resource Manager’s Event Logging tab, this table displays the transactions, status transitions, and results of the simulation run.

Technique Resource Item Block Resource Pool Method Advanced Resource Management

Page 91: Addendum ExtendSim

Advanced Resource Management 83Primary transactions for ARM

Resources

Primary transactions for ARMThe following diagrams and tables give an overview of how advanced resources are used in a model. The explanation is divided into three sections which describe what happens when:

• An item arrives at a Queue that is part of the ARM system

• A Resource Pool block gets a message to add or remove advanced resources

• A Shift block is used in the ARM system

☞ In the explanations, the Database Tables Used column has the following abbreviations: RO (Resource Orders), RTL (Resource Transaction Log), and RR (Resource Requirements).

Block(Library) Function When Used With Advanced Resources

Resource Manager (Item – AT & Suite)

Provides the interface for managing advanced resources, resource require-ments (allocation rules), release rules, and transaction logs. Use it to:

• Create, edit, and delete resources, pools, groups, and their properties• Create resource requirements• Define release rules• Define policies for allocating idle resources to items• Enable event logging• View statistical results

Queue(Item)

Controls the ordering and allocation of resources Note: Selected queue behavior must be advanced resource queue.

Queue Equation(Item)

The equation can be used to conditionally allocate requirements to items released from the Queue Equation block. Note: Enable advanced resources (AR) on the block’s Options tab.

Resource Pool(Item)

A shortcut for creating a pool of resources. Controls the initial properties and number of resources in a pool and reports aggregated results for its resources. Notes: 1) Selected behavior must be advanced resource pool. 2) Since all its capabilities can be achieved using the Resource Manager block, this block is optional. 3) Resource Pool resources do not have properties unless the resources are advanced.

Resource Pool Release(Item)

Controls the release of resources. Notes: 1) Selected behavior must be release advanced resources. 2) Even if the model doesn’t use any Resource Pool blocks, use of Resource Pool Release blocks is optional only if the resources are considered to be consumed and there are no concerns about model size and computer memory due to the accumulation of excess records for the non-disposed resources.

Statistics(Value)

Reports statistics for individual resources. Especially useful for exporting data and for performing batch means and multi-run analyses.

Shift(Item)

Notifies the Resource Manager block when there is a change to a shift being used by one or more advanced resources.

Page 92: Addendum ExtendSim

84 Advanced Resource ManagementPrimary transactions for ARM

Res

ourc

es

Item-initiated ARM transactionsThis part explains what happens when an item arrives at a Queue that is part of the ARM system.

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

1 An advanced resource item arrives in the Queue.

Queue

2 The Queue orders resources from the Resource Manager.

Queue ResourceManager

3 The Resource Manager generates a resource order and assigns a Resource Order ID to the item.

RO, RTL

4 The Resource Manager checks for availability of required resources.

RO, Resources, RR, RTL

5 The Resource Manager notifies the Queue when the required resources are available for the item.

ResourceManager

Queue

6 The Queue checks if it is blocked. If it is not, it grants permission to the Resource Manager to allocate the resources to the item.

Queue ResourceManager

RO, Resources, RTL

1

3

5

9

2

7, ,

6,

8

10

11

QUEUE RESOURCE POOL RELEASE

RESOURCE MANAGER

INTERNAL DATABASE

4

Page 93: Addendum ExtendSim

Advanced Resource Management 85Primary transactions for ARM

Resources

7 The Resource Manager allocates the resources and changes their status to busy.

RO, Resources, RTL

8 The item with the resources allocated to it is released to the model.

Queue

9 The item arrives in the Resource Pool Release.

Resource PoolRelease

10 The Resource Pool Release sends a command to the Resource Manager to release resources from the item.

Resource PoolRelease

ResourceManager

RO, Resources, Resource Release Rules, RTL

11 The Resource Manager releases resources from the item and changes the status of the released resources from busy to their pending status.

RO, Resources, RTL

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

Page 94: Addendum ExtendSim

86 Advanced Resource ManagementPrimary transactions for ARM

Res

ourc

es

Resource Pool-initiated ARM transactionsWhen a Resource Pool block receives a message that resources need to be added or removed, the transactions occur as illustrated below.

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

1 The Resource Pool receives a message to add/remove resources.

Resource Pool

2 The Resource Pool notifies the Resource Manager that the quantity of pool resources has changed.

Resource Pool ResourceManager

3 The Resource Manager changes the quantity of resources for the pool.

Resources, RTL

4 If resources were added, the Resource Manager attempts to service waiting items.

RO, Resources, RR, RTL

5 If items can be serviced, the Resource manager notifies Queues with waiting items that the required resources are available.

ResourceManager

Queue

1

5

2

QUEUE

RESOURCE MANAGER

INTERNAL DATABASE

4

RESOURCE POOL

6

3 7,

8

Page 95: Addendum ExtendSim

Advanced Resource Management 87Primary transactions for ARM

Resources

ShiftWhen advanced resources use a Shift block, the transactions are as follows.

6 The Queues check for being blocked. If they are not blocked, they grant per-mission to the Resource Manager to allocate the idle resources to the items.

Queue ResourceManager

RO, Resources, RTL

7 The Resource Manager allocates the resources and changes their status to busy.

RO, Resources, RTL

8 The Queues release the items. Queue

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

1 The Shift receives a status change mes-sage.

Shift

2 The Shift sends a shift status change message to the Resource Manager.

Shift ResourceManager

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

5

2

QUEUE

RESOURCE MANAGER

INTERNAL DATABASE

4

6

3 7,

8

SHIFT

1

Page 96: Addendum ExtendSim

88 Advanced Resource ManagementPrimary transactions for ARM

Res

ourc

es

3 The Resource Manager changes the sta-tus of all resources that use the Shift.

Resources, RTL

4 If any resources have transitioned to the idle status, the Resource Manager attempts to service waiting items that depend on those resources.

RO, Resources, RR, RTL

5 If items can be serviced, the Resource Manager notifies Queues with waiting items that the required resources are available.

ResourceManager

Queue

6 The Queues check for being blocked. If they are not, they grant permission to the Resource Manager to allocate the idle resources to their items.

Queue ResourceManager

RO, Resources, RTL

7 The Resource Manager allocates the resources and changes their status to busy.

RO, Resources, RTL

8 The Queues release the items. Queue

# Description Message-Sending Block

Message-Receiving Block

Database Tables Used

Page 97: Addendum ExtendSim

User Guide Addendum

Block Changes

Page 98: Addendum ExtendSim

90 Block ChangesHierarchical blocks

Blo

cks

Hierarchical blocks• The name of the top level model now appears in angle brackets (< >) in the title bar of each hier-

archical block.

▲ printed User Guide, page 541

• 3D objects can now be represented by multiple blocks within a hierarchical block. See “Hierar-chical blocks and 3D animation” on page 96.

▲ printed User Guide, page 474

New blocks in librariesThere are several new blocks in ExtendSim 8. Note that some blocks are specific to a particular ExtendSim product while others are included in every ExtendSim package.

☞ All page references are to this Addendum.

Block Library (product) Use

Block Info Utilities (CP, OR, AT, Suite) Reports information (name, number, posi-tion, etc.) about the block connected to its input connector.

DBStatistics Value (CP, OR, AT, Suite) Calculates statistics for all of the records in a database field.

Event Monitor Utilities (CP, OR, AT, Suite) Displays the event calendar in discrete event models, revealing the event times for all event posting blocks.

Link Alert Utilities (CP, OR, AT, Suite) Registers a section of a database so that the block receives a message when data in the linked database changes.

Model Interface Utilities (CP, OR, AT, Suite) Creates an interface for controlling a model.

Memory Usage Utilities (CP, OR, AT, Suite) Calculates the amount of memory required for each block, global array, or database table in the model. It is helpful in locating where memory is being used in large models.

MYOB DB Dialogs ModL Tips (CP, OR, AT, Suite)

Shows how to develop ExtendSim database popup menus.

Resource Manager Item (AT, Suite) Develop sophisticated resource structures. See “Resource management” on page 50 of this Addendum.

Scenario Manager Value (AT, Suite) Evaluate and compare model configurations. See “Scenario analysis” on page 34 of this Addendum.

Slider Utilities (CP, OR, AT, Suite) Provides a flexible slider for models. It can be cloned to the worksheet or Notebook, be linked to a database, and more.

Page 99: Addendum ExtendSim

Block Changes 91Changed blocks in libraries

Blocks

Changed blocks in librariesWhile there have been enhancements to many of the blocks, the following blocks have significant changes.

☞ All page references are to this Addendum.

Value library

Query Equation Value (AT, Suite) Intelligently searches a database and reports the best-ranked record. See “Query Equation and Query Equation(I) blocks” on page 20 of this Addendum.

Query Equation(I) Item (AT, Suite) Intelligently searches a database and reports the best-ranked record when an item arrives. See “Query Equation and Query Equation(I) blocks” on page 20 of this Addendum.

Block Changes

Catch Value Based on their broadcast mode, you can limit which Throw Value blocks to get the value from.

Command Uses COM as the underlying inter-application technology, replacing IPC.

When sending a command to a selected Excel workbook, the dialog has a new popup menu that lists the workbook’s macros.

Additional control over when the command is sent.

Three check boxes for controlling the behavior of Excel after the command is sent, after the workbook is saved, and after the workbook is opened.

Equation The Options tab has more choices for controlling when the equation is calcu-lated. There is also a new check box to enable control of messaging.

There is a new mechanism for copying and deleting rows in the middle of a table. The options appear when the green +/- resize button is clicked.

When the number of rows is increased, the contents of the current last rows are used as the content for the newly added rows.

The names of some input and output variable types have been changed and new variable types have been added. See “Equation components” on page 10 of this Addendum.

As is true for other equation-based blocks, the block now has an Equation Edi-tor and Debugger and it supports include files. See pages 13, 14, and 17of this Addendum.

When the cursor hovers over the Variable Value columns, tool tips display the names associated with the database indexes for “DB Read” and “DB Write” type variables.

Block Library (product) Use

Page 100: Addendum ExtendSim

92 Block ChangesChanged blocks in libraries

Blo

cks

Item library

Optimizer Supports Shift-clicking to add dialog variables to the Objectives table. See “Ref-erencing dialog variables” on page 100 of this Addendum.

Read The Options tab has several new check boxes for more control over when a read takes place.

Throw Value Has a new mode for broadcasting the value within a hierarchical block.

Write The Options tab has several new check boxes for more control over when a write takes place.

Block Changes

Activity A new Contents tab that shows either current information about items or a his-torical log. Since displaying during the run can impact performance, the tab has 2 other options for when contents are calculated and displayed.

The Results tab now provides information about shifts and blocked/busy/idle times as well as explicit control over how utilization is calculated.

Create Supports creating items from multiple random streams. This feature requires the use of the ExtendSim database but is infinitely scalable.

A maximum number of items, which includes item quantities, can be set if the block creates items infinitely. A Maximum item creation events box defines the maximum number to be just generated items, ignoring item quantities.

Name tracking is supported when the block creates items by schedule. If the schedule has DB Address Attributes defined in it, the block will now do name tracking on any relevant changes that might take place in the database.

When creating values by schedule, the block supports multiple columns, i.e., each row in the schedule may now create “n” values for the output connectors.

Equation(I) There is a new mechanism for copying and deleting rows in the middle of a table. The options appear when the green +/- resize button is clicked.

When the number of rows is increased, the contents of the current last row are used as the content for the newly added rows.

The names of some input and output variable types have been changed and new variable types have been added. See “Equation components” on page 10.

As is true for other equation-based blocks, the block now has an Equation Edi-tor and Debugger and it supports include files. See pages 13, 14, and 17 of this Addendum.

Executive The Item Contents tab is for locating blocks in the model that have Contents tabs and remotely controlling what is being tracked. For each specified block, you can change between showing current currents or a historical log, select one or more attributes to track, and enable/disable the tracking. Use the Select col-umn to choose all the blocks, none of the blocks, or to toggle between them.

Block Changes

Page 101: Addendum ExtendSim

Block Changes 93Changed blocks in libraries

Blocks

Queue A new Contents tab that shows either current information about items or a his-torical log. Since displaying during the run can impact performance, the tab has 2 other options for when contents are calculated and displayed.

Has a new behavior allowing it to be set as an advanced resource queue. See “Advanced Resource Management” on page 51 of this Addendum.

Queue Equation A new Contents tab; see Queue.

There is a new mechanism for copying and deleting rows in the middle of a table. The options appear when the green +/- resize button is clicked.

When the number of rows is increased, the contents of the current last row are used as the content for the newly added rows.

The names of some input and output variable types have been changed and new variable types have been added. See “Equation components” on page 10 of this Addendum.

As is true for other equation-based blocks, the block now has an Equation Edi-tor and Debugger and it supports include files. See pages 13, 14, and 17 of this Addendum.

Queue Matching A new Contents tab; see Queue.

The block now supports FIFO, LIFO, Priority, and Attribute ordering rules. There is a value input connector to specify the order.

Use the Common Group check box to classify one match attribute value as “common”. An item with this is available for matching with any other group.

Performance has been improved and item information, which greatly impacts performance, is now optional.

Read(I) There is a new mechanism for copying and deleting rows in the middle of a table. The options appear when the green +/- resize button is clicked.

When the number of rows is increased, the contents of the current last row are used as the content for the newly added rows.

Options have been moved to their own tab. A new option is for choosing the time units format in which data from a date field should be read – either simula-tion time or date time.

The Read table has three new options for specifying the record index: Item Count, Record Search Using Attribute, Record Search Using Connector. The Read table also has a new option, Previous result, for specifying table, field, and record indexes. This uses the result from a previous read (a row higher in the table) as an index. Consequently, modelers will no longer have to place two or more Read(I) blocks in a row in a model.

Resource Pool Has a new behavior allowing it to be set as an advanced resource pool. See “Advanced Resource Management” on page 51 of this Addendum.

Resource Pool Release

Has a new behavior allowing it to release advanced resources. See “Advanced Resource Management” on page 51 of this Addendum.

Block Changes

Page 102: Addendum ExtendSim

94 Block ChangesChanged blocks in libraries

Blo

cks

Rate library

ValveA popup menu has been added to this block’s Flow Control tab so you can start the simula-tion run with the goal off, on, or defined by the value at the G connector.

The fourth bullet on page 338 of the printed User Guide should read: “The popup menu option “Start run with goal Off” has been selected. (This causes the goal to be in the Off state at the start of the simulation.)”

▲ printed User Guide, pages 338 and 340

Utilities library

ButtonsThis block has a new Options tab for controlling when the equation is calculated – when the model is opened, when an enclosing hierarchical block is opened, and so forth.

▲ printed User Guide, page 507

Shutdown The Shutdown is now integrated with the Shift block, allowing a remote sched-uled shutdown from the Shift.

Failures can now be caused by the progression of simulation time, uptime only, or item count.

The competing failures mode is now called multiple fail stream. In single fail stream mode, failures are caused either by the progression of uptime or the item count. In multiple fail stream mode, the progression of simulation time option is also available.

Unbatch Now has the option to create duplicates of each item’s batched preserved items.

▲ printed User Guide, pages 204-205

Write(I) There is a new mechanism for copying and deleting rows in the middle of a table. The options appear when the green +/- resize button is clicked.

When the number of rows is increased, the contents of the current last row are used as the content for the newly added rows.

Options have been moved to their own tab. A new option is for choosing the time units format in which data from a date field should be read – either simula-tion time or date time.

A popup chooses if the data replaces the destination data or is appended to it.

The Write table has three new options for specifying the record index: Item Count, Record Search Using Attribute, Record Search Using Connector.

Block Changes

Page 103: Addendum ExtendSim

User Guide Addendum

Odds and Ends

Page 104: Addendum ExtendSim

96 Odds and Ends3D animation

Odd

s/E

nds

3D animationThe ExtendSim Suite product has 3D animation capabilities, called E3D animation. The follow-ing E3D improvements have been made in release 8.

Stacking overflowsIn release 7 mountStacks were unlimited in height. Blocks that held a large number of items would display an equally large number of objects in the E3D world, causing the simulation to run slowly or fail.

In release 8, queues, activities, and resources (Item library) have a dialog item so you can limit the number of items visually represented in the E3D world. If not overridden, the default mountStack limit is 10.

▲ printed User Guide, page 410

Collision avoidanceIf objects in the E3D world are not meant to collide, they will now appear to pass through each other. This is automatically handled by the Item library blocks. If you program, a new function and message handler give you complete control over how collisions are handled. See the function “E3DMountStackLimit(integer blockNumber, integer limit)” on page 112 of this Addendum.

Hierarchical blocks and 3D animationBy default, hierarchical blocks and the blocks within them have no representation in the E3D win-dow. Through dialog settings however, some or all of the enclosed blocks can be represented by 3D objects.

To cause a block within an H-block to have a 3D object representation, check Link to enclosing H-block on the block’s Block Animation tab. If 3D representation is chosen for multiple blocks within the H-block, each 3D object will appear in the E3D window in the same positional relationship that the block has inside the hierarchical block.

To change the overall location of the 3D objects, move the home position of the hierarchical block using the Set button and positional arrows on the Block Animation tab. The arrows cause the home position to be moved in 0.5 meter increments; the Set button allows for exact parameters.

▲ printed User Guide, page 474

Shelf objectFor custom object builders, the Shelf object now has multiple mount point behaviors.

▲ printed User Guide, page 392

File menu changeThe only change to the File menu involves the Network License command.

Network License☞ This command is only enabled if the ExtendSim application is a concurrent-user network license.

The Network License command has several options: License Info, Check Out License, Check In License, and Remove License. For release 8, the License Info options changed and there are two new log files.

Page 105: Addendum ExtendSim

Odds and Ends 97File menu change

Odds/Ends

License InfoThe License Info window, shown at right, provides information about network license, such as the maximum number of concurrent users allowed, the number of current users, the utilization, and the name of the Server that has the license management file. The window also has several buttons:

• Create Users List. Creates and opens a list of licenses where ExtendSim is open and the licenses are connected to the Server (that is, not checked out).

• Open Users List. Only needed when opening a Users list that was created at an earlier time

• Create Checkout List. Creates and opens a list of the licenses currently checked out from the Server.

• Open Checkout List. Only needed when opening a Checkout list that was created at an earlier time.

☞ The WanUsers and WanExportList text files are stored in each Client’s Documents folder. Creat-ing these files automatically replaces any existing files of the same name. To preserve the files, use the Save As command to rename the file or copy the file to a new location.

Log filesTwo log files are automatically created on the Server and stored in the Server’s ExtendSimServer folder:

• WANUtilLog.txt contains a record of all actions taken by the networked Clients. This includes when each connection was made to the Server and who made it, as well as when licenses were checked in or checked out and who did it.

• WANExportLog.txt contains just the information about the checking in and checking out of licenses.

These files can get quite large. They can be deleted or archived if necessary – ExtendSim will create a new file if the old one is not found.

▲ printed User Guide, page 683

Page 106: Addendum ExtendSim

98 Odds and EndsEdit menu changes

Odd

s/E

nds

Edit menu changes

Open Dynamic Linked Blocks commandThe command Edit > Open Dynamic Linked Blocks opens the Find Links dialog, shown on the right.

☞ In release 8 this dialog also finds registered blocks. Since they are mainly for developers, registered blocks are discussed on page 105.

The Find Links dialog is useful for locating and examining linked dialog items or registered blocks.

The options in the dialog allow you to choose where you want to search (the contents of databases, global arrays, and/or dynamic arrays) and what you want to find (code-defined links, user-defined links, or registered blocks). User-defined links were created by the modeler through the user inter-face; code-defined links were defined by block developers through ModL code. Registered blocks do not have any specific dialog items associated with a link. Instead, the block just requests that it be informed when the linked data source changes.

The DB selectors and the GA popup menu on the right of the dialog specify which database or global array structure will be searched for. (Leaving the DB name or GA name popup menus to the default choices seen above will find any linked database or global array.)

When the Find Links button is clicked, ExtendSim opens the dialogs of all the blocks with the specified types of links or registration.

▲ printed User Guide, page 635

Options commandThe Options command is located in the Edit menu. It opens a dialog for setting preferences. The Libraries and Misc tabs of the Options command have some new options.

Libraries tab

Preload librariesDepending on the particular product, the major libraries (Animation 2D-3D, Item, Plotter, Rate, Utilities, and Value) preload by default. For example, launching ExtendSim CP causes the Anima-tion 2D-3D, Plotter, Utilities, and Value libraries to also open. The libraries that will open on application launch are listed in fields on the Libraries tab.

• To cause the library window to open when a library opens, check the check box next to its field.

• To cause a library to not preload, erase its name from the field.

Show legacy/prior version warningsThis new option is selected by default and protects you from using obsolete libraries in new mod-els and from unintentionally overwriting existing models with new file formats.

Link dialog for Global Array

Page 107: Addendum ExtendSim

Odds and Ends 99Develop menu changes

Odds/Ends

• As discussed on page 6, legacy libraries are included so that models created using those obsolete libraries can still run. The option causes a warning message to display if a legacy library is opened using the Library > Open Library command; the warning is not displayed if the library is automatically opened because a model is opened.

☞ Legacy libraries are no longer supported and should not be used to create new models.

• Models are not backwards compatible. Once they have been saved in a new version of Extend-Sim, models cannot be opened using a prior version. If you open an older model, ExtendSim warns that it is converting the older file to v8 format. To avoid overwriting the older file, give the File > Save As command to save the new file under a different name or save a copy of the file to a new location.

▲ printed User Guide, page 690

Misc tabNew option: Version check on application launch.

Allows ExtendSim to search for new versions when it launches, determining if the installed version is the most current version. The search occurs each time ExtendSim is launched. If the installed version is current, nothing happens. If the installed version is not current, or if ExtendSim is unable to connect to the internet, a warning is placed on the About ExtendSim startup screen.

▲ printed User Guide, page 694

Develop menu changes

Show Reserved DatabasesThis command is discussed on page 28.

Run menu changes

Run Optimization or ScenariosPreviously this command (and its related tool in the toolbar) only ran optimizations. Now it can be used to run either optimizations or scenarios, depending on which block (Optimizer or Sce-nario Manager) is placed in the model.

The Optimizer and Scenario Manager blocks are located in the Value library. Optimization is dis-cussed in the printed User Guide on pages 572-586. Scenario Management is a new feature in ExtendSim 8; it is discussed on page 96 of this Addendum.

Note that you cannot run optimization and scenarios at the same time. ExtendSim will warn if you give this command, or use the Run Optimization or Scenarios tool, with both an Optimizer and a Scenario Manager block in the model.

▲ printed User Guide, pages 579, 583, 714

Other interface changes

Getting Started modelA new model file, Getting Started, appears as a window each time you launch ExtendSim. Use it to open a recent model file, open a new model worksheet, view video clips, and access example models and other informative files.

Page 108: Addendum ExtendSim

100 Odds and EndsMiscellaneous

Odd

s/E

nds

• To cause the model to not open the next time ExtendSim 8 is launched, click Don’t Show Again. The next time ExtendSim is launched, a new blank model window will appear instead.

• If you have clicked Don’t Show Again but now want the Getting Started model to open when ExtendSim launches, enter the model name in the Edit > Options > Model tab: Default model path: Getting Started.mox.

Referencing dialog variablesSometimes a modeler must use a source block’s dialog variable as a parameter in a target block. For instance, this is how modelers set model factors and get model responses with the Scenario Man-ager block, discussed on page 96.

Blocks that use the interfaceThe following blocks reference dialog variables from other blocks:

• Find and Replace (Utilities)

• Optimizer (Value)

• Scenario Manager (Value library of ExtendSim AT and Suite)

• Statistics(Value library)

• Custom built blocks, if they use specific functions

All of the Value, Item, and Rate blocks have code that supports these interfaces; the feature is also available to block developers, as discussed in “Remote access to dialog variables” on page 103.

Methods for referencing dialog variables as factorsThere are 3 ways to add a dialog variable to target blocks:

• Shift-click. Shift-click the source parameter in the source block’s dialog. In the window that appears, select which target block should get the parameter.

• Clone drop. Drag a clone of the source parameter from the source block’s dialog and drop it onto the target block’s icon. This method is especially helpful when one or more of the blocks is within a hierarchical block.

• Manual. Manually enter the dialog variable name into a field or table in the target block’s dia-log.

☞ These methods only work if one of the target blocks is in the model.

Miscellaneous

Other item properties_Resource Order ID. This item property is only available in the Queue and Queue Equation blocks (Item library) if Store Resource Order ID in attribute is checked and the blocks are part of the Advanced Resource Management system. The property is the value of a record index in the Resource Orders table of the Advanced Resources database. The record represents the last requested requirement that was assigned to an advanced resource item.

The property is stored in itemArrayI2[][5]. Advanced resources are discussed in the chapter start-ing on page 50.

▲ printed User Guide, page 126

Page 109: Addendum ExtendSim

Developer Reference Addendum

Programming Techniques

Page 110: Addendum ExtendSim

102 Programming TechniquesReserved databases

Tec

hniq

ues

Reserved databasesExtendSim databases are internal repositories for storing, managing, and controlling model data. A reserved database is a specialized type of ExtendSim database that can be hidden from the modeler. Reserved databases provide database capabilities without the modeler having to use, or even be aware of, the reserved database.

Typically a database would be created by a modeler for a specific model. A reserved database, on the other hand, is usually created by a programmer using the database API.

▲ printed Developer Reference, page 102

ExampleA common use of a reserved database is to support the architecture of a block. For example, when the Resource Manager block (Item library of ExtendSim AT and ExtendSim Suite) is added to a model it creates a reserved database named _rM_Database. There are numerous tables in that database, each focusing on different aspects of the block and how it functions. For instance, the Dialog Colors table, shown here, stores the HSV values of the colors used for text labels in the block’s dialog. Other tables track filtering conditions, store resources with their rank-ing and skill levels, and so forth. When the modeler enters data and makes selections in the Resource Manager block, these are tracked in the reserved database. This process is invisible to the modeler.

The Optimizer block (Value library) is an example where a reserved database is used to provide a feature for the modeler. This is discussed in “Shift-click example” on page 105.

Creating and editingReserved databases are created and edited in much the same manner as you would create or edit any ExtendSim database. Some differences are:

• To notify ExtendSim that the database is to be reserved, enter a leading underscore (_) at the beginning of the database’s name. For example, the name would look like “_AReservedDB”.

• To prevent modelers from accidentally writing to reserved databases, they require special write functions. These are listed on page 118. An error message will be displayed if the special write functions are used for non-reserved databases, and vice versa.

• Since they are intended for developers, ExtendSim doesn’t support using blocks (such as Read or Write) to access reserved databases. It also doesn’t allow modelers to link dialog items to a reserved database.

• When a block that requires a reserved database is added to a model, the code of the block creates the database in the model. In most cases, unless a block that requires a reserved database is placed in the model, the model will not have any reserved databases.

• If a model has reserved databases, they will not be displayed in the Database List or at the bot-tom of the Database menu unless you first give the command Develop > Show Reserved Data-bases. By default, this command is not selected. Furthermore, the command is re initialized to off each time the model is opened.

• Even if a reserved database is not listed in the Database List or at the bottom of the Database menu, it is always accessible through ModL functions.

Page 111: Addendum ExtendSim

Programming Techniques 103Remote access to dialog variables

Techniques

Changing anything in a reserved database is equivalent to changing the code of a block. It is likely to corrupt any blocks that use it.

Remote access to dialog variablesSometimes it is useful to allow a modeler to use a stand-alone block to get or set the value of a dia-log variable in a remote block. For instance, this is how modelers set model factors and get model responses using the Scenario Manager block, discussed on page 34.

In ExtendSim there are three mechanisms for interfacing dialog variables between a stand-alone block and a remote block:

1) Manually enter the remote block’s number and dialog variable name into the stand-alone block

2) Clone-drop, using the Clone tool to drag the parameter onto the icon of the stand-alone block

3) Shift-click a dialog parameter and select from the popup menu of available options to add that parameter to the stand-alone block. This is especially helpful when one or more of the blocks is within a hierarchical block.

The Find and Replace (Utilities library), and the Optimizer, Scenario Manager, and Statistics blocks (Value library) reference dialog variables in other blocks. And all of the Value, Item, and Rate blocks have interfaces that support this feature. These interfaces are also available to develop-ers. As discussed below, taking advantage of these interfaces requires only minor additions to your custom block code.

▲ printed Developer Reference, page 92

Custom remote blocks interfacing with a stand-alone blockThe blocks in the Value, Item, and Rate library have code that allows a stand-alone block to get or set their dialog variables; they support all 3 of the above options. Your custom block can also take advantage of this interface, allowing a stand-alone block to interface with your block’s variables:

• Options 1 and 2 will automatically be implemented without any modification to your blocks.

• For option 3, you need to add the following code to your custom block:

Include MouseClick v8.h

#include "MouseClick v8.h"Add the following code

On DialogClick // called whenever the modeler clicks a dialog item

{

if(do_keydown_mouse_click())

return;

}☞ If you have additional code in this message handler, put it after this code.

Custom stand-alone block referencing remote dialog variablesIf you create a stand-alone block that will reference (get or set) remote dialog variables in other blocks, you can implement any or all of the above methods for collecting the information from the remote block, as discussed below. (While it is also possible to develop your own interface, using one or more of the ExtendSim interfaces will be easier and more consistent with existing blocks.)

Page 112: Addendum ExtendSim

104 Programming TechniquesRemote access to dialog variables

Tec

hniq

ues

Manual data entryImplementing a manual method for referencing from the list in a custom stand-alone block depends on your particular implementation, interface, and needs. Some blocks, such as Find and Replace (Utilities library), only work with one remote dialog variable at a time. Other blocks, such as Statistics (Value library), have a list of remote dialog variables. For coding examples, look at one of those blocks.

Clone dropAdding a clone-drop interface to a custom block requires a DragCloneToBlock message handler. This is called whenever a clone is dragged to the icon of that block.

Inside of this message handler, call GetDraggedCloneList. This function requires two arguments – an integer dynamic array and a string dynamic array. It returns the number of clones (usually 1) dropped onto the block. You then use this information to reference a dialog item in another block.

Shift-clickThe shift-click feature is more complicated to implement because it requires using a reserved data-base (discussed on page 102) and an include file. The reserved database (_leftClickDB) provides the necessary information for the shift-click action. The include file (MouseClick.h) has two func-tions defined in it that are required for managing the reserved database:

1) RegisterBlockInLeftClickDB(String blockNumberDialogVariable, String staticStringVariable-ForRemoteBlockName, String sStaticStringVariableforRowAndColumn, String popupMenu-Label, integer optionNumber). Registers a block in the database of blocks that add a popup to a shift-click action. This is called in the CreateBlock, PasteBlock and OpenModel message handlers. See the MouseClick v8.h include file for an explanation of the arguments.

2) UnRegisterBlockInLeftClickDB. Removes a block from the database of blocks that add a popup to a shift-click action. This should be called in the DeleteBlock message handler.

Coding for Shift-clickThe key to the Shift-click functionality is a hidden dialog variable in the stand-alone block. When this dialog variable is set by the remote block, the stand-alone block receives a message that it has been sent a reference to a dialog variable in the remote block. The name of the hidden dialog vari-able is stored in a table in the reserved database (_leftClickDB) by the RegisterBlockInLeft-ClickDB function.

The information sent by the remote block must be processed in the message handler for the hid-den dialog variable. This information has been set in static variables in the stand-alone block by the remote block. The names of the static variables are set in the RegisterBlockInLeftClickDB function. The information includes the block number, dialog variable name, and database table’s row and column. These values can be found in the Dialog and Static variables that are arguments to the RegisterBlockInLeftClickDB function.

In the following code example, the stand-alone block gets:

• The block number for the remote block in the dialog variable AddFactor_prm

• The name of the remote block's dialog variable in the static string variable DialogVarName

• The row and column of the remote dialog variable in the RowColumnDialogVar static string variable

And the popup menu is labeled “Scenario Manager: Add Factor”. Because the Scenario Manager has two options (one for adding a factor and one for adding a response), this is option 1.

Page 113: Addendum ExtendSim

Programming Techniques 105Registered blocks

Techniques

On OpenModel

{

RegisterBlockInLeftClickDB( "AddFactor_prm","DialogVarName",

"RowColumnDialogVar", "Scenario Manager: Add Factor", 1);

}

On AddFactor_prm

{

// Receive message from remote block and process hidden variables

// AddFactor_prm is the block number of the remote block

// DialogVarName is the dialog variable in the remote block

// RowColumn is the row and column in the remote block

}

Shift-click exampleWhen the Optimizer block (Value library) is added to a model it cre-ates the reserved database _leftClickDB. The entries in the database table cause options, such as Optimizer: Add Parameter, to be added to a menu that appears when an appropriate dialog item is Shift-clicked.

Through block code, the Shift-click action causes the selected variable to be used in the Optimizer block. Using this type of architecture makes it easy for developers to add their own block options to the Shift-click menu.

▲ printed Developer Reference, page 92

Registered blocks▲ printed Developer Reference, page 334

Block registration is a method for keeping a block informed when there is a change in the linked data source. Unlike user-defined or code-defined links (which link a particular dialog item to a data source), block registration functions link an entire block to a data source.

The block registration functions start with DBBlockRegister or GABlockRegister. Depending on the function chosen, the block gets a LinkContents message if the content of the data source changes or a LinkStructure message if the structure of the data source (such as the name of a table or the location of a field) changes.

An example of block registration for content changes is the Read block (Value library). When Link Alerts is checked in its Options tab, the block registers itself so that it will be alerted if/when changes are made to its source data.

Registered blocks can be located using the Find Links dialog (Edit > Open Dynamic Linked Blocks) discussed on page 98.

Use registered blocks judiciously. Due to the extra messaging, a registered block can significantly slow the simulation run.

COM DLL example▲ printed Developer Reference, page 107

Page 114: Addendum ExtendSim

106 Programming TechniquesInteger arrays

Tec

hniq

ues

The “VB.net COM DLL example” model (Windows only) shows how to interface from Extend-Sim with a COM DLL created in VB.net. The COM DLL folder includes the model plus an ExtendSim library with a custom block as well as the source code used to create the COM DLL. ExtendSim is the Client in this automation example; this is the inverse of the Client App example where VB is the Client.

☞ See the folder ExtendSim8\Examples\DeveloperTips\OLE Automation\VB\ COM DLL

Integer arraysThere are two integer arrays:

• The array itemArrayI[][5] is passed through SysGlobal4. It is discussed on page 161 of the printed Developer Reference.

• The new itemArrayI2[][5] is passed through SysGlobal18 and has 5 columns, all of which are reserved:

▲ printed Developer Reference, page 161

Slot # Description

0 Resource Order ID. If an item has requested at least one advanced resource requirement, the integer held in slot 0 represents the record associated with the last requested requirement in the "Resource Orders" database table. Resource Order ID is used with Advanced Resource Management (ARM).

1 Reserved for future use

2 Reserved for future use

3 Reserved for future use

4 Reserved for future use

Page 115: Addendum ExtendSim

Developer Reference Addendum

Messages, Variables, and Functions

Page 116: Addendum ExtendSim

108 Messages, Variables, and FunctionsMenu and keyboard equivalents for developers

Func

tion

s

Menu and keyboard equivalents for developers▲ printed Developer Reference, page 382

The following commands are not new in release 8. However, they were left out of the printed Developer Reference.

Develop menu

Run menu

Menu command numbers for new commands▲ printed Developer Reference, page 371

The command numbers for the new menu commands are:

• Database menu: Edit Table Properties 1932

• Database menu: Edit Field Properties 1933

• Database menu: Read/Write Index Check 1931

• Develop menu: Show Reserved Databases 1928

Messages▲ printed Developer Reference, pages 198-208

Command Windows Macintosh

Compile Block Ctrl+K Cmnd+K

New Dialog Item Ctrl+I Cmnd+I

Shift Selected Code Left Ctrl+[ Cmnd+[

Shift Selected Code Right Ctrl+] Cmnd+]

Go To Line Ctrl+‘ Cmnd+‘

Match Braces Ctrl+J Cmnd+J

Match IFDEF/ENDIF Ctrl+I Cmnd+I

Command Windows Macintosh

Run Simulation Ctrl+R Cmnd+R

Simulation Setup Ctrl+Y Cmnd+Y

Add Selected To Report Ctrl+6 Cmnd+6

Remove Selected From Report Ctrl+7 Cmnd+7

Stop Ctrl+. Cmnd+.

Pause Ctrl+/ Cmnd+/

Step Ctrl+, Cmnd+,

Resume Ctrl+- Cmnd+-

Debugging > Add Selected To Trace Ctrl+8 Cmnd+8

Debugging > Remove Selected From Trace Ctrl+9 Cmnd+9

Page 117: Addendum ExtendSim

Messages, Variables, and Functions 109System variables

Functions

Simulation messages

ModifyRunParameterSent before the simulation run begins to allow changing the Simulation Setup parameters via the SetRunParameter() function. Note that this is sent only once even for multiple simulation runs.

SimStartSent after ModifyRunParameter but before all other simulation message handlers. See BlockSim-StartPriority function on page 114 for details.

SimFinishSent after all other simulation message handlers. See BlockSimFinishPriority function on page 114 for details.

Dialog messages

DataTableHoverSend to the block when the cursor is hovering over a data table.

(Use DTToolTipSet to set the value of the tool tip caption to be displayed.)

3D Animation messages

E3DCollisionSent when two objects are about to collide in the E3D window. Used to control whether or not a collision occurs or otherwise to respond to a collision. (Be aware that this message can occur mul-tiple times for each potential collision.)

If a collision is about to happen, the block associated with the 3D object that is about to collide with another 3D object receives an E3DCollision message. The new function E3DMessageInfo (see page 112) allows the programmer to request the 3D object ID of the object that is about to collide and/or the object that is about to be collided with.

The E3DCollision message has been defined such that aborting the message will tell the E3D engine that the collision should not happen. This makes the objects noncolliadible for the pur-poses of that collision. The result is that they will visually pass right through each other or, in the event that the collision would have just been the two objects brushing edges, they will just pass right by each other.

This functionality is implemented in the Item library to reduce unintentional collisions that could cause objects to move incorrectly in E3D models.

System variables▲ printed Developer Reference, pages 194-196

CurrentScenarioIn models where the Scenario Manager is running a series of scenarios, this is the current scenario number. This will be equal to the row in the Scenarios table that is currently providing the factors to the model.

NumScenariosIn models where the Scenario Manager is running a series of scenarios, this is the total number of scenarios that will be run.

Page 118: Addendum ExtendSim

110 Messages, Variables, and FunctionsFunctions

Func

tion

s

FunctionsThe following are mostly new functions. Where noted, however, some older functions have been updated with new values or features.

Function returnsExcept for void functions, which do not return values, all functions return values that are real, inte-ger, or string. The type of value returned is indicated in the third column of the function tables as:

Math functions▲ printed Developer Reference, page 225+

☞ Equation Debug is a new category of functions. See the code of equation-based blocks for more information on how the following functions are used.

Return Meaning

R Real or Double (8 byte double)

I Integer or Long (4 byte long integer)

S String (up to 255 characters)

V Void function (no value returned)

Equations Description Return

EquationIn-cludeSet(string theIn-cludeName)

Called right before one of the equationCompile functions, this puts the contents of the specified include file into the compiled equation. Call this for each include desired.

V

IncludeFileEditor(string includeFileName, integer blockNumber)

Tags the specified include file to do the following: If you click the close box, it will not close, but instead will send a message to the block specified by blockNumber. Equation-based blocks use this for their external code editor functionality; see the equation blocks for examples. Returns 0 for success or a negative value to indicate failure.

I

Equation Debug Description Return

EquationDebugCom-pile(integer debugEqua-tionIndex, string equationCodeArray[], string varsInputArray[], string varsOutputArray[], long tabOrder)

Converts the equation code and variable names into block form so it can be debugged. DebugEquationIndex is the previously returned value from a previous call to this function for this equation, or zero when this function is called for the first time with this equation. Returns a debug equation index to be used in the other equation debugging functions. TabOrder is the tab order of the text item with the equation. See the equation-based blocks for how to use this function.

I

EquationDebugSetBreak-points(integer debugEquationIndex)

Opens a “Set Breakpoints” window so the user can click to cre-ate debugger breakpoints. Returns a True value if an error occurs.

I

Page 119: Addendum ExtendSim

Messages, Variables, and Functions 111Functions

Functions

I/O functions▲ printed Developer Reference, page 227+

E3D animation▲ printed Developer Reference, page 260+

EquationDebugCalcu-late(integer debugEqua-tionIndex, real inputVarValuesArray[], real outputVarValue-sArray[])

Calculates the equation using specified input values. The out-put values for the result will be put into outputVarValuesArray. Returns a TRUE value if an error occurs.

I

EquationDebugDis-pose(integer debugEqua-tionIndex)

Disposes the hidden block specified by debugEquationIndex used to debug a particular equation. This does not affect the vis-ible equation block.

V

File I/O(unformatted) Description Return

FileInfo(string filePath-Name, integer which)

Returns information about the file specified in the filePath-Name argument. The which argument specifies what informa-tion will be returned:1: created date2: modified dateDates are returned as ExtendSim date values.

R

GetFileReadMachine-Type()

Returns the type of machine the currently active model was saved on. (This is only useful if models have been moved from one platform to another. Otherwise, it will be the same as the machine the model is running on.) Type 2 is Windows, 1 is models built on 68k Macs, and 4 is models built on PPC Macs.

I

Alerts & Prompts Description Return

isKeyDown(integer key-Code)

Returns a True/False value for whether or not the specified key is pressed. The constants for keyCode are the constants for the API call GetKeyState (Windows) or the GetKeys functionality (Macintosh).

I

userPromptCustomBut-tons(string str, string button1, string button2)

User prompt with the ability to customize the text of the but-tons. Returns True (1) if the first button is pressed or False (0) otherwise.

I

3D post

E3DPostSetObjectBlockNumber(double time, long objectID, long blockNumber)

Equation Debug Description Return

Page 120: Addendum ExtendSim

112 Messages, Variables, and FunctionsFunctions

Func

tion

s

Blocks and inter-block communication▲ printed Developer Reference, page 275+

3D mountStack Description Return

E3DMountStackLimit(integer blockNumber, inte-ger limit)

Determines the limit for mountStacks created by a specified block. The purpose is to reduce the number of objects displayed in the E3D window, enhancing performance. The mountStack limit only renders up to limit objects; after that it indicates the total count of objects as a number on the top of the stack. If not overridden by block code, the default mountStack limit is 10.

I

3D miscellaneous Description Return

E3DMessageInfo(integer which)

Returns information about a message sent by the E3D window to ExtendSim. This function is used in the E3DCollision mes-sage handler to request the 3D object ID of the object that is about to collide (which=1) or the object that is about to be col-lided with (which=2).

I

E3DCollisionBlocker(integer objectID, integer blocker)

Collision optimization. Used by the Transport and Convey Item blocks to inform a 3D object that it is in a queuing situa-tion and can optimize its collision calculations by only looking at the object specified in the blocker argument. Blocker should be the object ID of the object that is in front of the specified object in the queue.

V

Block numbers, etc. Description Return

FindInHierarchy2(inte-ger blockNumber, string findBlockName, string findBlockLabel, integer findDialog)

The same as the FindInHierarchy function except it takes a block number argument.

I

Block connection Description Return

GetConnection-Color(integer blockFrom, integer conFrom, integer blockTo, integer conTo, integer colorArray[])

Fills the color array (three integer element) with the hue, satura-tion, and brightness (HSV) values for the color of the connec-tion line. The HSV color palette is on page 252 of the printed Developer Reference.

Returns 0 for success or a negative value to indicate failure.

I

Page 121: Addendum ExtendSim

Messages, Variables, and Functions 113Functions

Functions

Block dialog items Description Return

DITitleGet(integer block-Number, string dialog-ItemName)

Returns the string title of the dialog item. For dialog items like radio buttons and check boxes, the title is the text that appears on the dialog. Use this function to retrieve the string if it has been set by the function DITitleSet.

S

DISetFocus(integer block-Number, string dialog-ItemName)

Sets the focus on the specified dialog item. Returns 0 for success or a negative value to indicate failure.

I

GetDialogNames(integer block, string nameArray[], integer typeArray[])

This function has additional values for typeArray.

Returns a list of the dialog variables in the specified block. Both nameArray and typeArray are dynamic arrays. This function returns the number of items in the target block’s dialog. For each item in the block’s dialog, the string array will contain the name of the dialog item and typeArray will contain the type of dialog item. Values for typeArray are:

1:Button, 2:Check Box, 3:Radio Button, 4:Meter,5:Parameter, 6:Slider, 7:Data Table, 8:Editable Text, 9:Static Text, 12:Switch, 13:Text Table, 16:Popup Menu, 17:Embedded Object, 18:Dynamic Text, 19:Text Frame, 20:Calendar, and 21:Editable Text31 (31 characters)

LastSetDialogVari-ableString()

Returns the last string value that was set by SetDialogVariable. This is useful if one is setting the value of a dialog item like a popup menu, where the stored value is not the value that the popup menu contains, but rather an additional string variable. In this case, using the WhoInvoked() function, below, and this function you can have the code of the block change the correct string for the dialog item, so the SetDialogVariable function will react as the user expects, even though the data is not directly contained in the dialog item.

S

WhoInvoked() Determines if a dialog item message handler was invoked by a call to SetDialogVariable or by user interaction. Returns one if the invoke was through SetDialogVariable, or zero if through user interaction. Called in the message handler for the dialog item, this is useful if you need the code to react differently when the dialog item value has been set by the SetDialogVariable function.

I

Block data tables Description Return

DTToolTipSet(string cap-tionString)

In conjunction with the DataTableHover message handler dis-cussed on page 109 of this Addendum, this function allows you to show custom tool tips when the cursor hovers over a data table.

V

Page 122: Addendum ExtendSim

114 Messages, Variables, and FunctionsFunctions

Func

tion

s

Models and notebook▲ printed Developer Reference, page 304+

Dynamic linking Description Return

DILinkUpdateInfo(inte-ger which)

This function now has some new values for which:

Should be called in the LinkStructure, LinkContent, or dialog item name message handlers. It will return information about which link changed and what the change was.Values for which:0:Link type (returns 0:no link, 1:global array, 2:database, 3: dynamic array)1:DB Index returns the index of the database for the link (if it's a DB link)2:table/array index returns the value of the index3:returns column index4:returns row index5:what changed (see below for values)6:number of rows or columns changed7:dialog item ID8:the block number of the block that changed the data

A which value of 5 (what changed) returns 1:data changed, 2:field inserted, 3:field deleted, 4:field renamed, 5:record inserted, 6:record deleted, 7:table or GA deleted, 8:table or GA renamed, 9:DB deleted, 10:DB renamed, 11:link created, 12:link modified, 13:link cleared, 14:DB replaced via DBData-baseImport(), 15:GA resized, 16:table inserted, 17:field proper-ties modified, 18:field moved, 19:table sorted, 20:Table Properties modified, 21:record ID modified.

I

Block messaging Description Return

BlockSimStartPrior-ity(integer blockNumber, integer priority)

Sets the priority value for receiving the SimStart message dis-cussed on page 109 of this Addendum. Returns 0 for success or a negative value for failure. The default value is -1 and any block with a priority value of less than 0 will not receive the message. Blocks that have a priority value greater than -1 will receive the message in priority order (lowest to highest).

I

BlockSimFinishPrior-ity(integer blockNumber, integer priority)

Sets the priority value for receiving the SimFinish message dis-cussed on page 109. Returns 0 for success or a negative value for failure. The default value is -1 and any block with a priority value of less than 0 will not receive the message. Blocks that have a priority value greater than -1 will receive the message in priority order (lowest to highest).

I

DuringHBlockUpdate() During an HBlock update, some connections are temporarily broken and then reconnected. Returns True if called during an HBlock update so you can determine if ConnectionMake or ConnectionBreak messages can be safely ignored.

I

Page 123: Addendum ExtendSim

Messages, Variables, and Functions 115Functions

Functions

Scripting▲ printed Developer Reference, page 307+

Models, notebook Description Return

GetRunParameter-Long(integer which)

This function has additional values for which.

Gets the specified run parameter using the value of which:3:numSims, 4:numSteps, 5:random seed, 6:seedControl (value, from 1-3, of the seed popup from the Random Numbers tab), 7:checkRandomSeeds (value of the duplicate seeds check box from the Random Numbers tab), 8:timeUnits, 9:calendar-Dates, and 11: “__seed” table database index.

I

NotebookIsOpen() Returns a true value if the notebook is currently open. I

SaveTopDocAs(string file-Path)

Saves the top document under the file name and path name defined by filePath. Similar to SaveModelAs except it will work on whichever the top ExtendSim document is. (Specifically used by the Equation block to save and close Include files.) Returns 0 for success or a negative value to indicate failure.

I

SetRunParameter(real paramValue, integer which)

This function has additional values for which. Also, see new ModifyRunParameter simulation message, above.

Sets a single parameter in the Simulation Setup dialog. As an enumerated list, this function is more expandable than SetRun-Parameters(). The values for which are:

1:endTime, 2:startTime, 3:numSims, 4:numSteps, 5:random seed), 6:seedControl (value, from 1-3, for the seed popup from the Random Numbers tab), 7:checkRandomSeeds (value for the duplicate seeds check box for the Random Numbers tab), 8:timeUnits, 9:calendarDates, 10:startDate, 11: “__seed” table database index.

I

Scripting Description Return

ActivateApplication() Brings the ExtendSim application to the foreground. This is primarily used for interapplication/scripting

V

ApplicationFrame(inte-ger frame[], integer inside)

Returns the application frame in global coordinates. The Inside argument specifies if the returned frame should be inside (includes the menubar and window frame) of the application frame window, or the outside.Declare frame as: Integer frame[4];When the function returns, frame will contain: frame [0] - Top, frame[1] - Left, frame[2] - Bottom, frame[3] - Right

I

Page 124: Addendum ExtendSim

116 Messages, Variables, and FunctionsFunctions

Func

tion

s

Database functions▲ printed Developer Reference, page 321+

CloneGetInfo(integer clo-neID, integer whatInfo)

This function now has additional information.

For whatInfo, 1:returns the type of the clone, 2:returns the block number of the clone, 3:returns True if the clone is selected and False if it is not.

Values for the type of clone (whatInfo:1) are:

1:Button, 2:Check Box, 3:Radio Button, 4:Meter, 5:Parameter, 6:Slider, 7:data table, 8:EditText, 9:StaticText, 12:Switch, 13:String Table, 14:Plotter pane, 15:Plotter data table, 16:Popup Menu, 17:EmbeddedObject, 18:DynamicText, 19:Text frame, 20:Calendar, 21:EditText(31).

I

CloneHideDisable(inte-ger cloneID, integer dis-able, integer flag)

Disables or hides the specified clone. Returns zero if successful or an error code (negative number) otherwise. If disable is True, the function disables or enables the clone based on the value of flag. If disable is False, the function hides or shows the clone based on the value of flag.

I

DialogFixedSize(integer blockNumber, integer height, integer width)

Specifies that the dialog box for blockNumber should be fixed to the specified height and width. User resizing of the block dia-log will be restricted.

I

GetUserPath() Returns the path to the user documents directory. Similar to GetAppPath.

S

GetRecentFilePath(inte-ger which)

Returns the full path to the specified recent file from the list of 5 recent files at the bottom of the File menu. The specified file (which) will be a number from 1 to 5.

S

IsLibEnabled(integer type)

Returns TRUE if the running version of ExtendSim will open a specific type of library. Type values are: 17: OR library, 18: AT library, 19: Suite library

I

LastBlockPlaced() Returns the block number of the last block placed on the active worksheet.

I

WinSetForegroundWin-dow(integer handle)

Sets the application associated with the passed in handle to be the foreground window. Passing in a zero, sets ExtendSim as the foreground window. Windows handles for other applica-tions then ExtendSim will need to be acquired through some means. One example would be querying the Excel object model through OLE/COM to return the object handle for Excel. See the code of the Command block in the Value library for an example of doing this.

V

Scripting Description Return

Page 125: Addendum ExtendSim

Messages, Variables, and Functions 117Functions

Functions

DB creating/deleting Description Return

DBDatabaseDeleteByIn-dex(integer databaseIn-dex)

Deletes entire database using index, returns error code. See also DBDatabaseDelete() in the Developer Reference.

I

DBFieldCreateByIn-dex(integer databaseIn-dex, integer tableIndex, string fieldName, integer fieldFormat, integer deci-mals, integer unique, inte-ger readOnly, integer invisible)

Creates field fieldName using specified indexes, returns error code. See also DBFieldCreate() in the Developer Reference.

I

DBFieldDeleteByIn-dex(integer databaseIn-dex, integer tableIndex, integer fieldIndex)

Deletes field using index, returns error code. See also DBField-Delete() in the Developer Reference.

I

DBTableCreateByIn-dex(integer databaseIn-dex, string tableName)

Creates table tableName in current database using indexes, returns negative error code. See also DBTableCreate() in the Developer Reference.

I

DBTableDeleteByIn-dex(integer databaseIn-dex, integer tableIndex)

Deletes table using index, returns error code. See also DBTable-Delete() in the Developer Reference.

I

DB import/export Description Return

DBDatabaseIm-port(string database-Name, string pathName)

There is new behavior:

Import database from text file pathName, replacing the database named databaseName or creating it if it didn’t exist. If the data-base name is in the form “databaseName<delete>”, it deletes any left over tables that were not imported in this file. If pathName is a blank string, let the user select a text file. Returns the database index or -1 if it fails. Sends both a LinkStructure message (what changed: DB replaced) and a LinkContent mes-sage (what changed: data changed) to linked blocks. See DIL-inkUpdateInfo() for an explanation of what changed.

I

Database properties Description Return

DBDatabaseRename(inte-ger databaseIndex, string newDatabaseName)

Renames a database. Returns a negative error code if newData-baseName already exists or the old database doesn't exist.

I

DBDatabase-ShowHideReserved(inte-ger showIfTrueHideIfFalse)

Use this to hide or show reserved databases without using the menu command. Reserved databases are discussed on page 102.

Note: When the model closes, the reserved databases return to being hidden. So this command must be called again whenever the model is opened.

V

Page 126: Addendum ExtendSim

118 Messages, Variables, and FunctionsFunctions

Func

tion

s

The following read/write functions are for use only with reserved databases, which are discussed on page 102 of this Addendum. These functions protect modelers from accidentally modifying a reserved database.

▲ printed Developer Reference, pages 328-329

DBFieldExists(integer databaseIndex, integer tableIndex, integer fieldIn-dex)

Passing in a database index, table index, field index, returns TRUE if the field exists, FALSE if it doesn’t exist. Also see DBDatabaseExists(), DBTableExists(), and DBRecordExists().

I

DBFieldMove(integer databaseIndex, integer tableIndex, integer fieldIn-dex, integer newFieldIn-dex)

Moves field fieldName to newFieldIndex, moving other fields in the process. Returns a negative when indexes are incorrect.

I

DBFieldRename(integer databaseIndex, integer tableIndex, integer fieldIn-dex, string newField-Name)

Renames a field. Returns a negative error code if the field already exists or the old field doesn't exist.

I

DBRecordExists(integer databaseIndex, integer tableIndex, integer fieldIn-dex, integer recordIndex)

Passing in a database index, table index, field index, record index, returns TRUE if the record (database cell) exists, FALSE if it doesn’t exist. Also see DBDatabaseExists(), DBTableEx-ists(), and DBFieldExists().

I

DBTableGetProper-ties(integer databaseIn-dex, integer tableIndex)

Returns the initialization method: 0 is no initialization, 1 is delete all records for first run, 2 is delete all records for every run. Returns -1 if error.

I

DBTableRename(integer databaseIndex, integer tableIndex, string newTableName)

Renames a table. Returns a negative error code if the table already exists or old table doesn't exist.

I

DBTableSetProper-ties(integer databaseIn-dex, integer tableIndex, integer initializeMethod)

Sets the initialization method: 0 is no initialization, 1 is delete all records for first run, 2 is delete all records for every run. Returns -1 if error.

I

DB read/write Description Return

DBDataSetAsNumberRe-served(integer databaseIn-dex, integer tableIndex, integer fieldIndex, integer recordIndex, real value-Double)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsNumber(), which works only with non-reserved databases.

I

DBDataSetAsNumberUs-ingAddressReserved(real dbAddress, real valueDou-ble)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsNumberUsingAddress(), which works only with non-reserved databases.

I

Database properties Description Return

Page 127: Addendum ExtendSim

Messages, Variables, and Functions 119Functions

Functions

DBDataSetAsParentIn-dexReserved(integer data-baseIndex, integer tableIndex, integer fieldIn-dex, integer recordIndex, integer parentIndex)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsParentIndex(), which works only with non-reserved databases.

I

DBDataSetAsParentIn-dexUsingAddressRe-served(real dbAddress, integer parentIndex)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsParentIndexUsingAddress(), which works only with non-reserved databases.

I

DBDataSetAsStringRe-served(integer databaseIn-dex, integer tableIndex, integer fieldIndex, integer recordIndex, string val-ueString)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsString(), which works only with non-reserved databases.

I

DBDataSetAsStringUsin-gAddressReserved(real dbAddress, string valueS-tring)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetAsStringUsingAddress(), which works only with non-reserved databases.

I

DBDataSetDateAsSim-TimeReserved(integer dbIndex, integer tableIn-dex, integer fieldIndex, integer recordIndex, real simTimeVal, integer time-Units)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetDateAsSimTime(), which works only with non-reserved databases.

I

DBDataSetDateAsSim-TimeUsingAddressRe-served(real addressValue, real simTimeVal, integer timeUnits)

This function works only with reserved databases. Otherwise, it is the same as DBDataSetDateAsSimTimeUsingAddress() which works only with non-reserved databases.

I

DB sort/search Description Return

DBRecordFindParentRe-cordIndex(integer data-baseIndex, integer tableIndex, integer child-FieldIndex, integer startin-gRecordIndex, integer findParentIndexValue)

Returns the index of the child record found pointing to start-ingParentIndex. StartingRecordIndex can be 0 or 1 to start at the first record. To keep searching for more matches, increment the returned record index by 1 for startingRecordIndex. Returns index of found record or 0 for record not found, -1 for indexing error.

I

DB read/write Description Return

Page 128: Addendum ExtendSim

120 Messages, Variables, and FunctionsFunctions

Func

tion

s

Pointer functions☞ This is a new category of functions that could go on page 337 of the printed Developer Reference..

Dynamic array pointer functions allow you to copy the contents of dynamic arrays into an inde-pendent data structure that can be created, used by other blocks if desired, and disposed of by any block. You can create a very large number of independent pointers, if desired. They are also useful for creating complex structures of pointers.

Using a disposed pointer will cause a crash (uses malloc() and free()).

DB address Description Return

DBAddressGetAllIn-dexes(real addressValue, integer returnIndexe-sArray[4])

Return the indexes from a DBAddress value. ReturnIndexe-sArray can be declared as a local variable array (can be declared in equation blocks):integer returnIndexesArray[4];

returnIndexesArray[0] returns Database indexreturnIndexesArray[1] returns Table indexreturnIndexesArray[2] returns Field indexreturnIndexesArray[3] returns Record index

DBAddressGetDlg2(inte-ger DBIndex, integer tableIndex, integer fieldIn-dex, integer recordIndex)

Similar to DBAddressGetDlg. Displays a dialog so the user can enter a database address. Note that in addition to entering the DB coordinates as separate values, you can also pass -2 for a DB coordinate, and this will hide that coordinate on the dialog. This allows you to enter just a DB index, for example, or just a DB and table index. Returns a database address.

R

DBAddressGetFrom-String(string dbAd-dressStr)

Returns the real database address when the string argument is of the form “D:T:F:R” where D, T, F, and R are the numerical indexes of the address.

R

Pointers Description Return

PointerFromDynamicAr-ray(dynamicArray)

Copies data from any type of dynamic array to a new pointer created by “malloc()” and returns the pointer.

If you pass the pointer to an external DLL, the first integer in the pointer's data is the size of the pointer's data in bytes. Including the size data, the pointer is actually that size plus 4.

I

PointerDispose(integer pointer)

Frees the memory used by the pointer using “free()”. The pointer is now invalid and can cause a crash if used.

V

PointerToDynamicAr-ray(integer pointer, dynamicArray)

Takes a pointer created by PointerFromDynamicArray() and copies it to a dynamic array, so ModL code can access it. This action writes over any old data in that dynamic array. The dynamic array must be the same type as the array in the pointer. The pointer must still be disposed of by PointerDispose().

V

Page 129: Addendum ExtendSim

Index to the Addendum

Index

Page 130: Addendum ExtendSim

122 Index

Symbols_(underscore) character for databases 102_leftClickDB 104, 105

Numerics3D animation

functions 111

AActivateApplication 115Add-In for ExtendSim database

Check Database Consistency 30Find Database Table 31

Advanced Resource Management (ARM) 51blocks in the system 82definitions of terms 52how it works 51policies 73pools of resources 63release rules 72resource orders 69Resource Pool blocks in 54resource requirements 74statistical information 63tutorial 53

advanced resources 52, 54Advanced Resources database 82, 83analysis methods

scenario analysis 34ApplicationFrame 115AR (advanced resources) 52

variables in Queue Equation block 20ARM method

51ARM system 51Auto Club Emergency Service model 60

Bblocks

communicating with each other 103communication 103dialog item functions 113messaging functions 114registered 105remote communication 103

BlockSimFinishPriority 114

BlockSimStartPriority 114breakpoint 15

conditional 16Breakpoints window 15, 16

CCheck Database Consistency option 30clone-drop

code for a custom stand-alone block 104method 37, 103

CloneGetInfo 116CloneHideDisable 116code-defined links 98COM DLL example 106conditional breakpoints 16CurrentScenario 109custom resource properties 71

Ddatabase

Industry 6Database (ExtendSim)

_character at beginning of name 102Advanced Resources 82, 83DB Job Shop Query model 25Field Properties dialog 28read/write functions 118reserved 102Scenario DB 36Table Properties dialog 29

Database Factors tableentering values 45

database functions 116DataTableHover 109DB Job Shop Query model 25DBAddressGetAllIndexes 120DBAddressGetDlg2 120DBAddressGetFromString 120DBBlockRegister 105DBBlockRegisterContents 105DBBlockRegisterStructure 105DBDatabaseDeleteByIndex 117DBDatabaseImport 117DBDatabaseRename 117DBDatabaseShowHideReserved 117DBDataSetAsNumberReserved 118

Page 131: Addendum ExtendSim

Index 123

DBDataSetAsNumberUsingAddressReserved118

DBDataSetAsParentIndexReserved 119DBDataSetAsParentIndexUsingAddressRe-

served 119DBDataSetAsStringReserved 119DBDataSetAsStringUsingAddressReserved

119DBDataSetDateAsSimTimeReserved 119DBDataSetDateAsSimTimeUsingAddressRe-

served 119DBFieldCreateByIndex 117DBFieldDeleteByIndex 117DBFieldExists 118DBFieldMove 118DBFieldRename 118DBQS (database query spawn) 22DBRecordExists 118DBRecordFindParentRecordIndex 119DBTableCreateByIndex 117DBTableDeleteByIndex 117DBTableGetProperties 118DBTableRename 118DBTableSetProperties 118debugging

equations 14design of experiments

maximum, minimum, step 38methods 39

Develop menu keyboard equivalents 108Dialog Factors table 36dialog variables

getting and/or setting remotely 103remote interface with 103

DialogFixedSize 116DILinkUpdateInfo 114DISetFocus 113DITitleGet 113DOE

maximum, minimum, step 38methods 39

double 110DragCloneToBlock 104DTToolTipSet 113DuringHBlockUpdate 114

dynamic data linking (DDL)finding linked dialogs 98finding registered blocks 98

EE3DCollision 109E3DCollisionBlocker 112E3DMountStackLimit 112E3DPostSetObjectBlockNumber 111Edit Field Properties command 28Edit Table Properties command 28enhancements in ExtendSim8 3Equation block

input variables 11output variables 12

equation debugger 14equation editor 13Equation(I) block

input variables 11output variables 12

equation-based blockscode colorization 13code completion 14components 10equation debugger 14equation editor 13header files 18include files 17input variable types 11list 10output variable types 12Variable Type popup for inputs 11Variable Type popup for outputs 12

EquationDebugCalculate 111EquationDebugCompile 110EquationDebugDispose 111EquationDebugSetBreakpoints 110EquationIncludeSet 110equations

equation editor 13local (temporary) variables 10static (permanent) variables 10

ExtendSim8enhancements 3new features 2technical support 7

Page 132: Addendum ExtendSim

124 Index

upgrading from release 6 6upgrading from release 7 4

Ffactors 34features

new in ExtendSim 8 2Field Properties dialog 28FileInfo 111filtering condition

creating 65, 75definition 52for a group 78types 75

Final Car Wash RM model 54Final Car Wash Scenarios model 35Find Database Table option 31Find Links dialog 98FindInHierarchy2 112free() 120full factorial design 39functions

3D animation 1113D miscellaneous 1123D mountStack 112alerts & prompts 111block numbers 112data tables 113database 116database creating/deleting 117database DBAddress 120database import/export 117database read/write 118dialog items 113equation debug 110file I/O (unformatted) 111math 110messaging blocks 114models 115notebook 115pointers 120returns 110scripting 115

GGABlockRegister 105

GABlockRegisterContents 105GABlockRegisterStructure 105GetConnectionColor 112GetDialogNames 113GetDraggedCloneList 104GetFileReadMachineType 111GetRecentFilePath 116GetRunParameterLong 115Getting Started model 3GetUserPath 116green arrow for equation debugger 15group filtering condition 75groups

definition 52filtering conditions in ARM 75properties 72using in ARM 68

Hheader files 18

Iinclude files for equation-based blocks 17IncludeFileEditor 110includes

MouseClick 103, 104Industry database 6input variables

in equation-based blocks 11variable types 11

integerfunction return 110

isKeyDown 111IsLibEnabled 116itemArrayI2 106items

properties in ARM 72status in ARM 69

JJMP custom design 39job shop 25

Kkeyboard shortcuts

for developers 108

Page 133: Addendum ExtendSim

Index 125

LLastBlockPlaced 116LastSetDialogVariableString 113legacy libraries 6

overview 6levels for factors 34Link Alerts 105Link Contents 105Link dialog

finding links 98Link Structure 105long 110

Mmaintenance plan 7malloc() 120menu command shortcuts

for developers 108messages

DataTableHover 109DragCloneToBlock 104E3DCollision 109GetDraggedCloneList 104ModifyRunParameter 109SimFinish 109SimStart 109

modelanalysis 34design of experiments 39factors for scenario analysis 34inputs for scenario analysis 34resources 50responses for scenario analysis 34scenario management 34

Model Data database 44ModifyRunParameter 109MouseClick.h 103, 104

N1 from 80FC_ 80RR_ 80NotebookIsOpen 115notebooks

functions 115NumScenarios 109

OOpen Dynamic Linked Blocks command 98output variables

in equation-based blocks 12variable types 12

PParent Record Index 12, 13, 23pass-through items 21

ranking rules 24pointer functions 120PointerDispose 120PointerFromDynamicArray 120PointerToDynamicArray 120policies in ARM 73pools

Advanced Resource Management method 51properties in ARM 71resource pool definition 52Resource Pool method 50using Resource Pool block 54using the Resource Manager block 63

PRI 12, 13, 23Proof Animation 6properties

custom resource in ARM 71editing for resources 64group in ARM 72of items in ARM 72of resources in ARM 70pool in ARM 71

Qquantity expression

creating 66, 76definition 52Order By clause 78Quantity clause 77

query cycle 21Query Equation block 20

differences from Query Equation(I) block 24input variables 11, 22output variables 12, 23ranking rules 24

Query Equation(I) blockDB Job Shop Query model 25

Page 134: Addendum ExtendSim

126 Index

DBQS 21, 22differences from Query Equation block 24input variables 11, 22output variables 12, 23pass-through items 21query cycle 21ranking rules 24spawned items 21

Queue blockused in Advanced Resource Management 55

Queue Equation block 18input variables 11, 19output variables 12, 20Release popup 20

Rranking rules 20Read/Write Index Checking command 28real

function return 110red circle in equation debugger 15RegisterBlockInLeftClickDB 104registered blocks 105

finding 98release rules in ARM 72replications 34reserved database 102

_character 102blocks that use 102

resource allocation policy in ARM 73resource filtering condition 75Resource Item block

advantages and disadvantages 81Resource Item method 50resource management

definition 50Resource Manager block

advantages and disadvantages 81creating pools 63creating resources 64filtering conditions 65, 75groups of resources 68policies 73Policies tab 57quantity expressions 66, 76release rules 72

Release Rules tab 57Requirements tab 56resource requirements 65, 67, 74, 79Resources tab 55used in a model 54

Resource Order IDassigned to item 84associating an item with a resource 69definition 52item property 72used in itemArrayI2 106

resource orders in ARM 69Resource Pool block

in Advanced Resource Management 54Resource Pool method 50

advantages and disadvantages 81Resource Pool Release block

in Advanced Resource Management 56resource release rule

definition 53resource requirement rank 73, 79

overriding 74resource requirements

creating 74creating manually 65, 79creating new 67default in ARM 80definition 53

resourcesadvanced 52, 54allocation policy in ARM 73definition 50filtering conditions in ARM 75groups in ARM 68implicit modeling of 51modeling methods 50pools from the Resource Manager block 63pools of 54properties in ARM 70requirements in ARM 65resource requirement rank in ARM 73status (in ARM) 69using the Resource Manager block 64

responses 34returns 110

Page 135: Addendum ExtendSim

Index 127

Run menu keyboard equivalents 108

SSave and Next Field button 29SaveTopDocAs 115scenario analysis 34

database variables 41design of experiments 39Dialog Factors table 36Dialog Responses table 38dialog variables 35factors (defined) 34levels 34Model Data database 44replications (defined) 34responses (defined) 34source list 45sources 41targets 41tutorial I 35tutorial II 41

Scenario DB database 36, 40Scenario Manager block 34

Dialog Factors table 36Dialog Responses table 38Export tab 40Include in Report column 39Report Set column 39

Scenario Manager Final Car Wash model 43scripting functions 115Set Breakpoints window 15SetRunParameter 115Shift-click 103

_leftClickDB 105code for a custom stand-alone block 104code in blocks used remotely 103method 37

Show legacy/prior version warnings option 98Show Reserved Databases command 28, 102SimFinish 109SimStart 109simulation

replications 34source list for scenario analysis 45sources 41spawned items 21

ranking rules 24string

function return 110string attributes

for Advanced Resource Management 60structures (pointers) 120support for ExtendSim 7support incidents 7system variables

list 109

TTable Properties dialog 29targets 41technical support 7

UUnRegisterBlockInLeftClickDB 104upgrading to ExtendSim 8

from release 6 or earlier 6from release 7 4

user-defined links 98userPromptCustomButtons 111

VVariable Name column 12

output variables 13Variable Type popup

input variables 11output variables 12

Variable Value field 12variables

input, in equation-based blocks 11local 10output, in equation-based blocks 12static 10

VB.net 106VB.net COM DLL example 106Version check on application launch option 99void 110

WWhoInvoked 113WinSetForegroundWindow 116


Top Related