Arena Variables Guide
Arena Variables Guide
VARIABLES GUIDE
PUBLICATION ARENAV-RM001J-EN-PApril 2010
Supersedes Publication ARENAV-RM001I-EN-P PN-71364
Customer Support Telephone 1.440.646.3434 Online Support http://www.rockwellautomation.com/support/ 2010 Rockwell Automation, Inc. All rights reserved. Printed in USA. This document and any accompanying Rockwell Software products are copyrighted by Rockwell Automation, Inc. Any reproduction and/or distribution without prior written consent from Rockwell Automation, Inc. is strictly prohibited. Please refer to the license agreement for details. Arena, Rockwell Automation, and SIMAN are registered trademarks of Rockwell Automation, Inc. ActiveX, Microsoft, Microsoft Access, SQL Server, Visual Basic, Visual C++, Visual SourceSafe, Windows, Windows ME, Windows NT, Windows 2000, Windows Server 2003, and Windows XP are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe, Acrobat, and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. ControlNet is a registered trademark of ControlNet International. DeviceNet is a trademark of the Open DeviceNet Vendor Association, Inc. (ODVA) Ethernet is a registered trademark of Digital Equipment Corporation, Intel, and Xerox Corporation OLE for Process Control (OPC) is a registered trademark of the OPC Foundation. Oracle, SQL*Net, and SQL*Plus are registered trademarks of Oracle Corporation. All other trademarks are the property of their respective holders and are hereby acknowledged. This product is warranted in accordance with the product license. The products performance may be affected by system configuration, the application being performed, operator control, maintenance, and other related factors. Rockwell Automation is not responsible for these intervening factors. The instructions in this document do not cover all the details or variations in the equipment, procedure, or process described, nor do they provide directions for meeting every possible contingency during installation, operation, or maintenance. This products implementation may vary among users. This document is current as of the time of release of the product; however, the accompanying software may have changed since the release. Rockwell Automation, Inc. reserves the right to change any information contained in this document or the software at anytime without prior notice. It is your responsibility to obtain the most current information available from Rockwell when installing or using this product. Version: 13.50.00 Modified: April 28, 2010 4:48:47 PM
Warranty
ii
Contents
1 Variables 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Attributes and entity-related variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 General attributes variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Time attribute variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Cost attribute variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Entity-type variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Group member variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Other entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Activity area variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Event calendar variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Level variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Rate variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Conveyor variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 General variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Conveying entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 General queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Queued entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 General resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Resource cost variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Replication variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Date and time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Calendar dates and times variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Current and final simulation time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Converting durations to the base time units variables . . . . . . . . . . . . . . . . . . . . . 18 System response variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Throughput variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Cost variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Statistics collection variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Counter statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Time-persistent statistics (Cstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Time-persistent statistics (Dstat) variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Frequencies statistics variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Tally statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Output statistics variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Post-run statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
iii
VARIABLES GUIDE
Transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General-status transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Free-path transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guided transporter variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guided network variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Blockage status variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General-purpose global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameters variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Schedule variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J index variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Station variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Storage variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stack variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flow variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tank variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Regulator variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sensor variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Math Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SIMAN Constructs Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary Table of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attributes and entity-related variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General attributes variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Time attributes variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cost attributes variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Entity-type variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Group member variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Activity area variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Event calendar variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Level variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rate variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conveyor variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conveying entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24 25 25 25 27 28 28 28 29 29 30 30 31 31 31 33 33 34 34 34 35 35 36 37 37 40 40 40 41 41 42 42 43 43 44 44 44 44 45 45 45
iv
VARIABLES GUIDE
Queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Queued entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replication variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Date and time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calendar dates and times variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Current and final simulation time variables . . . . . . . . . . . . . . . . . . . . . . . . . Converting durations to the base time units variables . . . . . . . . . . . . . . . . . System response variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Throughput variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Costs variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Statistics collection variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Counter statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Time-persistent statistics (Cstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . Time-persistent statistics (Dstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . Frequencies statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tally statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output statistics variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Post-run statistics variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General status variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Free-path transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guided transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guided network variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Blockage status variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General-purpose global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameters variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resource cost variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J index variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Station variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Storage variable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stack variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OperationParameter variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46 46 46 47 47 47 48 48 48 49 49 49 50 50 50 51 52 53 54 54 54 55 55 55 56 57 58 58 58 58 59 59 59 60 60 61 61 62 62
VARIABLES GUIDE
63 63 63 64
2 Strings in Arena
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . String/numeric conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparing strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Building strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Str function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Val function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . StrCompare function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . StrFormat function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chr function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Eval function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mid function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Len function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
65 66 66 67 67 68 69 69 70 70 71 72
Index
73
vi
Variables
1 Variables
Introduction
This guide contains a comprehensive overview of the predefined variables that can be used or referenced in all Arena products. Some of the variables may not be available in every Arena product. The variables described in this manual can be used in a variety of ways. They can be useful when building your model; for example, you might use a Decide module and follow one path of logic if the number of entities in the queue called WaitQ is greater than 10. This is done by putting the expression NQ(WaitQ)>10 in the Decide condition. Variables are also useful when animating your model; for example, you might want to animate the number of active transporters called Trucks on-screen. To do this, animate a variable and list MT(Trucks) as the expression to animate. Finally, variables are often necessary when collecting statistics. For example, if you want to perform output analysis on the average value of a tally called Time in System, use the Statistic module and record the tally expression TAVG(Time in System). Many of the predefined variables in Arena are user-assignable. This means that you can change them (e.g., with an Assign module) throughout the simulation run. The descriptions of the variables and the summary charts in this guide note whether or not a variable is user-assignable.
VARIABLES GUIDE
it is then necessary to number the construct explicitly (so that you can rely on specific ordering). If you do not specifically number them, and therefore do not know the construct number, you can enter the construct name in a field where its number is required by using NSYM(Construct Name). For example, NSYM(Attribute Name) returns the associated number of the attribute Attribute Name, NSYM(Station Name) returns the station number associated with that name, and NSYM(Intersection Name) returns the intersection number associated with that name.
1 Variables
1 VARIABLES
sequence. Each time a sequential transfer occurs, the jobstep attribute automatically is incremented by one unless the sequence changes it to a specific index value by the NEXT option. The IS[(Entity Number)] attribute is an alternate means of accessing the Entity.Jobstep value. Entity.Sequence [ ( Entity Number ) ]Entity sequence attribute. This attribute determines the sequence number to follow when an entity is transferred to the next station by a sequence. The model must explicitly assign a value to this attribute; Arena does not change or initialize it automatically. The NS[(Entity Number)] attribute is an alternate means of accessing the Entity.Sequence value. Entity.Station [ ( Entity Number ) ]Entity station location attribute. This attribute is used to store the entitys station location or destination. When an entity is transferred via any route, transport, or convey action, its station attribute automatically is assigned the destination station number. It also is used to determine the location of access to the material-handling device. The M[(Entity Number)] attribute is an alternate means of accessing the Entity.Station value. Entity.CurrentStationEntity current station location attribute. This attribute is used to store the entitys current station location. It will return the station number an entity is currently located in or 0 if the entity is not currently in a station. Unlike the Entity.Station (M) attribute, Entity.Current Station is not user-assignable. Entity.Current Station is automatically updated whenever an entity enters a station (e.g., executes a STATION block) or exits a station (e.g., transfers out of a station or disposes). If an entity is a member of a group, its Entity.CurrentStation is always the same station that the groups representative is currently in. Entity.PlannedStationEntity next planned station location attribute. This attribute is used to store the entitys next station visitation as defined in the entitys Entity.Sequence (Sequence module in Advanced Transfer panel). Unlike the Entity.Station (M) attribute, Entity.PlannedStation is not user-assignable. If the entity has a valid Entity.Sequence assigned, then Entity.PlannedStation stores the number of the station associated with the next jobstep in the sequence. It returns a zero if the entity is at the end of its sequence or if Entity.Sequence is undefined. Entity.PlannedStation is automatically updated whenever the attributes Entity.Sequence (NS) or Entity.JobStep (IS) are changed, as well as whenever the entity enters a station.
Note: In a transfer block (i.e., TRANSPORT, CONVEY, ROUTE), if the destination is specified as Sequential, then SIMAN first examines the entitys Entity.Sequence to retrieve the next station visitation. If Entity.Sequence is undefined, then the entity is transferred to Entity.PlannedStation if that attribute has a non-zero value.
VARIABLES GUIDE
1 VARIABLES
VARIABLES GUIDE
Entity.OtherCostEntity other cost attribute. This stores the total cost accumulated in processes and delays designated as Other or with no category designated. When the entity statistics are recorded (typically on dispose), this attribute is used to determine the total other cost accrued by this entity. This category can be used if you want to record cost separate from one of the four standard categories above.
Entity-type variables
Entity-type variables are related to the types or classes of entities defined by the Entity module (or Entities element). While each entity will have unique values for each of the attributes described above, the entity-type variables are common to all entities of the same type. (Note that entities with no specified entity type are assumed to be Entity Type 0 and will not have statistics collected for them.) EntitiesIn ( Entity Type )Number of entities in. This variable stores the total number of entities of the specified type that have entered the system. Whenever an entity is created or its type is reassigned, EntitiesIn will be incremented. EntitiesOut ( Entity Type )Number of entities out. This variable stores the total number of entities of the specified type that have left the system. Whenever an entity is disposed or its type is reassigned, EntitiesOut will be incremented. EntitiesWIP ( Entity Type )Number of entities in process. This variable stores the total number of entities of the specified type that are currently in the system (Work In Process). InitialPicture ( Entity Type )Initial picture. When an entity is initialized at a Create module, its Entity.Picture attribute will be assigned to this value based on its entity type. InitialHoldCostRate ( Entity Type )Initial hold cost rate. When an entity is initialized, its Entity.HoldCostRate attribute will be assigned to this value based on its entity type. InitialVACost ( Entity Type )Initial value-added cost. When an entity is initialized, its Entity.VACost attribute will be assigned to this value based on its entity type. This typically represents the cost or value associated with an incoming entity. InitialNVACost ( Entity Type )Initial non-value-added cost. When an entity is initialized, its Entity.NVACost attribute will be assigned to this value based on its entity type. This typically represents the cost or value associated with an incoming entity. InitialWaitCost ( Entity Type )Initial waiting cost. When an entity is initialized, its Entity.WaitCost attribute will be assigned to this value based on its entity type. This typically represents the cost or value associated with an incoming entity. InitialTranCost ( Entity Type )Initial transfer cost. When an entity is initialized, its Entity.TranCost attribute will be assigned to this value based on its entity type. This typically represents the cost or value associated with an incoming entity.
1 VARIABLES
InitialOtherCost ( Entity Type )Initial other cost. When an entity is initialized, its Entity.OtherCost attribute will be assigned to this value based on its entity type. This typically represents the cost or value associated with an incoming entity.
1 Variables
VARIABLES GUIDE
EntityNumberIsValid ( Entity Number )Entity Number is Valid. Each entity is given a unique number when created to act as its record of existence. This variable function returns a 1 if the argument Entity Number is the number of an entity that currently exists in the simulation, and 0 otherwise (1 for True, 0 for False). IDENTActive entity number. Each entity is given a unique number when created to act as its record of existence. These numbers are reused as entities are disposed and new ones are created. The value returned by IDENT corresponds to the Entity Number argument specified in the entity-related variables in this section. NUMENTNumber of active entities. As each entity is created, NUMENT is increased by one; each disposed entity decreases NUMENT by one. A time-persistent statistic on NUMENT often provides insight into when or whether a model reaches an approximate steady state. If NUMENT increases throughout the run, there may be problems with model logic (e.g., leaving entities in a queue) or the input rates of entities to the system may simply be larger than the total output rate possible.
1 Variables
1 VARIABLES
AreaTranTime ( Activity Area Name )Total Transfer Time. This variable returns the total transfer time that was accrued by entities in station logic directly associated with the activity area as well as time rolled up from its child activity area(s). AreaOtherTime ( Activity Area Name )Total Other Time. This variable returns the total time categorized as Other accrued for the specified activity area. This represents the total other time that was accrued by entities in station logic directly associated with the activity area as well as time rolled up from its child activity area(s). AreaWaitTime ( Activity Area Name )TotalWait Time. This variable returns the total wait time accrued for the specified activity area. This represents the total wait time that was accrued by entities in station logic directly associated with the activity area as well as time rolled up from its child activity area(s). AreaTotalTime ( Activity Area Name )Total Time. This variable returns the total time (the sum of all five time categories) accrued for the specified activity area. This represents the total time that was accrued by entities in station logic directly associated with the activity area as well as time rolled up from its child activity area(s). AreaVACost ( Activity Area Name )Total Value-Added Cost. This variable returns the total value-added cost accrued for the specified activity area. This represents the total value-added cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s). AreaNVACost ( Activity Area Name )Total Non-Value-Added Cost. This variable returns the total non-valued-added cost accrued for the specified activity area. This represents the total non-value-added cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s). AreaTranCost ( Activity Area Name )Total Transfer Cost. This variable returns the total transfer cost accrued for the specified activity area. This represents the total transfer cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s). AreaOtherCost ( Activity Area Name )Total Other Cost. This variable returns the total cost categorized as Other accrued for the specified activity area. This represents the total other cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s). AreaWaitCost ( Activity Area Name )Total Wait Cost. This variable returns the total wait cost accrued for the specified activity area. This represents the total wait cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s).
VARIABLES GUIDE
AreaTotalCost ( Activity Area Name )Total Cost. This variable returns the total cost (the sum of all five cost categories) accrued for the specified activity area. This represents the total cost that was accrued by entities in station logic directly associated with the activity area as well as cost rolled up from its child activity area(s).
Continuous variables
The continuous modeling features in Arena are based on matched pairs of variables called levels and rates. The level variables (also called state or S variables) represent the value of a particular continuous-change process over time. The rate variables (also called derivative or D variables) represent the rate of change of the level variable. The Levels and Rates modules define these pairs of variables. All continuous variables are realvalued and user-assignable.
Level variables
Level Name ( Index 1, Index 2 )Named level variable. The Level Name is defined in the Levels module. If the level variable is indexed, the appropriate number of index values
10
1 Variables
1 VARIABLES
must be provided. The value of the level variable changes during the simulation based on the value of its corresponding rate variable. S ( Level Number )Level variable. The S( ) array is an alternate means of accessing level variables defined in the Levels module. The Level Number is the construct number of the corresponding level variable.
Rate variables
Rate Name ( Index 1, Index 2 )Named rate variable. The Rate Name is defined in the Rates module. If the rate variable is indexed, the appropriate number of index values must be provided. D ( Rate Number )Rate variable. The D( ) array is an alternate means of accessing rate variables defined in the Rates module. The Rate Number is the construct number of the corresponding rate variables.
Conveyor variables
Conveyor variables provide information about the state of a conveyor and about the number and size of entities on the conveyor. The Conveyor ID is a conveyor name or number or an expression evaluating to a conveyor number. The only user-assignable conveyor variable is the velocity, VC. Time-persistent statistics often are collected on the conveying entity variables; frequency statistics on ICS provide an overall report of the conveyor state.
General variables
ICS ( Conveyor ID )Conveyor status indicator (0=Idle, 1=Moving, 2=Blocked, 3=Inactive). If the conveyor status is inactive (either initially or after an entity has executed a Stop module), ICS has a value of 3. If a non-accumulating conveyor is active and entities are conveying on it, but some entity has disengaged the conveyor (i.e., it is between Access and Convey modules or is undergoing an unloading delay), the status is blocked with ICS equal to 2. (This state does not apply to accumulating conveyors.) If the conveyor has entities on it and is not disengaged, the state is moving and ICS has a value of 1. (This state applies to all non-empty, active accumulating conveyors.) If no entities are on the conveyor and it is active, ICS equals 0. Note that for accumulating conveyors many entities may be on the conveyor with their progress suspended by a blocking entity; however, the conveyor status is still moving (ICS equals 1). To test for accumulation information, use variables NEA and/or CLA. MLC ( Conveyor ID )Conveyor length. MLC provides the total length of a conveyor in the models distance units. For circular conveyors, the length is the sum of the distances
11
VARIABLES GUIDE
listed in the conveyors segment set. For straight conveyors, the length is the sum of the segment distances plus the length of the maximum cells per entity defined on the Conveyor module (i.e., maximum cells per entity multiplied by cell width). MLC is an integer variable. VC ( Conveyor ID )Conveyor velocity. The initial value of VC is the velocity defined in the Conveyor module, with units of the models distance units per time unit. The velocity may be assigned new values during a simulation run; these changes take place instantaneously. A value of 0.0 for VC stops movement of all entities on the conveyor without changing the conveyor state (ICS). VC is a real-valued, user-assignable variable.
12
1 VARIABLES
Queue variables
Arena provides variables to access information about the entities in each queue. Also, there is a set of variables that directly access the attributes of entities contained in queues based on the entity rank. The Queue ID is a queue name or number; it cannot be defaulted. Attribute ID is an attribute name or number and also must be specified. Entity Number is the IDENT value of the desired entity; a value must be provided for it as well. None of these variables are user-assignable.
1 Variables
13
VARIABLES GUIDE
(Entity Number). The entity provided to PREDECESSOR should be in a queue; otherwise, a 0 is returned. If Entity Number is the first entity in its queue, a 0 also is returned. The predecessor entity is based on the order of entities in the queue (defined by the queue ranking rule). SAQUE ( Queue ID, Attribute Number )Sum of the attributes of queued entities. SAQUE returns the sum of the specified Attribute Number values of all entities in queue The data type of the specified attribute must be numeric. The function NSYM may be used to translate an attribute name into the desired Attribute Number. SUCCESSOR ( Entity Number )Queued entity successor. SUCCESSOR is the counterpart to the PREDECESSOR variable. If the specified entity (Entity Number) is the last entity in the queue, a value of 0 is returned.
Resource variables
Arena provides a number of general modeling constructs for controlling the flow of entities through the model. The ID argument for the variables related to the resource, blockage, and storage constructs must be provided as an integer construct number or a construct name.
14
1 VARIABLES
RTYP ( Resource ID )Resource location. This variable returns a 1 if the resource specified is stationary, and a 2 if the resource specified is positional. LR ( Resource ID )Resource location. This variable returns the current location of the resource (for positional resources, this is a station number). If the specified resource is not permitted to change locations, LR returns to 0. STATE ( Resource ID )Resource state. The STATE keyword returns the current state of the specified Resource ID as defined in the Statesets option for the resource. The STATE variable returns an integer number corresponding to the position within the specified Resource IDs associated stateset. It also may be used to assign a new state to the resource. STATEVALUE ( ResourceExpr, StateString )Resource stateset. STATEVALUE will search the stateset of the resource ResourceExpr for a state with the name StateString, where ResourceExpr can be any Arena expression and StateString can be any character string. If a matching state name is found, the integer value for that state is returned. If StateString is not found, then an error is generated. If resource ResourceExpr does not have any stateset associated with it, the StateString is compared against the autostates BUSY, IDLE, INACTIVE, and FAILED. If a match with one of the autostates is found, then the appropriate autostate integer associated with it is returned (see below for these values). The four resource state constants below are available to check the automatic state of a resource. A state constant is only available if the autostate has not been associated with a user-defined state. Unlike other variables, the state constants are not user-assignable. Typically, they are used to monitor the state of a resource in a conditional expression when using autostates. For example, STATE(Resource ID) == IDLE_RES returns true if Resource ID is currently in the idle autostate. IDLE_RESResource state constant. The IDLE_RESource is used in an expression to check whether a resource is currently in the idle state. A resource is in the idle state when all units are idle and the resource is not failed or inactive. (The numerical equivalent of this variable is -1.) BUSY_RESResource state constant. The BUSY_RESource is used in an expression to check whether a resource is currently in the busy state. A resource is in the busy state when it has one or more busy units. (The numerical equivalent of this variable is -2.) INACTIVE_RESResource state constant. The INACTIVE_RESource is used in an expression to check whether a resource is currently in the inactive state. A resource is in the inactive state when it has zero capacity and is not failed. (The numerical equivalent of this variable is -3.)
1 Variables
15
VARIABLES GUIDE
FAILED_RESResource state constant. The FAILED_RESource is used in an expression to check whether a resource is currently in the failed state. A resource is in the failed state when a failure is currently acting on the resource. (The numerical equivalent of this variable is -4.)
Replication variables
Arena uses two variables to record the current and maximum number of replications. MREPMaximum replications. This integer variable is the Number of Replications value on the Run > Setup > Replication Parameters property sheet. It is user-assignable. NREPReplication number. NREP returns the current replication number, an integer value. It may not be changed by the user.
16
1 Variables
1 VARIABLES
Note: Use the Expression Builder to look up replication variables easily when building or editing an expression.
17
VARIABLES GUIDE
The accepted ranges for the MonthExpr and DayExpr arguments are 131 for days and 112 for months. The expressions entered must evaluate to a valid date.
18
1 VARIABLES
Throughput variable
Total.ThroughputTotal entity throughput. This is the total number of entities that have been recorded. This can be a simple way of determining the total number of entities that have finished processing.
1 Variables
Cost variables
Total.VACostTotal value-added cost. This is the total value-added cost for all entities. Total.NVACostTotal non-value-added cost. This is the total non-value-added cost for all entities. Total.WaitCostTotal waiting cost. This is the total wait cost for all entities. Total.TranCostTotal transfer cost. This is the total transfer cost for all entities. Total.OtherCostTotal other cost. This is the total other cost for all entities. Total.EntityCostTotal entity cost. This is the sum of the costs in the five allocation categories above for all entities. This can be a simple way of determining the total cost of all entities. Note that this number will typically include those resource costs that can be attributed to a specific entity. Total.ResUseCostTotal resource usage cost. This is the total of the usage costs (e.g., costs per seize) for all resources. It is the product of ResSeizes( ) * ResUseCost( ), summed for all resources. Note that these costs are typically also included in entity costs because they can be assigned to a particular entity. Total.ResBusyCostTotal resource busy cost. This is the total of the busy costs (e.g., costs while seized) for all resources. It is the product of ResBusyCost( ) * Average Number Busy * TNOW, summed for all resources. Note that these costs are typically included in entity costs as well because they can be assigned to a particular entity. Total.ResIdleCostTotal resource idle cost. This is the total of the idle costs (e.g., costs while scheduled, but not busy) for all resources. It is the product of ResIdleCost( ) * Average Number Idle * TNOW, summed for all resources. Note that these costs are never included in entity costs because they cannot be assigned to a particular entity. Total.ResourceCostTotal resource cost. This is the sum of the costs in the three categories above for all resources. This can be a simple way of determining the total cost of all resources used in the system. Total.SystemCostTotal system costs. This is the sum of all costs. This can be a simple way of evaluating the total cost of one system relative to another. It is the sum of Total.EntityCost and all costs that have been incurred, but not yet allocated to an entity.
19
VARIABLES GUIDE
20
1 Variables
1 VARIABLES
CVALUE ( Cstat ID )Last recorded value. CVALUE returns the last recorded value for the specified cstat. When animating a cstat histogram, it is CVALUE, not the CAVG, that is typically displayed. CBATCH ( Cstat ID, Batch Number )Average value in batch. This variable returns the current average value in the batch number specified, for the cstat specified. This is used in conjunction with the CHALF variable, which calculates the confidence interval for a cstat. CNUMBAT ( Cstat ID )Number of batches. CNUMBAT returns the current number of full batches being used in the calculation of the variable CHALF. For the cstat specified, there is always a minimum of 20 and a maximum of 40 batches. The value of this variable changes as more data is collected in a replication. CBATSIZ ( Cstat ID )Batch size. CBATSIZ is a variable that is used in conjunction with the CHALF variable, which calculates the confidence interval for a cstat. CBATSIZ returns the current sample size of each batch used in these calculations. The value of this variable changes as more data is collected in a replication.
21
VARIABLES GUIDE
DBATCH ( Dstat ID, Batch Number )Average value in batch. This variable returns the current average value in the batch number specified, for the dstat specified. This is used in conjunction with the DHALF variable, which calculates the confidence interval for a cstat. DNUMBAT ( Dstat ID )Number of batches. DNUMBAT returns the current number of full batches being used in the calculation of the variable DHALF. For the dstat specified, there is always a minimum of 20 and a maximum of 40 batches. The value of this variable changes as more data is collected in a replication. DBATSIZ ( Dstat ID )Batch size. DBATSIZ is a variable that is used in conjunction with the DHALF variable, which calculates the confidence interval for a dstat. DBATSIZ returns the current sample size of each batch used in these calculations. The value of this variable changes as more data is collected in a replication.
22
1 Variables
1 VARIABLES
FTOT ( Frequency ID )Total frequency time. FTOT records the total amount of time that frequency statistics have been collected for the specified frequency number. FTOTR ( Frequency ID )Restricted frequency time. FTOTR records the amount of time that the specified frequency number has contained values in non-excluded categories (i.e., categories that have a value in the restricted percent column). FVALUE ( Frequency ID )Last recorded value. FVALUE returns the last recorded value for the specified frequency. When animating a frequency histogram, it is FVALUE, not the FAVG, that is typically displayed.
23
VARIABLES GUIDE
TBATSIZ ( Tally ID )Batch size. TBATSIZ is a variable that is used in conjunction with the THALF variable, which calculates the confidence interval for a tally. TBATSIZ returns the current sample size of each batch used in these calculations. The value of this variable changes as more data is collected in a replication.
Transporter variables
Transporter-related variables fall into four broad categories. First, general-status variables apply to both free-path and guided transporters, describing the idle or busy status and velocity characteristics of the transporters. Two additional sets of variables for free-path and guided transporters provide information related to the position and other characteristics of the transporters and their units. Finally, a set of variables related to the guided transporter network are available to access information about the network composition. Most variables have one or more arguments that take on a transporter, link, intersection, station, network, or distance ID. In each of these cases, a number, name, or expression evaluating to a construct number may be provided. The Unit Number of many variables defines the specific transporter unit from a set of vehicles; it may be specified as an expression that evaluates to an integer quantity. Unless otherwise described, all arguments must be specified for transporter variables.
24
1 Variables
1 VARIABLES
Velocity-related variables (including acceleration and deceleration) are real-valued quantities and are user-assignable. Most other variables are integer quantities; they are not user-assignable unless otherwise noted.
25
VARIABLES GUIDE
DEC ( Transporter ID )Deceleration. DEC returns the deceleration factor for transporters in set Transporter ID. ISZT ( Transporter ID, Unit Number )Size type. ISZT returns a 1 if the specified transporter size is based on zones, or 2 if it is based on length. The value of ISZT is constant for a particular transporter throughout a run; however, the value of NSZT (transporter size value) may change if a transporter executes Capture or Relinquish modules. LDL ( Transporter ID, Unit Number )Destination link. If the transporter is moving toward a destination that was defined as a position on a link (on a Move, Request, or Transport module), LDL returns the link number to which the unit is being moved. (Also see LDZ.) Otherwise, LDL returns 0 (e.g., transporter is moving to a station/intersection destination or is stationary). LDX ( Transporter ID, Unit Number )Destination intersection. If the transporter is moving toward a station or intersection destination, LDX returns the intersection number to which the unit is moving. LDX returns 0, otherwise. LDZ ( Transporter ID, Unit Number )Destination zone number. If the transporter is moving toward a link destination (see LDL), LDZ returns the destination zone number. LDZ returns 0, otherwise. LT ( Transporter ID, Unit Number )Intersection location. LT returns the current intersection number if the transporter is stationary, or moving in an intersection, or the ending intersection of the link if the transporter is in transit through a link (based on current travel direction). LTL ( Transporter ID, Unit Number )Link location. If the transporter is moving through a link or is stationary in a link, LTL returns the link number. If the transporter is in an intersection, LTL returns 0. LTZ ( Transporter ID, Unit Number )Zone location. LTZ returns the zone number in link LTL, or 0 if the transporter is in an intersection. NSZT ( Transporter ID, Unit Number )Transporter size value. NSZT returns the current number of zones or length units occupied by the specified transporter. The actual NSZT value may be interpreted as zones or length based upon the size type value, ISZT. When a transporter captures new zones/length, NSZT increases to the new transporter size; when it relinquishes zones/length, NSZT decreases. If NSZT is 0 (i.e., all zones have been relinquished), the transporter moves through the system without blocking or being blocked by other transporters. TAZ ( Transporter ID, Unit Number )Zone arrival time. TAZ returns the time at which the transporter arrived at the end of the last zone through which it moved. If the transporter is moving in a zone (or intersection), TAZ returns the time that it arrived at the
26
1 Variables
1 VARIABLES
previously occupied zone/intersection. If the transporter is stationary, TAZ records the time that it stopped moving. TVF ( Transporter ID )Turning velocity factor. TVF returns the turning velocity factor for the transporter set specified by Transporter ID. This quantity is multiplied by a transporter units current velocity when the transporter changes travel direction, if directions are specified in the guided network. TWZ ( Transporter ID, Unit Number )Time waiting in zone. TWZ accumulates the total amount of time that the specified transporter unit has spent waiting for access to zones because of blockage by another transporter unit. TWZ does not record time spent stationary due to delays in the model (e.g., idle transporter waiting for a request).
27
VARIABLES GUIDE
NEXTX ( Network ID, Beginning Intersection ID, Destination Intersection ID )Next travel intersection. NEXTX returns the next intersection of travel in the specified Network ID from the Beginning Intersection ID to the Destination Intersection ID. If NEXTX returns a value equal to the Destination Intersection, then the two intersections are directly connected by a link. NL ( Link ID )Number of occupied zones in link. NL returns the number of zones occupied by transporters in the specified Link ID. The value of NL does not include reserved zones (i.e., via Capture module). NX ( Intersection ID )Intersection status. NX returns a value of 0 if the intersection is unoccupied, 1 if it is occupied, or -1 if it is reserved (i.e., via Capture module). NXB ( Link ID )Beginning intersection. NXB returns the beginning intersection number of the specified Link ID. NXE ( Link ID )Ending intersection. NXE returns the ending intersection number of the specified Link ID. NZ ( Link ID, Zone Number )Zone status. NZ returns the status of the specified Zone Number in Link ID. A value of 0 is returned if the zone is unoccupied, 1 if it is occupied, or -1 if it is reserved (i.e., via a Capture module). VL ( Link ID )Link velocity factor. VL returns the velocity factor applied to travel through the specified Link ID, as defined in the NetworkLink module. VX ( Intersection ID )Intersection velocity factor. VX returns the velocity factor applied to travel through the specified Intersection ID.
Expressions variables
Three mechanisms are provided to access the value of a defined expression. All return real- or string-valued quantities; they are not user-assignable. Where an Expression Number argument is required, it is the construct number of the expression (as listed in the Expressions module from the Elements panel). The number may be entered as a constant, an expression, or as NSYM(Expression Name).
28
1 VARIABLES
ED ( Expression Number )Expression value. ED returns the current value of the specified expression number. EXPR ( Expression Number [ , Index 1, Index 2 ] )Expression value. EXPR returns the value of the specified expression, where Expression Number is the instance number in the Expressions module. Index 1 and Index 2 must be specified if the expression is indexed. EXPR is used when the actual expression number to be used is stored in an attribute, variable, or static.
Note: The value of EXPR(Expression ID) is not the same as the value of Expression ID. The Expression ID returns the actual expression value; function NSYM may be used to translate an expression identifier into the desired Expression Number.
1 Variables
Expression Name [ ( Index 1, Index 2 ) ]Expression value. To return the value of an expression, the simple form using the expression name itself (with indices if the expression is indexed) may be used.
Functions variables
NSYM ( Symbol Name )Symbol number. All defined simulation elements have a unique number. For those constructs that have names, the function NSYM may be used to return the number corresponding to the construct name. The Symbol Name must be specified as a simple name or indexed name; the index, if used, may be an expression. NSYM returns an integer value; it is not user-assignable. NUMBLK [ ( Block Label ) ]Block number. NUMBLK returns the number of the block corresponding to Block Label. It is an integer value; it is not user-assignable. If Block Label is omitted, NUMBLK returns the number of the current block. TF ( Table ID, X Value )Table function value. TF evaluates the value stored in Table ID for a real-valued quantity X value. TF returns a real-valued quantity; it is not userassignable. UF ( User Function Number )User-coded function. UF executes the C, FORTRAN, or VBA code of function UF, passing User Function Number as the function number parameter. The return value of UF is provided by the user-coded routine; it is a real-valued quantity.
29
VARIABLES GUIDE
V ( Variable Number )Variable value. The V( ) array returns the current value of the specified Variable Number, which is the instance number of the corresponding variable in the Variables module. VAR ( Variable Number [, Index 1, Index 2 ] )Variable value. VAR returns the value of the general-purpose variable Variable Number with associated indices Index 1 and Index 2; the number of indices specified must match the number defined for the variable. This variable is used when the actual Variable ID to be accessed or changed is stored in an attribute, another variable, a static, etc.
Note: The value of VAR(Variable Name) is not the same as the value of simply the Variable Name. Using the Variable Name returns the actual variable value; function NSYM may be used to translate a variable identifier into the desired Variable Number.
Variable Name [ ( Index 1, Index 2 ) ]Variable value. To assign or return the value of a variable, the simple form using the variable name itself (with indices if the variable is indexed) may be used.
Parameters variables
CO ( Parameter Set ID )Constant value. CO returns the value of the first parameter value in the specified Parameter Set ID. CO returns a real-valued quantity; it is not userassignable. NMPAR ( Parameter Set ID )Number of parameter values. NMPAR returns the number of values defined in the specified Parameter Set ID. It is an integer value; it is not userassignable. P ( Parameter Set ID, Parameter Number )Parameter value. The function P returns the value of the specified Parameter Number in element Parameter Set ID. New values may be assigned within a parameter set by using the P function; it is a real-valued quantity.
Schedule variables
NSExpo ( Schedule ID )Non-stationary exponential distribution. This function is typically used in the Create module for specifying interarrival times that vary according to a schedule. The schedule must be specified as type Arrivals. This distribution is used in situations where arrivals follow a Poisson process; however, the arrival rate varies over time. For example, the arrival rate at a fast-food restaurant will be larger during the lunch time rush hour than during mid-morning. In this case, the arrival rate automatically changes to follow the values specified in its schedule. SchedValue ( Schedule ID )Schedule value. This function returns the current value of a schedule. The schedule must be of type Other. This is useful for returning a value that varies according to a schedule. For example, a learning curve (skill level) could be
30
1 VARIABLES
modeled using the expression NominalProcessTime * SchedValue(SkillLevel) for a process time where SkillLevel is the name of a schedule of type Other.
1 Variables
J index variable
JSearch index variable. J is an integer, user-assignable variable. It is used in the Search and FindJ modules to return the selected index value, based on a search criterion and range. J may be used within a model for other purposes as well; however, execution of a Search or FindJ module will give J a new value.
Set variables
The Sets module allows definition of an indexed group of constructs of the same type (e.g., resources, queues, stations). The set index refers to the order of a particular construct within a set. Set variables return integer quantities. They are not user-assignable. MEMBER ( Set ID, Index )Set member. The MEMBER function returns the construct number of a particular set member. Set ID defines the set to be examined; Index is the index of the set. The construct number (e.g., resource number) returned by MEMBER may be used in a block or assignment. MEMIDX ( Set ID, Member ID )Member index in set. MEMIDX returns the set index value of a particular construct (Member ID) in the specified Set ID. Member ID is an expression evaluating to a construct number.
Note: If Set ID contains attributes, variables, or expressions constructs, the NSYM function may be necessary to define Member ID correctly since these construct names are evaluated to their values (rather than simply translating into the construct number).
NUMMEM ( Set ID )Number of members. NUMMEM returns the number of constructs in the specified Set ID.
Station variables
INXNUM ( Station ID )Intersection number. INXNUM returns the intersection number that is associated with station, Station ID, or 0 if none was specified. This value may be changed by making an assignment to INXNUM, in which case any subsequent transporter movements to the station will send the transporter to the newly specified intersection. MSQ ( Sequence ID, Sequence Index )Sequence station. MSQ returns the station to be visited at the specified Sequence Index (i.e., IS attribute value) of Sequence ID. MSQ is an integer quantity; it is not user-assignable. NE ( Station ID )Number of entities transferring. NE returns the number of entities currently in transit to the specified destination Station ID. Each time an entity conveys, routes, or transports to a station, variable NE is incremented; when an entity arrives at the
31
VARIABLES GUIDE
end of such a transfer, NE is decremented. Note that material-handling modules such as Move and Request do not change NE; only the transferring entities affect its value. NE is an integer quantity; it is not user-assignable. The following variables return the time or cost accrued in the activity area associated with Station Name, or 0 if an activity area is not associated with the station: StnVATime(Station Name) Total Value-Added Time. This variable returns the total value added time accrued for the activity area associated with the specified station. StnNVATime(Station Name)Total Non-Value Added Time. This variable returns the total non-value added time accrued for the activity area associated with the specified station. StnTranTime(Station Name)Total Transfer Time. This variable returns the total transfer time accrued for the activity area associated with the specified station. StnOtherTime(Station Name)Total Other Time. This variable returns the total time categorized as Other accrued for the activity area associated with the specified station. StnWaitTime(Station Name)Total Wait Time. This variable returns the total wait time accrued for the activity area associated with the specified station. StnTotalTime(Station Name)Total Time. This variable returns the total time (the sum of all 5 time categories) accrued for the activity area associated with the specified station. StnVACost(Station Name)Total Value Added Cost. This variable returns the total valueadded cost accrued for the activity area associated with the specified station. StnNVACost(Station Name)Total Non-Value Added Cost. This variable returns the total non-value added cost accrued for the activity area associated with the specified station. StnTranCost(Station Name)Total Transfer Cost. This variable returns the total transfer cost accrued for the activity area associated with the specified station. StnOtherCost(Station Name)Total Other Cost. This variable returns the total cost categorized as Other accrued for the activity area associated with the specified station. StnWaitCost(Station Name)Total Wait Cost. This variable returns the total wait cost accrued for the activity area associated with the specified station. StnTotalCost(Station Name)Total Cost. This variable returns the total cost (the sum of all 5 cost categories) accrued for the activity area associated with the specified station.
32
1 VARIABLES
Storage variable
NSTO ( Storage ID )Number of entities in storage. NSTO records the number of entities that are stored in the specified Storage ID. It is changed by the Store and Unstore modules and by Delay, Request, and Move modules that specify storages. NSTO is not userassignable.
1 Variables
Stack variables
The following variables are used in conjunction with the Stack module. When a Stack Save operation is performed, the full set of internal time attributes and cost attributes (see Attributes and entity-related variables on page 40) is saved. The variables below are used to access those saved values. Diff.StartTimeDifference in saved start time. This returns the current start time (Entity.StartTime) minus the saved start time. This is commonly used for time in process. Diff.VATimeDifference in value-added time. This returns the amount of value-added time that has accrued since the last Stack Save operation. Its value is the entitys current value-added time minus the saved value-added time. Diff.VACostDifference in value-added cost. This returns the amount of value-added cost that has accrued since the last Stack Save operation. Its value is the entitys current valueadded cost minus the saved value-added cost. Diff.NVATimeDifference in non-value-added time. This returns the amount of nonvalue-added time that has accrued since the last Stack Save operation. Its value is the entitys current non-value-added time minus the saved non-value-added time. Diff.NVACostDifference in non-value-added cost. This returns the amount of non-valueadded cost that has accrued since the last Stack Save operation. Its value is the entitys current non-value-added cost minus the saved non-value-added cost. Diff.WaitTimeDifference in waiting time. This returns the amount of waiting time that has accrued since the last Stack Save operation. Its value is the entitys current waiting time minus the saved waiting time. Diff.WaitCostDifference in waiting cost. This returns the amount of waiting cost that has accrued since the last Stack Save operation. Its value is the entitys current waiting cost minus the saved waiting cost. Diff.TranTimeDifference in transfer time. This returns the amount of transfer time that has accrued since the last Stack Save operation. Its value is the entitys current transfer time minus the saved transfer time.
33
VARIABLES GUIDE
Diff.TranCostDifference in transfer cost. This returns the amount of transfer cost that has accrued since the last Stack Save operation. Its value is the entitys current transfer cost minus the saved transfer cost. Diff.OtherTimeDifference in other time. This returns the amount of other time that has accrued since the last Stack Save operation. Its value is the entitys current other time minus the saved other time. Diff.OtherCostDifference in other cost. This returns the amount of other cost that has accrued since the last Stack Save operation. Its value is the entitys current other cost minus the saved other cost.
Flow variables
Arena provides variables to access information about tanks, regulators, and sensors in the model via the Flow Process panel. The arguments Tank ID, Regulator ID, and Sensor ID refer to the tank, regulator, and sensor name respectively. They cannot be defaulted.
Tank variables
TankCapacity ( Tank ID )Tank Capacity. Returns the capacity of the tank. This variable is assignable. TankLevel ( Tank ID )Tank Level. Returns the current level of material in the tank. This variable is assignable. TankNetRate ( Tank ID )Tank Net Rate. Returns the net flow rate in the tank. The rate is positive if the tanks level is increasing, and negative if the Tanks level is decreasing. TankQtyAdded ( Tank ID )Quantity Added To Tank. Returns the total quantity of material added to the tank. TankQtyRemoved ( Tank ID )Quantity Removed From Tank. Returns the total quantity of material removed from the tank.
Regulator variables
RegulatorMaxRate ( Regulator ID )Regulator Maximum Rate. Returns the maximum rate of flow allowed through the regulator. This variable is assignable. RegulatorState ( Regulator ID )Regulator State. Returns the state of the regulator (1=Adding, -1=Removing, 0=Not In Use).
34
1 Variables
1 VARIABLES
RegulatorRate ( Regulator ID )Regulator Rate. Returns the current rate of flow through the regulator. RegulatorQtyAdded ( Regulator ID )Quantity Added By Regulator. Returns the total quantity of material added using the regulator. RegulatorQtyRemoved ( Regulator ID )Quantity Removed By Regulator. Returns the total quantity of material removed using the regulator. RegulatorTank ( Regulator ID )Tank Number Of Regulator. Returns the number of the tank with which the regulator is associated. FlowRate ( Source Regulator ID, Destination Regulator ID )Flow Rate Between Regulators. Returns a 0.0 if there is no flow between the specified regulators. Returns a positive value if there is flow from the source regulator to the destination regulator, or a negative value if there is flow from the destination to the source.
Sensor variables
SensorLocation (Sensor ID )Sensor Location. Returns the level location of the sensor. This variable is assignable. SensorState ( Sensor ID )Sensor State Indicator. Returns whether the sensor is enabled or disabled (0=disabled, 1=enabled). This variable is assignable. SensorTank ( Sensor ID )Tank Number Of Sensor. Returns the number of the tank with which the sensor is associated. SensorIsCovered ( Sensor ID )Sensor Is Covered Indicator. Returns whether the sensors location is above or below the tanks current level (0=No, 1=Yes). Note that this variable always returns 0 if the sensor is disabled (i.e., SensorState = 0).
Operators
The following table includes mathematical operators and logical operators supported by Arena. Standard math priority rules are used to evaluate complex equations.
Operator Math Operators ** Exponentiation 1 (highest) Operation Priority
35
VARIABLES GUIDE
Operator / * +
Priority 2 2 3 3
Operator Logical Operators .EQ. , == .NE. , <> .LT. , < .GT. , > .LE. , <= .GE. , >= .AND., && .OR., ||
Operation
Priority
Equality comparison Non-equality comparison Less than comparison Greater than comparison Less than or equal to comparison Greater than or equal to comparison Conjunction (and) Inclusive disjunction (or)
4 4 4 4 4 4 5 5
Note that == is a logical operator and = is an assignment operator. Use == to test whether two items have the same value; use = to set a value, as in the Assign module.
Math Functions
Arena provides 20 standard mathematical functions. Each function takes a parameter list enclosed in parentheses. These parameters may be specified as constants or expressions when used in a model.
36
1 VARIABLES
Remarks
The geometric functions (ACOS, ASIN, ATAN, HCOS, HSIN, HTAN, COS, SIN, TAN) take a value specified in radians.
Function ABS( a ) ACOS( a ) AINT( a ) AMOD( a1 , a2 ) ANINT( a ) ASIN( a ) ATAN( a ) COS( a ) EP( a ) HCOS( a ) HSIN( a ) HTAN( a ) MN( a1 , a2 , ... ) MOD( a1 , a2 ) MX( a1 , a2 , ... ) LN( a ) LOG( a ) SIN( a ) SQRT( a ) TAN( a ) Description Absolute value Arc cosine Truncate Real remainder, returns (a1-(AINT(a1/a2)*a2)) Round to nearest integer Arc sine Arc tangent Cosine Exponential (ea) Hyperbolic cosine Hyperbolic sine Hyperbolic tangent Minimum value Integer remainder, same as AMOD except the arguments are truncated to integer values first Maximum value Natural logarithm Common logarithm Sine Square root Tangent
1 Variables
37
VARIABLES GUIDE
constant throughout a simulation run. Each of these variables returns an integer quantity. They are not user-assignable.
Variable MXARR MXASM MXATT MXBKG MXBLK MXCNT MXCNV MXCST MXDSB MXDST MXENT MXEXP MXFAL MXFIL MXFRQ MXINX MXLEV MXLNK MXNET MXOUT MXPAR MXQUE MXRAT MXREC MXRES Element Name or Description Number of ARRIVALS Number of Named Attribute Symbols Number of ATTRIBUTES Number of BLOCKAGES Number of Blocks in SIMAN model Number of COUNTERS Number of CONVEYORS Number of CSTATS Number of DISTRIBUTIONS Number of DSTATS Maximum number of entities that can be active for a given RSET size Number of EXPRESSIONS Number of FAILURES Number of FILES Number of FREQUENCIES Number of INTERSECTIONS Number of LEVELS Number of LINKS Number of NETWORKS Number of OUTPUTS Number of PARAMETERS Number of QUEUES Number of RATES Number of RECIPES Number of RESOURCES
38
1 VARIABLES
Variable MXRLN MXRPT MXRUL MXSCH MXSEE MXSEQ MXSET MXSTA MXSTR MXSTS MXSTT MXTAB MXTAL MXTRN MXVAR MXVSM UBOUNDCOL UBOUNDROW
Number of REPORTLINES Number of REPORTS Number of RULES Number of SCHEDULES Number of SEEDS Number of SEQUENCES Number of SETS Number of STATIONS Number of STORAGES Number of STATICS Number of STATESETS Number of TABLES Number of TALLIES Number of TRANSPORTERS Number of VARIABLES Number of Named Variable Symbols Number of columns in an arrayed expression, variable, or attribute Number of rows in an arrayed expression, variable, or attribute
39
VARIABLES GUIDE
ATTRIBUTES VARIABLES
Arguments Index 1, Index 2 Attribute Number [, Entity Number]* [Entity Number] [Entity Number] [Entity Number] [Entity Number] [Entity Number]
Description General-purpose entity attribute General-purpose entity attribute Entity-type attribute Entity animation attribute Entity serial number Entity jobstep (sequence index) attribute Entity sequence attribute Entity station location attribute Entity current station location attribute Entity next planned station location attribute
Entity.SerialNumber
o
Entity.CurrentStation Entity.PlannedStation
Assignable Entity number is an optional argument that permits referencing and assigning attributes of remote entities.
*
40
1 VARIABLES
TIME
ATTRIBUTES VARIABLES
1 Variables
Arguments
Description Entity creation time attribute Entity start time attribute Entity value-added time attribute Entity non-value-added time attribute Entity waiting time attribute Entity transfer time attribute Entity other time attribute
COST
ATTRIBUTES VARIABLES
Variable
o
Arguments
Description Entity holding cost rate Entity valued-added cost attribute Entity non-valued-added cost attribute Entity waiting cost attribute Entity transfer cost attribute Entity other cost attribute
Entity.HoldCostRate
Assignable
41
VARIABLES GUIDE
ENTITY-TYPE
Variable EntitiesIn EntitiesOut EntitiesWIP InitialPicture
VARIABLES
Arguments Entity Type Entity Type Entity Type Entity Type Entity Type Entity Type Entity Type Entity Type Entity Type Entity Type
Description Number of entities in Number of entities out Number of entities in process Initial picture Initial hold cost rate Initial value-added cost Initial non-value-added cost Initial waiting cost Initial transfer cost Initial other cost
GROUP
Variable AG
MEMBER VARIABLES
Arguments Rank, Attribute Number Rank [, Entity Number]* [Entity Number] Rank Rank Rank [Entity Number]* Attribute Number
Description Group member attribute Grouped entity number Group type Grouped entity IS attribute Grouped entity M attribute Grouped entity NS attribute Number of grouped entities Sum of grouped entity attributes
Entity number is an optional argument that permits referencing and assigning attributes of remote entities.
42
1 VARIABLES
OTHER
Variable
o
ENTITY VARIABLES
1 Variables
ATTR
IDENT NUMENT
Assignable
43
VARIABLES GUIDE
Continuous variables
LEVEL
VARIABLES
Variable
o
Level Name S
RATE
VARIABLES
Variable
o
Rate Name D
Assignable
44
1 VARIABLES
Conveyor variables
1 Variables
GENERAL
Variable ICS Argument Conveyor ID Description Conveyor status indicator (0 = idle, 1 = moving, 2 = blocked, 3 = inactive) Conveyor length Conveyor velocity
MLC
o
Conveyor ID Conveyor ID
VC
CONVEYING
Variable CLA LC LEC NEA NEC CNVDST
ENTITY VARIABLES
Argument Conveyor ID Conveyor ID Conveyor ID Conveyor ID Conveyor ID Conveyor Number, Entity Number
Description Length of accumulated entities Number of occupied cells Length of conveying cells Number of accumulated entities Number of conveying entities Entity location on conveyor
Assignable
45
VARIABLES GUIDE
Queue variables
GENERAL
Variable ENTATRANK FIRSTINQ LASTINQ NQ
QUEUE VARIABLES
Description Entity number of queued entity First entity number in queue Last entity number in queue Number in queue
QUEUED
Variable AQUE ISQUE MQUE NSQUE
ENTITY VARIABLES
Arguments Queue ID, Rank, Attribute Number Queue ID, Rank Queue ID, Rank Queue ID, Rank Entity Number Queue ID, Attribute Number Entity Number
Description Attribute of queued entity Sequence index attribute of queued entity Station attribute of queued entity Sequence number attribute of queued entity Queued entity predecessor Sum of attributes of queued entities Queued entity successor
46
1 VARIABLES
Resource variables
1 Variables
GENERAL
Variable IRF
o
RESOURCE VARIABLES
Argument Resource ID Resource ID Resource ID Resource ID Resource ID Resource ID Resource ID Resource ID Resource Expr, StateString
Description Resource failure Resource capacity Number of busy resource units Resource utilization Number of seizes Resource type Resource location Resource state Resource stateset Idle resource state constant Busy resource state constant Inactive resource state constant Failed resource state constant
MR
STATE
Replication variables
Variable
o
Argument
MREP
NREP
Assignable
47
VARIABLES GUIDE
Argument Expression Expression Expression Expression Expression Expression Expression Expression Expression
Description Simulation time in year with century Simulation time as integer for calendar month integer Simulation time as integer for calendar week of year Simulation time as integer for day of year Simulation time as integer for day of month Simulation time as integer of hour of 24-hour day Simulation time as integer of minute of calendar time Simulation time as integer of second of calendar time Simulated time in base units corresponding to midnight of calendar date specified
CURRENT
Variable
o
Argument
TFIN
TNOW
Assignable
48
1 VARIABLES
CONVERTING
Variable
1 Variables
Description Time value conversion Time value conversion Time value conversion Time value conversion
Argument
49
VARIABLES GUIDE
COSTS
Variable
VARIABLES
Argument
Description Total value-added cost Total non-value-added cost Total waiting cost Total transfer cost Total other cost Total entity cost Total resource usage cost Total resource busy cost Total resource idle cost Total resource cost Total system cost
Total.VACost Total.NVACost Total.WaitCost Total.TranCost Total.OtherCost Total.EntityCost Total.ResUseCost Total.ResBusyCost Total.ResIdleCost Total.ResourceCost Total.SystemCost
STATISTICS VARIABLES
MC
NC
Assignable
50
1 VARIABLES
TIME-PERSISTENT
Variable CAVG CMAX CMIN CSTD CTPD CHALF CVALUE CBATCH CNUMBAT CBATSIZ
STATISTICS
(CSTAT)
VARIABLES
1 Variables
Argument Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID Cstat ID
Description Average value Maximum value Minimum value Standard deviation Time period Half width Last recorded value Average value in batch Number of batches Batch size
51
VARIABLES GUIDE
TIME-PERSISTENT
Variable DAVG DMAX DMIN DSTD DTPD DHALF DVALUE DBATCH DNUMBAT DBATSIZ
STATISTICS
(DSTAT)
VARIABLES
Argument Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID Dstat ID
Description Average value Maximum value Minimum value Standard deviation Time period Half width Last recorded value Average value in batch Number of batches Batch size
52
1 VARIABLES
FREQUENCIES
Variable FAVG FCATS FCOUNT
o
STATISTICS VARIABLES
1 Variables
Arguments Frequency ID, Category Frequency ID Frequency ID, Category Frequency ID, Category Frequency ID, Category Frequency ID, Category Frequency ID, Category Frequency ID, Category Frequency ID Frequency ID Frequency ID
Description Average time in category Number of categories Frequency category count Frequency category high limit Frequency category low limit Standard category percent Time in category Restricted category percent Total frequency time Restricted frequency time Last recorded value
FHILIM FLOLIM
Assignable
53
VARIABLES GUIDE
TALLY
STATISTICS VARIABLES
Variable TAVG TMAX TMIN TNUM TSTD THALF TVALUE TBATCH TNUMBAT TBATSIZ
Argument Tally ID Tally ID Tally ID Tally ID Tally ID Tally ID Tally ID Tally ID Tally ID Tally ID
Description Average value Maximum value Minimum value Number of observances Standard deviation Half width Last recorded value Average value in batch Number of batches Batch size
OUTPUT
Variable OVALUE
STATISTICS VARIABLE
Argument Output ID
POST-RUN
Variable ORUNAVG ORUNMAX ORUNMIN ORUNHALF
STATISTICS VARIABLES
54
1 VARIABLES
Transporter variables
1 Variables
GENERAL
Variable
o
STATUS VARIABLES
Arguments Transporter ID, Unit Number Transporter ID Transporter ID Transporter ID Transporter ID, Unit Number
Description Transporter unit status Number of active units Number of busy units Transporter set velocity Transporter unit velocity
IT
MT NT
o
VT VTU
FREE-PATH
Variable ID IDIST
TRANSPORTER VARIABLES
Arguments Transporter ID, Station ID Distance Set ID, Beginning Station ID, Ending Station ID Transporter ID, Unit Number
LT
Transporter location
Assignable
55
VARIABLES GUIDE
GUIDED
Variable ACC DEC ISZT LDL LDX LDZ LT LTL LTZ NSZT TAZ TVF TWZ
TRANSPORTER VARIABLES
Arguments Transporter ID Transporter ID Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID, Unit Number Transporter ID Transporter ID, Unit Number
Description Acceleration Deceleration Size type Destination link Destination intersection Destination zone number Intersection location Link location Zone location Transporter size value Zone arrival time Turning velocity factor Time waiting in zone
56
1 VARIABLES
GUIDED
Variable INXNUM IDSNET
NETWORK VARIABLES
1 Variables
Arguments Station ID Network ID, Beginning Intersection ID, Ending Intersection ID Link ID Beginning Intersection ID, Ending Intersection ID Link ID Intersection ID Link ID Link ID Network ID, Beginning Intersection ID, Destination Intersection ID Link ID Intersection ID Link ID Link ID Link ID, Zone Number Link ID Intersection ID
Zone length Connecting link Link type Intersection length Number of zones Destination intersection Next travel intersection
NL NX NXB NXE NZ VL VX
Number of occupied zones in link Intersection status Beginning intersection Ending intersection Zone status Link velocity factor Intersection velocity factor
57
VARIABLES GUIDE
Miscellaneous variables
BLOCKAGE
Variable NB
STATUS VARIABLE
Argument Blockage ID
EXPRESSIONS
Variable ED EXPR Expression Name
VARIABLES
FUNCTIONS
Variable NSYM NUMBLK TF UF STR
VARIABLES
Arguments Symbol Name [ Block Label ] Table ID, X Value User Function Number (constructType, constructNum [,subConstructNum])
Description Symbol number Block number Table function value User-coded function Symbol name
58
1 VARIABLES
GENERAL-PURPOSE
Variable
o
GLOBAL VARIABLES
1 Variables
PARAMETERS
Variable CO NMPAR
o
VARIABLES
Arguments Parameter Set ID Parameter Set ID Parameter Set ID, Parameter Number
RESOURCE
Variable NSEXPO SchedValue
COST VARIABLES
Assignable
59
VARIABLES GUIDE
INDEX VARIABLE
Variable
o
Argument
SET
VARIABLES
Assignable
60
1 VARIABLES
STATION
Variable INXNUM MSQ NE StnVATime
VARIABLES
1 Variables
Arguments Station ID Sequence ID, Sequence Index Station ID Station Name Station Name Station Name Station Name Station Name Station Name Station Name Station Name Station Name Station Name Station Name Station Name
Description Intersection number Sequence station Number of entities transferring Station total value added time Station total non-value added time Station total transfer time Station total other time Station total wait time Station total time Station total value added cost Station total non-value added cost Station total transfer cost Station total other cost Station total wait cost Station total cost
StnNVATime StnTranTime StnOtherTime StnWaitTime StnTotalTime StnVACost StnNVACost StnTranCost StnOtherCost StnWaitCost StnTotalCost
STORAGE
Variable NSTO
VARIABLE
Argument Storage ID
61
VARIABLES GUIDE
STACK
Variable
VARIABLES
Arguments
Description Difference in saved start time Difference in value-added time Difference in value-added cost Difference in non-value-added time Difference in non-value-added cost Difference in waiting time Difference in waiting cost Difference in transfer time Difference in transfer cost Difference in other time Difference in other cost
Diff.StartTime Diff.VATime Diff.VACost Diff.NVATime Diff.NVACost Diff.WaitTime Diff.WaitCost Diff.TranTime Diff.TranCost Diff.OtherTime Diff.OtherCost
OPERATIONPARAMETER
Variable OpParamVal
VARIABLE
62
1 VARIABLES
Flow variables
1 Variables
TANK
VARIABLES
Variable
o
Description Tank capacity Tank level Tank net rate Quantity added to tank Quantity removed from tank
TankCapacity TankLevel
REGULATOR
Variable
o
VARIABLES
Argument Regulator ID Regulator ID Regulator ID Regulator ID Regulator ID Regulator ID Source Regulator ID, Destination Regulator ID
Description Regulator maximum rate Regulator state Regulator rate Quantity added by regulator Quantity removed by regulator Tank number of regulator Flow rate between regulators
RegulatorMaxRate
Assignable
63
VARIABLES GUIDE
SENSOR
Variable
o
VARIABLES
Description Sensor location Sensor state indicator Tank number of sensor Sensor is covered indicator
SensorLocation SensorState
SensorTank SensorIsCovered
Assignable
64
Strings in Arena
Introduction
In Arena, a string is text composed of a sequence of zero or more characters. A string can contain alphabetic characters, numbers, and symbols. Arena supports single-byte characters and thus supports the standard ASCII character set and the extended ASCII characters. Unicode strings are not supported. A string value may be specified in any Arena expression using one of the following approaches:
String Value String constant enclosed in quotation marks ( ) String variable name[(row, column)] String attribute name[(row, column)] Result from a string function Example Blue strVar==Blue strAttr==Blue Str(RESOURCES,3), StrFormat(Number In Queue = %f, NQ(MyQueue)), Chr(65), Str(TNOW)
2 Strings in Arena
Note: You cannot specify a ` or ^ character within a quoted string. Instead, you must use Chr function for these characters.
The Chr function may be used to return the character for an integer ASCII character code. For more information, see Chr function on page 70. Because the quotation mark character () is used to delimit strings in an expression, you cant use it directly to specify a quote within a string. Instead, place two consecutive quotes to specify a quote in a string (e.g.,):
The resource name is Fred.
Or build a string with imbedded quotes using the character code for a quote (34):
StrFormat(The resource name is %cFred%c.,34,34) The resource name is + Chr(34) + Fred + Chr(34) + .
65
VARIABLES GUIDE
String/numeric conversions
During a simulation run, an expression evaluated in the models logic or animation may be expected to return either a numeric or string value depending on the context in which it is used. Arenas SIMAN simulation language is strongly typed and does not support implicit data type conversions between numbers and strings. All data type conversions must be explicitly performed using the Str and Val conversion functions. For more information, see Str function on page 67 and Val function on page 68. If an expression is evaluated and the data type of the value returned by the expression is different than the expected data type, then a Data type mismatch runtime error will occur.
Comparing strings
Two strings may be compared in an expression using the standard logical operators:
Logical Operator Description
EQ. , = = .NE. , <> .LT. , < .GT. , > .LE. , <= .GE. , >=
Equality comparison Non-equality comparison Less than comparison Greater than comparison Less than or equal to comparison Greater than or equal to comparison
Strings are compared by character using character codes (a case sensitive comparison). A logical expression returns 1 if True and 0 if False. For example, the logical expression strColor= =Blue will return true (1) if the string variable strColor contains the value Blue. Otherwise, the expression will return false (0). A Data type mismatch error occurs if an attempt is made to logically compare a string value to a real number. The StrCompare function may also be used to perform string comparisons. In particular, this function is useful in that it provides an option for performing textual comparisons that are not case sensitive. For more information, see StrCompare function on page 69.
66
2 STRINGS IN ARENA
Building strings
The addition operator (+) may be used as a string operator that concatenates the two strings. For example, the expression 1 + 5 will return the string 15. The StrFormat function is also available for building and returning a string in a specified format. For more information, see StrFormat function on page 69.
Str function
The Str function may be used to convert a numeric expression to a string, or to return the symbol name of a simulation construct. Str(Numeric Expression)String Conversion. This form of Str may be used to convert a numeric expression to a string. Examples: Str(123) returns 123 Str(1+3.2) returns 4.2 Str(Element Type, Element Symbol Number [,subConstructNum])Element Symbol Name. This form of Str may be used to return the symbol name of a simulation construct. When using Str in this form, the functions arguments are defined as follows: Element Type = the element type (FILES, RESOURCES, etc.) or a keyword (see list below) Element Symbol Number = number of the construct within the element (for example, use 5 for the 5th resource) subConstructNum = number of construct within another (for example, a step within a sequence element or a state within a stateset element) In addition to element names for Element Type, the following keywords may be used to return some additional special-purpose information: ANALYST Analyst name BASEFILE Program file name without extension COMPANY Company name MODDATE Model revision date PRGFILE Program file name with extension PRJNAME Project name
2 Strings in Arena
67
VARIABLES GUIDE
RUNDATE Execution date STRING User-defined string TIME Current system time Only the STRING keyword requires the second (Element Symbol Number) argument. Enter a string argument. Examples: Str(RESOURCES,5) returns the symbol name of the 5th resource element defined in the model. Str(ANALYST) returns the analyst name specified for the model. Str(STATESETS,2) returns the symbol name of the 2nd stateset element defined in the model. Str(STATESETS,2,1) returns the name of the first state specified in the 2nd stateset element defined in the model.
Val function
Val(String Expression)Numeric Conversion. The Val function may be used to convert a string value to a real number. All blank spaces, line feed characters, and tab characters are first stripped from the string argument. An attempt is then made to convert as much of the string into a number as possible. The conversion stops when a character in the string is not recognized as part of a number. Symbols and characters that are often considered parts of numeric values, such as dollar signs and commas, are not recognized. Only a period (.) is recognized as a valid decimal separator. If none of the string is recognized as a numeric value, then a 0 is returned for that string. Examples: Val(123) returns 123 Val(1.3) returns 1.3 Val(123abc) returns 123 Val(3E-3) returns 0.003 Val(junk) returns 0 Val(1 2 3) returns 123 Val(123abc123) returns 123 Val($100) returns 0
68
2 STRINGS IN ARENA
Val(1,234) returns 1
StrCompare function
StrCompare(StringExpression1, StringExpression2[,CompareOption])String Comparison. The StrCompare function returns -1 if StringExpression1 is less than StringExpression2, 0 if StringExpression1 equals StringExpression2, and 1 if StringExpression1 is greater than StringExpression2. If the CompareOption value is specified as 0 then a binary, case sensitive string comparison is performed using character codes. Otherwise, the string comparison is textual. A binary comparison is performed by default. Examples:
Comparison StrCompare("A", "B") StrCompare("A", "A") StrCompare("B", "A") StrCompare("ABC", "abc", 1) StrCompare("ABC", "abc") Result -1 (string1 is less than string2) 0 (string1 is equal to string2) 1 (string1 is greater than string2) 0 (string1 is equal to string2) -1 (string1 is less than string2)
2 Strings in Arena
StrFormat function
StrFormat(Format[,Parameters])Formatted String. The StrFormat function returns a formatted string value. The arguments for StrFormat are defined as follows: Format = A valid C-style format string Parameters = Optional format parameters. A parameter may be any valid Arena expression. Multiple format parameters are separated by commas. Examples:
StrFormat Expression StrFormat(Hi %c %d %s, 65, 10, there!) StrFormat(The value is %06.2f,1.23434) Returns Hi A 10 there! The value is 001.23
69
VARIABLES GUIDE
StrFormat Expression StrCompare("B", "A") StrCompare("ABC", "abc", 1) StrCompare("ABC", "abc") StrFormat(The value is %6.2f,1.23434) StrFormat(The value is %-6.2f,1.23434) StrFormat(The value is %.5s, abcdefghi) StrFormat(The value is %6s, abc) StrFormat(The value is %-6s, abc)
Returns 1 (string1 is greater than string2) 0 (string1 is equal to string2) -1 (string1 is less than string2) The value is 1.23 The value is 1.23 The value is abcde The value is abc
Chr function
Chr(Character Code)ASCII Character. The Chr function returns a single byte character string corresponding to the specified ASCII Character Code (0-255). The Character Code argument may be specified as an expression truncated to an integer. Examples:
Character Code 34 96 94 65 66 Returns ` ^ A B
Eval function
The Eval function is used to evaluate a simulation expression contained in a string argument. Eval(String Expression)Evaluate String Expression. Evaluates the simulation expression contained in the string argument String Expression and returns the result.
70
2 STRINGS IN ARENA
Examples:
2 Placeholder
EVAL("TNOW") EVAL(StrDestStation) where StrDestStation is a string attribute with current value "Station 1" EVAL("StrDestStation")
The value of the simulation expression, TNOW. The value of the simulation expression, Station 1.
"Station 1"
where StrDestStation is a The value of the simulation expression, StrDestStation. string attribute with current value Station 1" EVAL("NSYM(" + StrDestStation + ")") where StrDestStation is a string attribute with current value Station 1 EVAL("""Hello"" + ""World""") "HelloWorld" The value of the simulation expression, "Hello" + "World". The value of the simulation expression, NSYM(Station 1).
Mid function
The Mid function is used to return a sub-string from a string expression. Mid(String Expression, Start[, Length]) Return sub-string from string expression. Returns a sub-string from String Expression, starting at Start, of length Length. If Length is not specified, the sub-string is taken to the end of String Expression.
71
VARIABLES GUIDE
Examples:
MID Expression MID ("Fred",2) Returns "red" Comments Starting at the second character in the string "Fred", the MID function returns three characters, that is "red." The expression LEN ("Fred") - 1 returns 3. Thus, starting at the third character in the string "Fred", the MID function returns two characters, that is "ed."
"ed"
Len function
The Len function is used to calculate the length of a string expression. Len(String Expression) Length of String Expression. Returns the length of the string value of String Expression. Examples:
LEN Expression LEN ("Fred") LEN ("Fred" + "Jones") Returns 4 9
72
Index
A
A attribute 2 ACC 25 Active entity number 8 Activity Area variables 8 Activity area variables summary tables 43 AG 7 Animation entity picture 2 Animation attribute 2 AQUE 13 AreaNVACost 9 AreaNVATime 8 AreaOtherCost 9 AreaOtherTime 9 AreaTotalCost 10 AreaTotalTime 9 AreaTranCost 9 AreaTranTime 9 AreaVACost 9 AreaVATime 8 AreaWaitCost 9 AreaWaitTime 9 ATTR 8 Attribute value 8 Attributes 1 ATTR function 8 general-purpose 2 summary table 40 CalDayOfWeek 17 CalDayOfYear 17 Calendar dates and times 17 summary tables 48 Calendar variables 10 CalHour 17 CalMinute 17 CalMonth 17 CalSecond 17 CalWeek 17 CalYear 17 CAVG 20 CBATCH 21 CBATSIZ 21 CHALF 20 Chr function 70 CLA 12 CMAX 20 CMIN 20 CNUMBAT 21 CNVDST 12 CO 30 comparing Strings 66 Construct number (NSYM) 1, 29 Continuous variables 10 Level variables 10 Rate variables 11 Converting durations to the base time units 18 summary table 49 converting Strings 66 Conveying entity variables summary table 45 Conveyor variables 11 conveying entities 12 general 11 Cost attributes variables 5 summary tables 41 Cost variables 19 summary table 50 Count value 20 Counter statistics variables
Index
B
Block number variable (NUMBLK) Blockage status variable 28 building Strings 67 BUSY_RESource 15 29
C
CalDateToBaseTime 17 CalDayOfMonth 17
73
VARIABLES GUIDE
summary table 50 Counter variables 20 CSTAT variables 20 summary table 51 CSTD 20 CTPD 20 Current and final simulation time summary table 48 CVALUE 21
18
D
D array 11 Date and time variables DAVG 21 DaysToBaseTime 18 DBATCH 22 DBATSIZ 22 DEC 26 DHALF 21 Diff.NVACost 33 Diff.NVATime 33 Diff.OtherCost 34 Diff.OtherTime 34 Diff.StartTime 33 Diff.TranCost 34 Diff.TranTime 33 Diff.VACost 33 Diff.VATime 33 Diff.WaitCost 33 Diff.WaitTime 33 DMAX 21 DMIN 21 DNUMBAT 22 DSTAT variables 21 summary table 52 DSTD 21 DTPD 21 DVALUE 21 17
E
ED 29 ENTATRANK 13 EntInGroup 7 Entities active entity 8
additional entity variables 8 additional entity variables summary table 43 attributes 1, 2 entity number (IDENT) 8 group member variables 7 number of active (NUMENT) 8 EntitiesIn 6 EntitiesOut 6 EntitiesWIP 6 Entity serial number 2 Entity.CreateTime 4 Entity.CurrentStation 3 Entity.HoldCostRate 5 Entity.Jobstep 2 Entity.NVATime 4 Entity.OtherCost 6 Entity.OtherTime 4 Entity.Picture 2 Entity.PlannedStation 3 Entity.Sequence 3 Entity.StartTime 4 Entity.Station 3 Entity.TranCost 5 Entity.TranTime 4 Entity.Type 2 Entity.VACost 5 Entity.VATime 4 Entity.WaitCost 5 Entity.WaitTime 4 EntityNumberIsValid attribute 8 Entity-type variables summary tables 42 Eval function 70 Event calendar Event calendar variables summary tables 44 Event calendar variables 10 EXPR 29 Expression Name (EXPR) 29 Expressions (user-defined) variables 28 summary table 58
F
Factory Elements variables OperationParameter
74
INDEX
summary table 62 FAILED_RESource 16 FAVG 22 FCATS 22 FCOUNT 22 FHILIM 22 FIRSTINCAL 10 FIRSTINQ 13 FLOLIM 22 Flow variables 34 Regulator 34 summary tables 63 Sensor 35 summary tables 64 summary tables 63 Tank 34 summary tables 63 FlowRate 35 Free-path transporter variables summary table 55 Frequencies statistics variables summary table 53 Frequencies variables 22 FRQTIM 22 FSTAND 22 FTOT 23 FTOTR 23 functions Chr 70 Str 67 StrCompare 69 StrFormat 69 Val 68 Functions variables 29 summary table 58 FVALUE 23
General-purpose global variables 29 General-status Transporter variables summary table 55 Group member variables 7 summary table 42 GRPTYP 7 Guided network variables 27 summary table 57 Guided transporter variables 25 summary table 56
H
HoursToBaseTime 18
I
25 ICS 11 ID 25 IDENT 8 IDIST 25 IDLE_RESource 15 IDSNET 27 INACTIVE_RESource 15 InitialHoldCostRate 6 InitialNVACost 6 InitialOtherCost 7 InitialPicture 6 InitialTranCost 6 InitialVACost 6 InitialWaitCost 6 Intersection number 27, 31 INXNUM 27, 31 IRF 14 ISG 7 ISQUE 13 ISZT 26 IT 25
Index
G
General attributes 2 General conveyor variables summary table 45 General queue variables summary table 46 General resource variables summary table 47
J
J 31 J index variable 31 summary table 60 14
L
LASTINQ 13
75
VARIABLES GUIDE
LC 12 LDL 26 LDX 26 LDZ 26 LEC 12 Len function 72 LENZ 27 Level variables (continuous modeling) summary table 44 LNKNUM 27 Logical operators 35 LR 15 LT 25, 26 LTL 26 LTYP 27 LTZ 26 LX 27
10
summary table 62 Station summary table 61 Storage summary table 61 summary tables 58 MLC 11 MQUE 13 MR 14 MREP 16 MSQ 31 MT 25 MZ 27
N
Named level variable 10 NB 28 NC 20 NDX 27 NE 31 NEA 12 NEC 12 Network variables (guided transporters) summary table 57 NEXTINCAL 10 NEXTX 28 NG 7 NL 28 NMPAR 30 NQ 13 NR 14 NREP 16 NS attribute 3 NSExpo 30 NSG 7 NSQUE 13 NSTO 33 NSYM 1, 29 NSZT 26 NT 25 Number in queue 13 Number of grouped entities 7 NUMBLK 29 NUMENT 8 NUMMEM 31
M
Math functions 36 Math operators 35 MC 5, 20 MEMBER 31 MEMIDX 31 MG 7 Mid function 71 MinutesToBaseTime 18 Miscellaneous variables 28 Blockage status summary table 58 Expressions (user-defined) summary table 58 Functions summary table 58 General-purpose summary tables 59 J index summary table 60 Parameters summary table 59 Resource cost summary table 59 Set summary table 60 Stack
27
76
INDEX
NX 28 NXB 28 NXE 28 NZ 28
O
OperationParameter variables 62 Operators 35 ORUNAVG 24 ORUNHALF 24 ORUNMAX 24 ORUNMIN 24 Output statistics variable 24 summary table 54 OVALUE 24
RegulatorState 34 RegulatorTank 35 Replication variables 16 ResBusyCost 16 ResIdleCost 16 Resource cost variables 16 summary table 59 Resource location 15 Resource variables 14 RESSEIZES 14 ResUseCost 16 RESUTIL 14 RTYP 15, 47
S
S array 11 SAG 7 SAQUE 14 Schedule variables 30 SchedValue 30 SecondsToBaseTime 18 Sensor variables 35 summary tables 64 SensorIsCovered 35 SensorLocation 35 SensorState 35 SensorTank 35 Sequence index 2 Sequences attributes 3 Set variables 31 summary table 60 SIMAN constructs variables 37 Stack variables 33 summary table 62 STATE 15 STATEVALUE 15 Station attribute 3 Station variables 31 summary table 61 Statistics collection variables 20 Counter statistics 20 Frequencies statistics 22 Output statistics 24 Post-run statistics 24 Tally statistics 23
P
P 30 Parameter variables 30 Parameters variables summary table 59 PICTURE keyword/attribute 2 Post-run statistics variable 24 Post-run statistics variables summary table 54 PREDECESSOR 13
Index
Q
Queue variables 13 general 13 queued entities 13 Queued entity variables summary table 46
R
Rate Name 11 Rate variables (continuous modeling) summary table 44 Regulator variables 34 summary tables 63 RegulatorMaxRate 34 RegulatorQtyAdded 35 RegulatorQtyRemoved 35 RegulatorRate 35 11
77
VARIABLES GUIDE
Time-persistent statistics (Cstat) 20 Time-persistent statistics (Dstat) 21 warm up time 20 Steady state using NUMENT statistic 8 StnNVACost 32 StnNVATime 32 StnOtherCost 32 StnOtherTime 32 StnTotalCost 32 StnTotalTime 32 StnTranCost 32 StnTranTime 32 StnVACost 32 StnVATime 32 StnWaitCost 32 StnWaitTime 32 Storage variable 33 summary table 61 Str function 67 StrCompare function 69 StrFormat function 69 Strings 65 building 67 comparing 66 converting 66 SUCCESSOR 14 Summary table of variables 40 Activity area 43 Attributes and entity-related 40 Continuous variables 44 Conveyor variables 45 Date and Time 48 Event calendar variables 44 Flow 63 Miscellaneous variables 58 Queue 46 Replication 47 Resource variables 47 Statistics collection 50 System response 49 Transporter 55 System response variables 18
T
Table function value (TF) 29 Tally statistics variables summary table 54 Tally variables 23 Tank variables 34 summary tables 63 TankCapacity 34 TankLevel 34 TankNetRate 34 TankQtyAdded 34 TankQtyRemoved 34 TAVG 23 TAZ 26 TBATCH 23 TBATSIZ 24 TF 29 TFIN 18 THALF 23 Throughput variable summary table 49 Throughput variables 19 Time attribute variables summary table 41 Time-persistent statistics (Cstat) summary table 51 Time-persistent statistics (Dstat) summary table 52 TMAX 23 TMIN 23 TNOW 18 TNUM 23 TNUMBAT 23 Total.EntityCost 19 Total.NVACost 19 Total.OtherCost 19 Total.ResBusyCost 19 Total.ResIdleCost 19 Total.ResourceCost 19 Total.ResUseCost 19 Total.SystemCost 19 Total.Throughput 19 Total.TranCost 19 Total.VACost 19 Total.WaitCost 19
20 21
78
INDEX
Transporter variables 24 Free-path summary tables 55 free-path 25 General status summary tables 55 general status 25 guided 25 summary table 56 guided network 27 summary table 57 TSTD 23 TVALUE 23 TVF 27 TWZ 27
29
V
V array 30 Val function 68 VAR 30 Variable Name 30 Variables entity-related 1 summary table 40 Variables (user-defined) variables summary table 59 VC 12 VL 28 VT 25 VTU 25 VX 28
U
UBOUNDCOL UBOUNDROW 39 39
Index
79