## 8.14 Attributes and Variables

8.14.1 Attributes

To build any of the worksheet models so far has required a basic use of entity attributes but it is now pertinent to takes a closer look at this subject before extending our study to more complex examples.

Attributes are parameters which accompany an entity as it moves through the model. In ARENA there are two types :

General Purpose Attributes : Defined when required by the user and, of course, they can be used for any purpose. They are a convenient way of storing data on the entity (e.g. process time, customer type, size, weight etc.). Before they can be used they must be declared in an `ATTRIBUTES' element.

System Attributes : Every entity that is created has associated with it a standard set of attributes which have a specific meaning within ARENA. There are 6 of these in total and they are listed in table 8.YY

Table 8.Y: System Attributes

Attribute | Arguements | Description
Name | index1, index2 | General purpose entity attribute
A | Attribute number [,entity number] | General Purpose attribute
IS | [entity number] | Sequence set index
M | [entity number] | Station location
NS | [entity number] | Sequence set
PICTURE | [entity number] | Entity animation

All of these attributes can be assigned by the user and if not required for their ARENA purpose they can be treated as general purpose attributes but be careful in doing this if they are required by ARENA since strange consequences may follow ! The optional parameter [entity number] is used if you want to change the value from a remote location in the model. Again beware of doing this, it can lead to models very difficult to debug !

The function of these attributes will be introduced at the relevant points in this chapter but here we will just mention the general purpose attribute A. This is the type of attribute you have been using up until now but referencing it by name rather than number. Thus if your second attribute was known as process_time you could also refer to it as A(2). This is in some ways a `ghost' from earlier versions of SIMAN in which the only way to address attributes was using the indexed numerical form. It is usually better to name your general purpose attributes.

8.14.2 Variables

Variables are declared independently of entities and can be accessed by any entity at any point in the model. Again they fall into two types :

General Purpose Variables : Declared by the user for any purpose. They are a convenient way of storing model quantities which may be used at some stage in a decision statement. For example you may have a variable `Photocopy_costs' which records the accumulated costs of photocopying in the office and at some point in the model a branch statement which diverts jobs away from the photo copier when the costs exceed [sterling]3000. To use a general variable it must first be declared in a `VARIABLES' element.

System Variables : There is a very large collection of system variables in ARENA used to keep track of the many specialist and general activities which take place during model execution. Some of the more commonly used system variables are listed in appendix B but you should consult the ARENA manuals for a complete Listing. A few of the more common ones are reviewed here as examples.

Example 8.9

They current simulation time is stored in the system variable TNOW. Thus it is possible to include a `BRANCH' statement containing `IF TNOW > 25 ...... etc.'

NUMENT holds the number of active entities in the model

NQ(queuename) holds the number of entities in the queue `queuename' and LASTINQ(queuename) holds the last entity number in the queue.

VC(conveyername) holds the velocity of conveyer `conveyername'