routine INIT

define OFFSET as an integer variable
define PT     as a 2-dim real array


''call INIT.PC

let VXFORM.V = 1
call SETWORLD.R given -100, 100, -100, 100
call SETVIEW.R given 0, 32767, 0, 32767

let INSPECTOR.X = 22.5
let INSPECTOR.Y = 5
let ADJUSTOR.X = -22.5
let ADJUSTOR.Y = -52.5
let ENTER.X = -110
let QUEUE.X = 0
let PASS.X = 45
let FAIL.Y = -20
let ADJUSTED.Y = -27.5
let TV.VELOCITY = 30
let TV.SIZE = 15
let MEAN.INTERARRIVAL.TIME = 3.25
let FAILURE.RATE = .25

let GRAPH.UPDATE.INTERVAL = 5

let STREAM = 3

let TIMESCALE.V = 100

create each INSPECTOR(1)
let INSPECTOR = 1
let U.INSPECTOR = 1

create each ADJUSTOR(1)
let ADJUSTOR = 1
let U.ADJUSTOR = 1

let OFFSET = 12.5

reserve PT(*,*) as 2 by 4

let PT(1,1) = INSPECTOR.X - OFFSET
let PT(2,1) = INSPECTOR.Y - OFFSET
let PT(1,2) = INSPECTOR.X - OFFSET
let PT(2,2) = INSPECTOR.Y + OFFSET
let PT(1,3) = INSPECTOR.X + OFFSET
let PT(2,3) = INSPECTOR.Y + OFFSET
let PT(1,4) = INSPECTOR.X + OFFSET
let PT(2,4) = INSPECTOR.Y - OFFSET

call OPEN.SEG.R
call GPRIORITY.R(SEGID.V, 0)
call FILLCOLOR.R(205)
call TEXTCOLOR.R(205)
call TEXTSIZE.R(600)
call FILLAREA.R(4, PT(*,*))
call TEXTALIGN.R(1, 3)
call WGTEXT.R("INSPECTION", INSPECTOR.X, INSPECTOR.Y + OFFSET)
call TEXTALIGN.R(1, 4)
call WGTEXT.R("STATION", INSPECTOR.X, INSPECTOR.Y - OFFSET)
call CLOSE.SEG.R

let PT(1,1) = ADJUSTOR.X - OFFSET
let PT(2,1) = ADJUSTOR.Y - OFFSET
let PT(1,2) = ADJUSTOR.X - OFFSET
let PT(2,2) = ADJUSTOR.Y + OFFSET
let PT(1,3) = ADJUSTOR.X + OFFSET
let PT(2,3) = ADJUSTOR.Y + OFFSET
let PT(1,4) = ADJUSTOR.X + OFFSET
let PT(2,4) = ADJUSTOR.Y - OFFSET

call OPEN.SEG.R
call GPRIORITY.R(SEGID.V, 0)
call FILLCOLOR.R(140)
call TEXTCOLOR.R(140)
call TEXTSIZE.R(600)
call FILLAREA.R(4, PT(*,*))
call TEXTALIGN.R(1, 3)
call WGTEXT.R("ADJUSTMENT", ADJUSTOR.X, ADJUSTOR.Y + OFFSET)
call TEXTALIGN.R(1, 4)
call WGTEXT.R("STATION", ADJUSTOR.X, ADJUSTOR.Y - OFFSET)
call CLOSE.SEG.R

release PT(*,*)

call OPEN.SEG.R
call GPRIORITY.R(SEGID.V, 1)
call TEXTALIGN.R(1, 0)
call TEXTCOLOR.R(9)
call TEXTSIZE.R(1000)
call WGTEXT.R("TV INSPECTION", -50, INSPECTOR.Y + 22.5)
call CLOSE.SEG.R

show INSPECTOR.UTIL with "iutil.grf"
show ADJUSTOR.UTIL with "autil.grf"

show histogram INSPECTOR.QUEUE.LENGTH with "iqueue.grf"
show histogram ADJUSTOR.QUEUE.LENGTH with "aqueue.grf"

end
