Page 801 - ExtendSim User Guide
P. 801

Data Management and Exchange 775
Blocks for data management and exchange
Query Equation and Query Equation(I) blocks
The Query Equation blocks are used to rank the records in an ExtendSim database table and intelligently select one record, based on a ranking rule. A user-defined equation in the block’s dialog is 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.
Query Equation blocks
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 compli- cated. Furthermore, the query blocks provide critical pieces of information that support writing more powerful queries.
There are two query blocks:
• QueryEquation(ValuelibraryofExtendSimATandExtendSimSuite)
• QueryEquation(I)(ItemlibraryofExtendSimATandExtendSimSuite)
The major differences between these two blocks is presented in the table on page 779.
The Query Equation blocks are advanced modeling tools. They only available in the Extend- Sim AT and ExtendSim Suite packages.
How the blocks work
A query cycle is the point in time when a query block executes its equation to pick the next “winning” record.
• In the case of the Query Equation(I), this occurs every time an item passes through.
• FortheQueryEquationblock,itsOptionstabhaschoicesforcontrollingtheinitiationofthe 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 equations 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 778. 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 rank- ing.
Spawned items
A 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 independent and parallel system to how the items that pass through the block got created.
How To


































































































   799   800   801   802   803