RMULT 94521 Upbarge FUNCTION X$Upcount,D6 1,.967/2,.767/3,.767/4,.767/5,.767/6,.767 Downbarge FUNCTION X$Downcount,D6 1,.967/2,.767/3,.767/4,.767/5,.767/6,.767 Upq QTABLE Upq,.25,.25,20 Downq QTABLE Dnq,.25,.25,20 Upcount TABLE X$Upcount,2,2,20 Dncount TABLE X$Downcount,2,2,20 INITIAL X$Uplimit,6 INITIAL X$Downlimit,6 GENERATE 1.67,.5,.67 QUEUE Upq GATE LR Lock SEIZE Lock SAVEVALUE Upcount+,1 DEPART Upq ADVANCE FN$Upbarge TEST GE X$Uplimit,X$Upcount,Swh1 TEST NE Q$Upq,0,Swh1 RELEASE Lock TERMINATE Swh1 LOGIC S Lock RELEASE Lock TABULATE Upcount SAVEVALUE Upcount,0 TERMINATE GENERATE 1.67,.5,1 QUEUE Dnq GATE LS Lock SEIZE Lock SAVEVALUE Downcount+,1 DEPART Dnq ADVANCE FN$Downbarge TEST GE X$Downlimit,X$Downcount,Swh2 TEST NE Q$Dnq,0,Swh2 RELEASE Lock TERMINATE Swh2 LOGIC R Lock RELEASE Lock TABULATE Dncount