EXAMPLES OF RUN TRACING

6.4 EXAMPLES OF RUN TRACING

This section illustrates trace reports produced by Arena in response to modeler TRACE commands. The examples demonstrate that the modeler can acquire and review extremely detailed information on any simulation run. The resultant TRACE reports list the temporal sequence of Arena's internal events and the actions performed by each event at its time of occurrence. These actions include assignment of variables and attributes, seizing and releasing of resources, and generally, the movement of Arena entities. Recall that Arena always tries to “move” entities through blocks as far as they can go before being “blocked” from further forward movement (e.g., by a DELAY block). In fact, following each event, Arena attempts to push entities forward, until none can advance in the model, at which point the simulation clock is advanced to the most imminent event time (recall Section 2.1), and its processing triggers another round of entity movements.

6.4.1 E XAMPLE :O PEN -E NDED T RACING

Panel 6.3 displays a portion of an open-ended history trace of a run produced by issuing the command SET TRACE * at time 0.

Model Testing and Debugging Facilities 115

Time: 0.0 Entity: 2 1 5$

CREATE

Entity Type set to Entity 1 Next creation scheduled at time 1.36794 Batch of 1 Entity 1 entities created

2 6$ ASSIGN Create 1.NumberOut set to 1.0 3 2$

QUEUE

Entity 2 sent to next block

4 SEIZE Tally Seize 1.Queue.WaitingTime recorded 0.0 Seized 1 unit(s) of resource Resource 1

5 10$ DELAY Delayed by 0.0 until time 0.0 6 1$

DELAY Delayed by 0.433114 until time 0.433114 Time: 0.433114 Entity: 2 7 4$

RELEASE Resource 1 available increased by 1 to 1 8 0$

ASSIGN Dispose 1.NumberOut set to 1.0 9 11$

DISPOSE

Disposing Entity 2

Time: 1.36794 Entity: 3 1 5$

CREATE

Entity Type set to Entity 1 Next creation scheduled at time 1.84734 Batch of 1 Entity 1 entities created

2 6$ ASSIGN Create 1.NumberOut set to 2.0 3 2$

QUEUE

Entity 3 sent to next block

4 SEIZE Tally Resource 1.Queue.WaitingTime recorded 0.0 Seized 1 unit(s) of resource Resource 1

5 10$ DELAY Delayed by 0.0 until time 1.36794 6 1$

DELAY Delayed by 1.36281 until time 2.73075

Panel 6.3 Trace produced by the command SET TRACE * .

An inspection of Panel 6.3 reveals that every line that contains a SIMAN block starts with an integer. That integer is an Arena-assigned block number used in TRACE reports. Finally, the actions occurring at each SIMAN block (on entity entry there) are listed in indented format.

116 Model Testing and Debugging Facilities

A walk-through of Panel 6.3 should clarify how the Run Controller displays a temporal trace of a model's run history. Starting at the first line, the sequence of trace events unfolds as follows:

At time 0.0, Entity 2 (of type ENTITY 1) is created at the CREATE block (this type name was assigned as a default by Arena, but the modeler can, of course, change it). The next entity (Entity 3) arrival is scheduled to occur at time 1.36794. Note that entities are created singly (in batches of size 1). Entity 2 next enters an ASSIGN block and triggers the assignment

CREATE1 :NUMBEROUT ¼1

where CREATE 1.NUMBEROUT is an Arena variable that keeps track of the number of entities entering the model at block CREATE 1. Arena collects this statistic automatically in order to produce entity statistics when the run ends.

Entity 2 then proceeds through the QUEUE, SEIZE, and DELAY blocks belonging to the Seize module. It enters the queue called Seize 1.Queue at the SEIZE block, and having recorded its waiting time there, it immediately seizes the resource called Resource 1. (Note that if Resource 1 were busy, then Entity 2 would wait in Seize 1. Queue until Resource 1 becomes free.) The DELAY block causes a delay of duration 0. The next DELAY block belongs to a Delay module and represents the elapsing of entity processing time. Entity 2 is delayed for processing a duration of 0.433114 time units. Note carefully that the simulation clock (system variable TNOW) has been set to 0.0 until this DELAY block. To see why, note that because the Resource 1 resource is initially idle, the just created Entity 2 manages to “push its way” through the block sequence until it is “detained” at this DELAY block for processing by Resource 1. Next, the simulation clock is advanced to TNOW ¼ 0.433114, and Entity 2 completes its processing at Resource 1 and releases this resource. It then enters an ASSIGN block where it increments by 1 the counter variable called Dispose 1.NumberOut. Finally, Entity 2 enters the DISPOSE block in which it is removed from the model. The simulation clock is next advanced to TNOW ¼ 1.36794 at which point the next arriving entity (Entity 3) is created in the CREATE block and enters the model. It then embarks on its own sojourn through the model.

6.4.2 E XAMPLE :T RACING S ELECTED B LOCKS

Panel 6.4 displays a portion of the history trace pertaining to blocks 1 through 4 only. This trace was produced by issuing the command SET TRACE BLOCKS 1..4 at time 0.

0.0>set trace blocks 1..4 0.0>go until 4 Time: 0.0 Entity: 2

1 5$ CREATE Entity Type set to Entity 1 Next creation scheduled at time 1.36794 Batch of 1 Entity 1 entities created

2 6$ ASSIGN Create 1.NumberOut set to 1.0

Model Testing and Debugging Facilities 117

3 1$ QUEUE Entity 2 sent to next block 4 SEIZE Tally Seize 1.Queue.WaitingTime recorded 0.0 Seized 1 unit(s) of resource Resource 1

Time: 1.36794 Entity: 3 1 5$

CREATE Entity Type set to Entity 1 Next creation scheduled at time 1.84734 Batch of 1 Entity 1 entities created

2 6$ ASSIGN Create 1.NumberOut set to 2.0 3 1$

QUEUE Entity 3 sent to next block 4 SEIZE Tally Seize 1.Queue.WaitingTime recorded 0.0 Seized 1 unit(s) of resource Resource 1

Panel 6.4 Trace produced by the command SET TRACE BLOCKS 1..4.

An examination of Panel 6.4 reveals that it starts with two user-issued commands (the first sets up a trace and the other specifies its duration), and the simulation time when they were issued. An inspection of the block numbers in Panel 6.4 verifies that only blocks 1, 2, 3, and 4 appear in the TRACE report; to wit, the first integer in each row is in the range 1 to 4 (this pattern continues in the extended trace). Thus, to produce this report, Arena has extracted only the relevant block information for inclusion in the report and discarded all other information. Such filtered traces are useful in focusing on the action in selected blocks, primarily for debugging purposes.

6.4.3 E XAMPLE :T RACING S ELECTED E NTITIES

Panel 6.5 displays a portion of the run history pertaining to Entity 2 only. This trace was produced by issuing the command SET TRACE ENTITY 2 at time 0.

0.0>set trace entity 2 *** Trace set on entity 2

0.0>go until 4 Time: 0.0 Entity: 2

1 5$ CREATE

Entity Type set to Entity 1 Next creation scheduled at time 1.36794 Batch of 1 Entity 1 entities created

2 6$ ASSIGN Create 1.NumberOut set to 1.0 3 1$

QUEUE

Entity 2 sent to next block

118 Model Testing and Debugging Facilities

Tally Resource 1.Queue.WaitingTime recorded 0.0 Seized 1 unit(s) of resource Resource 1

5 10$ DELAY Delayed by 0.0 until time 0.0 6 0$

DELAY Delayed by 0.541393 until time 0.541393 Time: 0.541393 Entity: 2 7 3$

RELEASE Resource 1 available increased by 1 to 1 8 4$

ASSIGN Dispose 1.NumberOut set to 1.0 9 11$

DISPOSE Tally Entity 1.TotalTime recorded 0.541393 Disposing entity 2

Break at time: 4.0

Panel 6.5 Trace produced by the command SET TRACE ENTITY 2.

An examination of Panel 6.5 reveals that the second line is a confirmation of the SET TRACE command in the first line. An inspection of the entity numbers in Panel 6.5 verifies that only Entity 2 appears there. Thus, to produce this report, Arena has extracted only the relevant entity information for inclusion in the report, and discarded all other information. Again, such filtered traces are useful in focusing on the history of

a particular entity through the system, primarily for debugging purposes.