From Support
Back to Model Library
- See also: How to read .MOD pages
Description
NESTLOOP.MOD models two nested do-loops for I=0,...,N and J=0,...,M. The model consists of three vertices: one to start the run and initialize N and M, one that has the two nested loops, and one that ends the run when the loops are finished.
State Variables
State Variables in NESTLOOP.MOD
Variable Name | Variable Description | Size | Type
|
I | Inner loop index (0 TO N) | 1 | Integer
|
J | Outer loop index (O TO M) | 1 | Integer
|
N | Upper limit on inner loop | 1 | Integer
|
M | Upper limit on outer loop | 1 | Integer
|
Vertices
Vertices in NESTLOOP.MOD
Vertex Name | Vertex Description | State Changes
|
INITL | Initialization of the loop limits | None
|
LOOP | Body of the nested loop | None
|
OVER | End of the looping operation | None
|
Initialization Conditions
Initialization Conditions in NESTLOOP.MOD
Variable | Description
|
N | Upper limit on inner loop
|
M | Upper limit on outer loop
|
Event Relationship Graph
English Translation
An English translation is a verbal description of a model, automatically generated by SIGMA.
The SIGMA Model, NESTLOOP.MOD, is a discrete event simulation.
It models TWO NESTED DO-LOOPS FOR I=0,...,N AND J=0,...,M.
I. STATE VARIABLE DEFINITIONS.
For this simulation, the following state variables are defined:
I: INNER LOOP INDEX (0 TO N) (integer valued)
J: OUTER LOOP INDEX (O TO M) (integer valued)
N: UPPER LIMIT ON INNER LOOP (integer valued)
M: UPPER LIMIT ON OUTER LOOP (integer valued)
II. EVENT DEFINITIONS.
Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
1. The INITL(N,M) event occurs when INITIALIZATION OF THE LOOP LIMITS.
Initial values for, N,M, are needed for each run.
After every occurrence of the INITL event:
Unconditionally, schedule the LOOP(I,J) event to occur without delay...
using the parameter value(s) of 0,0.
2. The LOOP(I,J) event occurs when BODY OF THE NESTED LOOP.
After every occurrence of the LOOP event:
If I<N and J<=M, then schedule the LOOP(I,J) event to occur in 1 time units...
using the parameter value(s) of I+1,J.
If I==N and J<M, then schedule the LOOP(I,J) event to occur in 1 time units...
using the parameter value(s) of 0,J+1.
If I==N and J==M, then schedule the OVER() event to occur without delay.
3. The OVER() event occurs when END OF THE LOOPING OPERATION.
No additional events are scheduled here.
Comments
Back to Model Library