Sunday, 19 March 2017

Simulation in GPSS

Objective: To study the simulation of single server window having the job arrival that can be given by the uniform distribution of 10±5. The service rate of the system is given as 8±4. Estimate the simulation for 480 time units.

This code will require the require pre knowledge of building blocks like
1.       Generate:
The syntax of generate block is given as
Generate A,B,C,D,E
Here A,B,C,D,E are operands
A = average value of uniform distribution
B = half-width of uniform distribution
C = time delay before first transaction is generated
D = maximum number of transactions generated
E = priority allocated to transactions

So on the basis of the data provided we can write it as
GENERATE 10,5



2.       As in the system the arrival may be queue so we may require to buffer job to do so we require Queue. This En-queue process is done by command Queue.
Syntax of the Queue is
QUEUE  A,B
Here A and B are the Operands
A = Name of the Queue
B= Number of Elements to be entered by default it is one.
3.       After the job has arrived the System it will occupy the processor and start its execution.
This is done by SEIZE command. This facility can be processor.
The Syntax will be
SEIZE A
A is the name of facility  

4.       The Execution of the Jobs starts and jobs is removed from the Queue
This de-queue process is given by the command DEPART
Syntax of the DEPART is

DEPART A,B
Here A and B are the Operands
A = Name of the Queue
B= Number of Elements to be entered by default it is one.
5.       The Execution  of the Job will be done at the processor and the time will advance according to the service time

The syntax of time advancement is given as
ADVANCE A,B
A = Average IAT
B= Half IAT


6.       After this job execution it is has to release the occupied resources.
This is done by RELEASE Command

 The Syntax will be

RELEASE A
A is the name of facility  


7.       Then we  Terminate the process Cycle by writing the Terminate Statement


TERMINATE A
Here is the number if value to decremented but in this case we will
Not decrease the count as it depends upon Timer.



So we have to define the timer also

The timer will consist of 2 statements
GENERATE and TERMINATE
Code snippet for the same can be written as
GENERATE 480
TERMINATE 1
Another Statement START can also be added to define the number of Runs.

The Final code for the problem is given below
GENERATE 10,8
QUEUE     JOB
SEIZE     PROC
DEPART    JOB
ADVANCE   8,4  
RELEASE   PROC
TERMINATE  
     


GENERATE  480
TERMINATE 1
START 1

No comments:

Post a Comment