'' 
'' COPYRIGHT (C) 1987, CACI, INC. - FEDERAL, LA JOLLA
''
''
'' Model: tv    TVs going through a check station and if they fail the test
''              go back to be adjusted. Demos use of resources and dynamic
''              statistics and icons.
''-----------------------------------------------------------------------


preamble

normally mode is undefined

processes include TV, GENERATOR, UPDATE.GRAPHS

dynamic graphic entities include TV

resources include INSPECTOR, ADJUSTOR

    accumulate INSPECTOR.UTILIZATION as the average of N.X.INSPECTOR

    define INSPECTOR.UTIL as a double variable

    accumulate INSPECTOR.QUEUE.LENGTH (0 to 10 by 1)
        as the histogram of N.Q.INSPECTOR

    accumulate ADJUSTOR.UTILIZATION as the average of N.X.ADJUSTOR

    define ADJUSTOR.UTIL as a double variable

    accumulate ADJUSTOR.QUEUE.LENGTH (0 to 10 by 1)
        as the histogram of N.Q.ADJUSTOR

display variables include INSPECTOR.UTIL, ADJUSTOR.UTIL

define INSPECTOR.X,
       INSPECTOR.Y,
       ADJUSTOR.X,
       ADJUSTOR.Y,
       ENTER.X,
       QUEUE.X,
       PASS.X,
       FAIL.Y,
       ADJUSTED.Y,
       TV.VELOCITY,
       TV.SIZE,
       MEAN.INTERARRIVAL.TIME,
       FAILURE.RATE,
       GRAPH.UPDATE.INTERVAL    as double variables

define STREAM as an integer variable

define PASSED.INSPECTION as an integer function
    define .FALSE   to mean 0
    define .TRUE    to mean 1

define TIME as a double function
    define .TO.ENTER            to mean 1
    define .TO.EXIT             to mean 2
    define .TO.INSPECT          to mean 3
    define .TO.ADJUST           to mean 4
    define .TO.GOTO.INSPECTION  to mean 5
    define .TO.GOTO.ADJUSTMENT  to mean 6
    define .TO.UPDATE.GRAPHS    to mean 7

end
