Arena Variables Guide
Arena Variables Guide
VARIABLES GUIDE
PUBLICATION ARENAV-RM001K-EN-PJanuary 2012
Supersedes Publication ARENAV-RM001J-EN-P
PN-111650
Contact Rockwell Automation Customer Support Telephone 1.440.646.3434
Online Support http://www.rockwellautomation.com/support/
Copyright Notice 2014 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 see the license agreement for details.
Trademark Notices Arena, Rockwell Automation, and SIMAN are registered trademarks of Rockwell Automation, Inc.
Other Trademarks 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.
Warranty 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: 14.70.00
Modified: April 25, 2014 8:12:12 PM
i
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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Event calendar variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Level variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Rate variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Conveyor variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
General variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Conveying entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
General queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Queued entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
General resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Resource cost variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Replication variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Date and time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Calendar dates and times variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Current and final simulation time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Converting durations to the base time units variables . . . . . . . . . . . . . . . . . . . . . 20
System response variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Throughput variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Cost variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Statistics collection variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Counter statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Time-persistent statistics (Cstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Time-persistent statistics (Dstat) variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Frequencies statistics variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Tally statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Output statistics variable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Post-run statistics variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
iii
ARENA VARIABLES USERS GUIDE
Transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
General-status transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Free-path transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Guided transporter variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Guided network variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Miscellaneous Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Blockage status variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Expressions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Functions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
General-purpose global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Parameters variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Schedule variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
J index variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Set variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Station variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Storage variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Stack variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Flow variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Tank variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Regulator variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Sensor variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Math Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
SIMAN Constructs Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Summary Table of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Attributes and entity-related variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
General attributes variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Time attributes variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Cost attributes variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Entity-type variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Group member variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Other entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Activity area variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Event calendar variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Continuous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Level variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Rate variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Conveyor variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Conveying entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
iv
CONTENTS
Queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
General queue variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Queued entity variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
General resource variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Replication variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Date and time variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Calendar dates and times variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Current and final simulation time variables . . . . . . . . . . . . . . . . . . . . . . . . . 51
Converting durations to the base time units variables . . . . . . . . . . . . . . . . . 52
System response variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Throughput variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Costs variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Statistics collection variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Counter statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Time-persistent statistics (Cstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Time-persistent statistics (Dstat) variables . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Frequencies statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Tally statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Output statistics variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Post-run statistics variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
General status variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Free-path transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Guided transporter variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Guided network variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Miscellaneous variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Blockage status variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Expressions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Functions variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
General-purpose global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Parameters variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Resource cost variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
J index variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Set variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Station variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Storage variable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Stack variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
OperationParameter variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Flow variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Tank variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Regulator variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Sensor variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
v
ARENA VARIABLES USERS GUIDE
2 Strings in Arena 67
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
String/numeric conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Comparing strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Building strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Str function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Val function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
StrCompare function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
StrFormat function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Chr function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Eval function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Mid function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Len function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Index 77
vi
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 (for example, with an Assign module) throughout the simulation
run. The descriptions of the variables and the summary charts in this guide indicate
whether or not a variable is user-assignable.
1
ARENA VARIABLES USERS GUIDE
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.
2
1 VARIABLES
3
ARENA VARIABLES USERS GUIDE
4
1 VARIABLES
Entity.WaitTimeEntity waiting time attribute. This stores the total time accumulated
in queues (waiting areas) as well as processes and delays designated as Wait. When
the entity statistics are recorded (typically on dispose), this attribute is used to
determine the waiting time accrued by this entity.
Entity.TranTimeEntity transfer time attribute. This stores the total time
accumulated in transfers (transporters and conveyors) as well as processes and delays
designated as Transfer. When the entity statistics are recorded (typically on dispose),
this attribute is used to determine the total transfer time accrued by this entity.
Entity.OtherTimeEntity other time attribute. This stores the total time 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 time accrued by this entity. This category can be used if you
want to record time separate from one of the four standard categories above.
5
ARENA VARIABLES USERS GUIDE
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 of or its type is reassigned, EntitiesOut will be incremented.
6
1 VARIABLES
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.
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.
7
ARENA VARIABLES USERS GUIDE
8
1 VARIABLES
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 (for example, leaving entities in a queue) or the input rates
of entities to the system may simply be larger than the total output rate possible.
9
ARENA VARIABLES USERS GUIDE
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).
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).
10
1 VARIABLES
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 real-valued and user-assignable.
11
ARENA VARIABLES USERS GUIDE
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 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
(that is, 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
12
1 VARIABLES
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 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 (that is, 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.
13
ARENA VARIABLES USERS GUIDE
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.
14
1 VARIABLES
ISQUE ( Queue ID, Rank )Sequence index attribute of queued entity. ISQUE
returns the value of the jobstep (Entity.Jobstep or IS) attribute of the entity at the
specified Rank in queue Queue ID.
MQUE ( Queue ID, Rank )Station attribute of queued entity. MQUE returns the
value of the station (Entity.Station or M) attribute of the entity at the specified Rank
in queue Queue ID.
NSQUE ( Queue ID, Rank )Sequence number attribute of queued entity. NSQUE
returns the value of the sequence (Entity.Sequence or NS) attribute of the entity at the
specified Rank in queue Queue ID.
PREDECESSOR ( Entity Number )Queued entity predecessor. PREDECESSOR
returns the entity number (IDENT value) of the entity that directly precedes the
specified entity (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.
15
ARENA VARIABLES USERS GUIDE
16
1 VARIABLES
17
ARENA VARIABLES USERS GUIDE
ResIdleCost ( Resource ID )Resource idle cost rate. This returns the idle cost rate
specified in the resource module. This rate is the cost per time unit to be applied
during the entire time a resource is scheduled but not in use. Note that although this
rate is entered as a cost per hour, this variable always returns the rate as a cost per
base time unit (for example, TNOW units). So regardless of the current settings for
base time units, this rate can be used without conversion.
ResUseCost ( Resource ID )Resource usage cost. This returns the usage cost
specified in the resource module. This is not a rate, but rather the cost associated with
each use (or Seize) of a resource.
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.
Note: Use the Expression Builder to look up replication variables easily when building
or editing an expression.
18
1 VARIABLES
19
ARENA VARIABLES USERS GUIDE
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.
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.
20
1 VARIABLES
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 (for
example, 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 (for
example, 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 (for
example, 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.
21
ARENA VARIABLES USERS GUIDE
frequency number and, in some cases, category number. All of these arguments are
required.
When simulation statistics are cleared between replications or by the Warmup Period,
the statistics variables are reinitialized to their default values unless otherwise noted.
Unless otherwise stated, these variables are not user-assignable.
22
1 VARIABLES
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.
23
ARENA VARIABLES USERS GUIDE
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.
24
1 VARIABLES
25
ARENA VARIABLES USERS GUIDE
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
26
1 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.
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.
27
ARENA VARIABLES USERS GUIDE
IDIST ( Distance Set ID, Beginning Station ID, Ending Station ID )Distance set
value. IDIST returns the distance value from station Beginning Station ID to station
Ending Station ID in the specified Distance Set ID.
LT ( Transporter ID, Unit Number )Transporter location. LT returns the current
station location or destination (if the transporter is moving) of the specified
transporter unit.
28
1 VARIABLES
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 (that is, 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 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 (for example, idle transporter waiting for a
request).
29
ARENA VARIABLES USERS GUIDE
LENZ ( Link ID )Zone length. LENZ returns the length of each zone of the
specified Link ID.
LNKNUM ( Beginning Intersection ID, Ending Intersection ID )Connecting link.
LNKNUM returns the link number that connects Beginning Intersection ID with
Ending Intersection ID.
LTYP ( Link ID )Link type. LTYP returns a value of 1 if Link ID is unidirectional,
2 if it is bi-directional, and 3 if it is a spur.
LX ( Intersection ID )Intersection length. LX returns the length of the specified
Intersection ID.
MZ ( Link ID )Number of zones. MZ returns the number of zones defined for the
specified Link ID. (Also see LENZ.)
NDX ( Link ID )Destination intersection. NDX returns the destination intersection
of travel of transporters on the specified Link ID; if the link is unoccupied, NDX
returns a 0. If there are vehicles on the link, the ending intersection number is
returned if travel is in the forward direction (always the case for uni-directional
links). The beginning intersection is returned if travel is backward on a bi-directional
link or a spur.
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, 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 (that is, using a 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 (that is, using a 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 (that is, using a Capture module).
30
1 VARIABLES
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.
Miscellaneous Variables
Blockage status variable
NB ( Blockage ID )Current blockage quantity. NB returns the number of blockages
set (queue and block blockages) for the specified Blockage ID. The value of NB may
be changed by the Block and Unblock modules and by entities that reference
blockages when entering and leaving queues. NB is not user-assignable.
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).
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.
31
ARENA VARIABLES USERS GUIDE
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 user-
assignable.
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.
32
1 VARIABLES
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
user-assignable.
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 user-assignable.
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 modeled using the expression NominalProcessTime * SchedValue(SkillLevel) for
a process time where SkillLevel is the name of a schedule of type Other.
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.
33
ARENA VARIABLES USERS GUIDE
Set variables
The Sets module allows definition of an indexed group of constructs of the same type
(for example, resources, queues or 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 (for example, 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).
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 (that is, 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 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:
34
1 VARIABLES
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
value-added 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.
35
ARENA VARIABLES USERS GUIDE
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 user-assignable.
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
is saved. (See Attributes and entity-related variables on page 43.) 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 value-added cost minus the saved value-added cost.
Diff.NVATimeDifference in non-value-added time. This returns the amount of non-
value-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-
value-added 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.
36
1 VARIABLES
Flow variables
Arena provides variables to access information about tanks, regulators, and sensors in
the model from 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.
37
ARENA VARIABLES USERS GUIDE
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).
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 (that is, SensorState = 0).
38
1 VARIABLES
Operators
The following table includes mathematical operators and logical operators supported
by Arena. Standard math priority rules are used to evaluate complex equations.
39
ARENA VARIABLES USERS GUIDE
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.
Remarks
The geometric functions (ACOS, ASIN, ATAN, HCOS, HSIN, HTAN, COS, SIN,
TAN) take a value specified in radians.
Function Description
ABS( a ) Absolute value
ACOS( a ) Arc cosine
AINT( a ) Truncate
AMOD( a1 , a2 ) Real remainder, returns (a1-(AINT(a1/a2)*a2))
ANINT( a ) Round to nearest integer
ASIN( a ) Arc sine
ATAN( a ) Arc tangent
COS( a ) Cosine
EP( a ) Exponential (ea)
HCOS( a ) Hyperbolic cosine
HSIN( a ) Hyperbolic sine
HTAN( a ) Hyperbolic tangent
MN( a1 , a2 , ... ) Minimum value
MOD( a1 , a2 ) Integer remainder, same as AMOD except the arguments are
truncated to integer values first
MX( a1 , a2 , ... ) Maximum value
LN( a ) Natural logarithm
LOG( a ) Common logarithm
SIN( a ) Sine
40
1 VARIABLES
Function Description
SQRT( a ) Square root
TAN( a ) Tangent
41
ARENA VARIABLES USERS GUIDE
42
1 VARIABLES
o Assignable
* Entity number is an optional argument that permits referencing and assigning attributes of
remote entities.
43
ARENA VARIABLES USERS GUIDE
o Assignable
44
1 VARIABLES
ENTITY-TYPE VARIABLES
* Entity number is an optional argument that permits referencing and assigning attributes of
remote entities.
45
ARENA VARIABLES USERS GUIDE
o Assignable
46
1 VARIABLES
Continuous variables
LEVEL VARIABLES
RATE VARIABLES
o Assignable
47
ARENA VARIABLES USERS GUIDE
Conveyor variables
GENERAL
o Assignable
48
1 VARIABLES
Queue variables
GENERAL QUEUE VARIABLES
49
ARENA VARIABLES USERS GUIDE
Resource variables
GENERAL RESOURCE VARIABLES
Replication variables
o Assignable
50
1 VARIABLES
o Assignable
51
ARENA VARIABLES USERS GUIDE
COSTS VARIABLES
52
1 VARIABLES
o Assignable
53
ARENA VARIABLES USERS GUIDE
o Assignable
54
1 VARIABLES
55
ARENA VARIABLES USERS GUIDE
Transporter variables
GENERAL STATUS VARIABLES
o Assignable
56
1 VARIABLES
57
ARENA VARIABLES USERS GUIDE
58
1 VARIABLES
Miscellaneous variables
BLOCKAGE STATUS VARIABLE
EXPRESSIONS VARIABLES
FUNCTIONS VARIABLES
59
ARENA VARIABLES USERS GUIDE
PARAMETERS VARIABLES
o Assignable
60
1 VARIABLES
J INDEX VARIABLE
SET VARIABLES
o Assignable
61
ARENA VARIABLES USERS GUIDE
STATION VARIABLES
STORAGE VARIABLE
62
1 VARIABLES
STACK VARIABLES
OPERATIONPARAMETER VARIABLE
63
ARENA VARIABLES USERS GUIDE
Flow variables
TANK VARIABLES
REGULATOR VARIABLES
o Assignable
64
1 VARIABLES
SENSOR VARIABLES
o Assignable
65
2 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:
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 73.
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. For example:
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) + .
67
ARENA VARIABLES USERS 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 69 and Val function on page 70.
If an expression is evaluated and the data type of the value returned by the expression
is different than the expected data type, a Data type mismatch runtime error will
occur.
Comparing strings
Two strings may be compared in an expression using the standard logical operators:
68
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 72.
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, and so on) 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)
69
ARENA VARIABLES USERS GUIDE
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
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. Then an attempt is 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.
70
2 STRINGS IN ARENA
If none of the string is recognized as a numeric value, 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
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, 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 Result
StrCompare("A", "B") -1 (string1 is less than string2)
StrCompare("A", "A") 0 (string1 is equal to string2)
StrCompare("B", "A") 1 (string1 is greater than string2)
StrCompare("ABC", "abc", 1) 0 (string1 is equal to string2)
StrCompare("ABC", "abc") -1 (string1 is less than string2)
71
ARENA VARIABLES USERS GUIDE
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:
72
2 STRINGS IN ARENA
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:
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.
Examples:
73
ARENA VARIABLES USERS GUIDE
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.
Examples:
74
2 STRINGS IN ARENA
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:
75
Index
A CalDayOfWeek 19
CalDayOfYear 19
A attribute 2
Calendar dates and times 18
ACC 28
summary tables 51
Active entity number 9
Calendar variables 11
Activity Area variables 9
CalHour 19
Activity area variables
CalMinute 19
summary tables 46
CalMonth 18
AG 7
CalSecond 19
Animation
CalWeek 18
entity picture 2
CalYear 18
Animation attribute 2
CAVG 22
AQUE 14
CBATCH 23
AreaNVACost 10
CBATSIZ 23
AreaNVATime 9
CHALF 22
AreaOtherCost 10
Chr function 73
AreaOtherTime 9
CLA 13
AreaTotalCost 10
CMAX 22
AreaTotalTime 10
CMIN 22
AreaTranCost 10
CNVDST 14
AreaTranTime 9
CNUMBAT 23
AreaVACost 10
CO 33
AreaWaitCost 10
comparing Strings 68
AreaWaitTime 9
Construct number (NSYM) 2, 32
AreaVATime 9
Continuous variables 11
ATTR 8
Level variables 12
Attribute value 8
Rate variables 12
Attributes 1
Converting durations to the base time
ATTR function 8
units 20
general-purpose 2
summary table 52
summary table 43
converting Strings 68
Conveying entity variables
B summary table 48
Block number variable (NUMBLK) 32 Conveyor variables 12
Blockage status variable 31 conveying entities 13
building Strings 69 general 12
BUSY_RESource 17 Cost attributes variables 5
summary tables 44
C Cost variables 20
summary table 52
CalDateToBaseTime 19
Count value 22
CalDayOfMonth 19
77
ARENA VARIABLES USERS GUIDE
78
INDEX
79
ARENA VARIABLES USERS GUIDE
L Set
summary table 61
LASTINQ 14
Stack
LC 13
summary table 63
LDL 28
Station
LDX 28
summary table 62
LDZ 28
Storage
LEC 13
summary table 62
Len function 75
summary tables 59
LENZ 30
MLC 13
Level variables (continuous modeling) 12
MQUE 15
summary table 47
MR 15
LNKNUM 30
MREP 18
Logical operators 39
MSQ 34
LR 16
MT 27
LT 28
MZ 30
LTL 28
LTYP 30
LTZ 29 N
LX 30 Named level variable 12
NB 31
M NC 22
NDX 30
Math functions 40
NE 34
Math operators 39
NEA 13
MC 6, 22
NEC 14
MEMBER 34
Network variables (guided transporters) 29
MEMIDX 34
summary table 58
MG 8
NEXTINCAL 11
Mid function 74
NEXTX 30
MinutesToBaseTime 20
NG 8
Miscellaneous variables 31
NL 30
Blockage status
NMPAR 33
summary table 59
NQ 14
Expressions (user-defined)
NR 16
summary table 59
NREP 18
Functions
NS attribute 3
summary table 59
NSExpo 33
General-purpose
NSG 8
summary tables 60
NSQUE 15
J index
NSTO 36
summary table 61
NSYM 2, 32
Parameters
NSZT 29
summary table 60
NT 27
Resource cost
Number in queue 14
summary table 60
Number of grouped entities 8
80
INDEX
NUMBLK 32 RegulatorQtyAdded 38
NUMENT 9 RegulatorQtyRemoved 38
NUMMEM 34 RegulatorRate 38
NX 30 RegulatorState 38
NXB 30 RegulatorTank 38
NXE 30 Replication variables 18
NZ 30 ResBusyCost 17
ResIdleCost 18
O Resource cost variables 17
summary table 60
OperationParameter variables 63
Resource location 16
Operators 39
Resource variables 15
ORUNAVG 26
RESSEIZES 16
ORUNHALF 26
ResUseCost 18
ORUNMAX 26
RESUTIL 16
ORUNMIN 26
RTYP 16, 50
OVALUE 26
Output statistics variable 26
summary table 55 S
S array 12
P SAG 8
SAQUE 15
P 33
SchedValue 33
Parameter variables 33
Schedule variables 33
Parameters variables
SecondsToBaseTime 20
summary table 60
Sensor variables 38
PICTURE keyword/attribute 2
summary tables 65
Post-run statistics variable 26
SensorIsCovered 38
Post-run statistics variables
SensorLocation 38
summary table 55
SensorState 38
PREDECESSOR 15
SensorTank 38
Sequence index 3
Q Sequences attributes 3
Queue variables 14 Set variables 34
general 14 summary table 61
queued entities 14 SIMAN constructs variables 41
Queued entity variables Stack variables 36
summary table 49 summary table 63
STATE 16
R STATEVALUE 16
Rate Name 12 Station attribute 3
Rate variables (continuous modeling) 12 Station variables 34
summary table 47 summary table 62
Regulator variables 38 Statistics collection variables 21
summary tables 64 Counter statistics 22
RegulatorMaxRate 38 Frequencies statistics 24
81
ARENA VARIABLES USERS GUIDE
Output statistics 26 T
Post-run statistics 26
Table function value (TF) 32
Tally statistics 25
Tally statistics variables
Time-persistent statistics (Cstat) 22
summary table 55
Time-persistent statistics (Dstat) 23
Tally variables 25
warm up time 22
Tank variables 37
Steady state
summary tables 64
using NUMENT statistic 9
TankCapacity 37
StnNVACost 35
TankLevel 37
StnNVATime 35
TankNetRate 37
StnOtherCost 35
TankQtyAdded 37
StnOtherTime 35
TankQtyRemoved 37
StnTotalCost 35
TAVG 25
StnTotalTime 35
TAZ 29
StnTranCost 35
TBATCH 25
StnTranTime 35
TBATSIZ 26
StnVACost 35
TF 32
StnWaitCost 35
TFIN 19
StnWaitTime 35
THALF 25
StnVATime 35
Throughput variable
Storage variable 36
summary table 52
summary table 62
Throughput variables 20
Str function 69
Time attribute variables
StrCompare function 71
summary table 44
StrFormat function 72
Time-persistent statistics (Cstat) 22
Strings 67
summary table 53
building 69
Time-persistent statistics (Dstat) 23
comparing 68
summary table 54
converting 68
TMAX 25
SUCCESSOR 15
TMIN 25
Summary table of variables 43
TNOW 19
Activity area 46
TNUM 25
Attributes and entity-related 43
TNUMBAT 26
Continuous variables 47
Total.EntityCost 21
Conveyor variables 48
Total.NVACost 20
Date and Time 51
Total.OtherCost 21
Event calendar variables 47
Total.ResBusyCost 21
Flow 64
Total.ResIdleCost 21
Miscellaneous variables 59
Total.ResourceCost 21
Queue 49
Total.ResUseCost 21
Replication 50
Total.SystemCost 21
Resource variables 50
Total.Throughput 20
Statistics collection 53
Total.TranCost 21
System response 52
Total.VACost 20
Transporter 56
Total.WaitCost 21
System response variables 20
82
INDEX
83