    GPSS/H MS-DOS STUDENT/DEMO RELEASE 2.0 (OV079)     28 Mar 2000   22:05:10     FILE: g8.gps

    LINE# STMT#  IF DO  BLOCK#  *LOC	OPERATION	A,B,C,D,E,F,G	COMMENTS  
 
        1     1                  
        2     2                 *Origin: System simulation, Figure 12-9/10-7
        3     3                 *Author: G. Gordon
        4     4                 *Description: Simulation of a telephone system
        5     5                  
        6     6                        SIMULATE
        7     7                  
        8     8                 *
        9     9                 *      GPSS/H Block Section
       10    10                 *
       11    11                  
       12    12                 *
       13    13                 *      SIMULATION OF A TELEPHONE SYSTEM - MODEL 2 (president line)
       14    14                 *
       15    15                 POISS  FUNCTION  RN1,C24              Function for i/a interval (Poisson)
       16    16                 0.0,0.0/0.1,0.104/0.2,0.222/0.3,0.355/0.4,0.509/0.5,0.69/
       17    17                 0.6,0.915/0.7,1.2/0.75,1.38/0.8,1.6/0.84,1.83/0.88,7.12/
       18    18                 0.9,2.3/0.92,2.52/0.94,2.81/0.95,2.99/0.96,3.2/0.97,3.5/
       19    19                 0.98,3.9/0.99,4.6/0.995,5.3/0.998,6.2/0.999,7/0.9997,8
       20    20                  
       21    21                 *      The phone process
       22    22                  
       23    23              1         GENERATE  12,FN$POISS,,,,2PH   Create calls
       24    24              2         TEST G    V$FREELN,2,ABND      Test if system is full
       25    25              3  ASN1   ASSIGN    ORIG,V$LINE,PH       Pick origin line
       26    26              4         GATE LR   PH$ORIG,ASN1         Test for busy
       27    27              5  ASN2   ASSIGN    DEST,V$LINE,PH       Pick destination line
       28    28              6         TEST NE   PH$ORIG,PH$DEST,ASN2 Retry if destination = origin
       29    29              7         LOGIC S   PH$ORIG              Make origin busy
       30    30              8         TRANSFER  BOTH,,BLKD           Try for link
       31    31              9  GETL   ENTER     LNKS                 Get link
       32    32             10         GATE LR   PH$DEST,BUSY         Test for busy
       33    33             11         LOGIC S   PH$DEST              Make destination busy
       34    34             12         ADVANCE   120,FN$POISS         Talk
       35    35             13         LOGIC R   PH$ORIG              Origin hangs up
       36    36             14         LOGIC R   PH$DEST              Dest. hangs up
       37    37             15         LEAVE     LNKS                 Free link
       38    38             16  CKCH   TEST G    CH$WAIT,0,TERM       Test if calls are waiting
       39    39             17         GATE LR   1,GETF               See if line 1 is free
       40    40             18         UNLINK    WAIT,GETL,1,DEST$PH,1,GETF Connect call to 1
       41    41             19  TERM   TERMINATE 1
       42    42             20  GETF   UNLINK    WAIT,GETL,1          Connect first waiting call
       43    43             21         TRANSFER  ,TERM
       44    44                  
       45    45             22  ABND   TERMINATE                      Abandon call
       46    46                  
       47    47             23  BLKD   LINK      WAIT,ORIG$PH         Link in order of call origin
       48    48                  
       49    49             24  BUSY   LOGIC R   PH$ORIG              Caller hangs up
       50    50             25         LEAVE     LNKS                 Free link
       51    51             26         TRANSFER  ,CKCH                Go to test for waiting calls
       52    52                  
       53    53                 LNKS   STORAGE   10                   No. of links
       54    54                  
       55    55                 LINE   VARIABLE  XH$NOLINES*RN1/1000+1        Pick a line
       56    56                 FREELN VARIABLE  XH$NOLINES-2*S$LNKS-CH$WAIT  Count no. of free lines

    GPSS/H MS-DOS STUDENT/DEMO RELEASE 2.0 (OV079)     28 Mar 2000   22:05:10     FILE: g8.gps

    LINE# STMT#  IF DO  BLOCK#  *LOC	OPERATION	A,B,C,D,E,F,G	COMMENTS  
 
       57    57                  
       58    58                  
       59    59                 *      The clock process
       60    60                  
       61    61             27         GENERATE  60            1 clock tick every minute 
       62    62             28         TERMINATE 1
       63    63                  
       64    64                 *
       65    65                 *      GPSS/H Control Statements
       66    66                 *
       67    67                        INITIAL   XH$NOLINES,50 Set no. of lines
       68    68                        START     10,NP         Initialise (10 minutes)
       69    69                        RESET                   Wipe out statistics
       70    70                        START     600           Main run (10 hours)
       71    71                  
       72    72                        END 

ENTITY DICTIONARY (IN ASCENDING ORDER BY ENTITY NUMBER; "*" => VALUE CONFLICT.)

         Storages: 1=LNKS

   Logic Switches: 1

        Functions: 1=POISS

     (F)variables: 1=FREELN        2=LINE

 Halfword Savexes: 1=NOLINES

      User Chains: 1=WAIT

   Halfword Parms: 1=ORIG          2=DEST

   Random Numbers: 1

SYMBOL   VALUE   EQU DEFNS  CONTEXT      REFERENCES BY STATEMENT NUMBER
 
ABND        22          45  Block           24
ASN1         3          25  Block           26
ASN2         5          27  Block           28
BLKD        23          47  Block           30
BUSY        24          49  Block           32
CKCH        16          38  Block           51
GETF        20          42  Block           39    40
GETL         9          31  Block           40    42
TERM        19          41  Block           38    43
 
LNKS         1          53  Storage         31    37    50    56
 
1            1              Logic Switch    39
 
POISS        1          15  Function        23    34
 
FREELN       1          56  (F)variable     24
LINE         2          55  (F)variable     25    27
 
NOLINES      1              Halfword Svx    55    56    67
 
WAIT         1              User Chain      38    40    42    47    56
 
DEST         2              Halfword Par    27    28    32    33    36    40
ORIG         1              Halfword Par    25    26    28    29    35    47    49
 
1            1              Random Nmbr     15    55



STORAGE REQUIREMENTS (BYTES)

COMPILED CODE:     2060
COMPILED DATA:      680
MISCELLANEOUS:        0
ENTITIES:          1204
COMMON:           10000
-----------------------
TOTAL:            13944



Simulation begins.

RELATIVE CLOCK: 7068.8547   ABSOLUTE CLOCK: 7297.6443



BLOCK CURRENT     TOTAL  BLOCK CURRENT     TOTAL  BLOCK CURRENT     TOTAL  
1                   482  11                  341  21                   96 
2                   482  12          9       341  ABND                  0 
ASN1                707  13                  341  BLKD                 98 
4                   707  14                  341  BUSY                141 
ASN2                488  15                  341  25                  141 
6                   488  CKCH                482  26                  141 
7                   482  17                   98  27                  118 
8                   482  18                   72  28                  118 
GETL                482  TERM                482 
10                  482  GETF        1        96 



          --AVG-UTIL-DURING--                                                                                          
 STORAGE  TOTAL  AVAIL  UNAVL     ENTRIES    AVERAGE   CURRENT  PERCENT    CAPACITY     AVERAGE     CURRENT     MAXIMUM
           TIME   TIME   TIME               TIME/UNIT   STATUS   AVAIL                 CONTENTS    CONTENTS    CONTENTS
    LNKS  0.735                       491     105.785    AVAIL   100.0           10       7.348           9          10



USER CHAIN   ENTRIES    AVERAGE      AVERAGE     CURRENT     MAXIMUM
                       TIME/XACT    CONTENTS    CONTENTS    CONTENTS
    WAIT         103      34.906       0.509           5           9 



THE FOLLOWING LOGIC SWITCHES ARE SET (ON):
 
        3         4         5         6         8        11        14        16        17        19        20        22        32
       34        36        37        41        42        43        44        45        46        48        49



NON-ZERO HALFWORD SAVEVALUES:  (NAME : VALUE)

 NOLINES:          50



  RANDOM    ANTITHETIC     INITIAL     CURRENT      SAMPLE   CHI-SQUARE
  STREAM      VARIATES    POSITION    POSITION       COUNT   UNIFORMITY
       1           OFF      100087      102105        2018      0.44



STATUS OF COMMON STORAGE

    8144 BYTES AVAILABLE
    1856 IN USE
    2240 USED (MAX)

Simulation terminated.  Absolute Clock: 7297.6443



Total Block Executions: 9389

Blocks / second:        187780

Microseconds / Block:   5.33



Elapsed Time Used (SEC)
 
PASS1:           0.05
LOAD/CTRL:       0.17
EXECUTION:       0.05
---------------------
TOTAL:           0.27
