Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/pert.tuk
There are 2 other files named pert.tuk in the archive. Click here to see a list.
10' NAME--PERT
20'
30' DESCRIPTION--NETWORK ANALYSIS FOR PERT TIME
40'
50' SOURCE--UNKNOWN
60'
70' INSTRUCTIONS
72     REM     THIS PROGRAM ANALYZES A PERT NETWORK, AND FOR EACH
74  
76     REM     EVENT IN THE NETWORK THE PROGRAM WILL DETERMINE THE
78  
80     REM     FOLLOWING VARIABLES;
82   
84     REM       1)  TE - THE EARLIEST EXPECTED TIME OF COMPLETION
86     REM              OF THE EVENT WITHIN THE NETWORK.
88  
90     REM       2)  V - THE VARIANCE ASSOCIATED WITH THE TE OF
92     REM             THE EVENT WITHIN THE NETWORK.
94 
96     REM       3)  TL - THE LATEST ALLOWABLE TIME FOR THE COMPLETION
98     REM             OF THE EVENT WITHIN THE NETWORK WITHOUT CHANGING
100    REM            THE TE OF THE FINAL EVENT.
102 
104    REM       4)  SLACK - TL-TE.
106 
108 
110    REM     THE ANALYSIS IS ADOPTED FROM THE PROGRAM AS SET FORTH
112    REM     ON PAGES 189-211, IN MC MILLAN AND GONZALES.
114 
116    REM     IN THIS PROGRAM NO EVENT CAN HAVE MORE THAN TWO
118    REM     IMMEDIATE PREDECESSOR EVENTS AND TWO IMMEDIATE
120    REM     SUCCESSOR EVENTS.  TO USE THIS PROGRAM WITH MORE
122    REM     COMPLEX NETWORKS, ENTER A 'DUMMY' EVENT OF
124    REM     ZERO TIME FOR COMPLETION AND ZERO VARIANCE.  FOR
126    REM     EXAMPLE;  IF EVENTS 1, 2, AND 3 PRECEED EVENT 5
128    REM     THEN ENTER A 'DUMMY' EVENT 4, OF ZERO (0) TIME FOR
130    REM     COMPLETION AND ZERO (0) VARIANCE, SUCH THAT EVENTS
132    REM     1 AND 2, OR 1 AND 3, OR 2 AND 3 PRECEED EVENT 4.
134    REM     THEN EVENT 5 WILL HAVE ONLY TWO PRECEEDING EVENTS AS
136    REM     ALLOWED BY THE PROGRAM. ( I.E. EVENT 5 WILL BE PRECEEDED
138    REM     BY 1 AND 4, OR 2 AND 4, OR 3 AND 4 )
140 
142 
144    REM     BEGINNING IN LINE 2000 ENTER THE DATA.  FIRST ENTER
146    REM     T, THE TOTAL NUMBER OF EVENTS IN THE NETWORK.
148    REM     THEN, BEGINNING WITH THE FINAL EVENT AS NUMBER ONE,
150    REM     ( 1 ) ENTER THE FOLLOWING DATA IN, IN ORDER ;
152 
154    REM     1) THE NUMBER OF THE EVENT'S FIRST IMMEDIATE
156    REM        PREDECESSOR.
158 
160    REM     2) THE T(E) ASSOCIATED WITH THE EVENT'S FIRST
162    REM        IMMEDIATE PREDECESSOR.
164 
166    REM     3) THE VARIANCE ASSOCIATED WITH THE EVENT'S
168    REM        FIRST IMMEDIATE PREDECESSOR.
170 
172    REM     4) THE NUMBER OF THE EVENT'S SECOND IMMDEIATE
174    REM        PREDECESSOR. IF NONE, ENTER ZERO.
176 
178    REM     5) THE T(E) ASSOCIATED WITH THE EVENT'S SECOND
180    REM        IMMEDIATE PREDECSSOR. IF NONE, ENTER ZERO.
182 
184    REM     6) THE VARIANCE ASSOCIATED WITH THE EVENT'S SECOND
186    REM        IMMEDIATE PREDECESSOR.  IF NONE ENTER ZERO.
188 
190    REM     7) THE TE OF THE EVENT, WHERE KNOWN.
192    REM        IF UNKNOWN, ENTER ZERO.
194 
196    REM     8) THE VARIANCE ASSOCIATED WITH THE EVENT, WHERE KNOWN.
198    REM        IF UNKNOWN, ENTER ZERO.
200 
202    REM     THE LAST EVENT MUST BE LABELED 1, THE OTHER EVENTS
204    REM     NEED NOT HAVE ANY ORDER.  REMEMBER WHEN ENTERING
206    REM     THE DATA, THAT YOU ENTER T, THE 8 PIECES OF DATA
208    REM     FOR EVENT 1, THEN 8 FOR EVENT 2, THE 8 FOR EVENT 3 ETC.
210 
212 
214    REM     T(E) = THE MEAN TIME REQUIRED FOR THE COMPLETION OF
216    REM     THE EVENT'S IMMEDIATE PREDECESSOR.  
218    REM     T(E) IS DEFINED AS;  T(E) = ( A + 4*M + B )/6, WHERE
220 
222    REM     A - MOST OPTOMISTIC TIME FOR COMPLETION
224    REM     B - MOST PESSEMISTIC TIME FOR COMPLETION
226    REM     M - MOST LIKELY TIME FOR COMPLETION
228 
230    REM     THE VARIANCE ASSOCIATED WITH THE COMPLETION OF THE
232    REM     EVENT'S IMMEDIATE PREDECESSOR  IS DEFINED AS
234    REM     VARIANCE = V = ((B-A)/6)^2, WHERE A AND B ARE DEFINED
236    REM     ABOVE.
238  
240  
242    REM     AT LEAST ONE EVENT IN THE NETWORK MUST HAVE ITS
244    REM     EARLIEST COMPLETION TIME SPECIFIED ( I.E. AT LEAST
246    REM     ONE EVENT'S TE MUST BE KNOWN)
248    REM     IF HOWEVER, NO EVENT HAS A SPECIFIED TE, LET THE
250    REM     THE TE OF THE INITIAL EVENT IN THE NETWORK BE
252    REM     SPECIFIED AS ONE, ( 1 ).  THUS, THE INITIAL EVENT IN
254    REM     THE NETWORK WOULD HAVE IN ITS SEVENTH DATA LOCATION
256    REM     A ONE, INSTEAD OF A ZERO.  ( I.E. ASSUME EVENT NUMER
258    REM     9 IS THIS FIRST EVENT IN THE NETWORK AND STARTS AT 
260    REM     TIME ZERO, ITS DATA FORM WOULD LOOK LIKE
262    REM     XXXX DATA ------0-, HOWEVER, FOR THE PROGRAM TO 
264    REM     OPERATE THE EVENT WOULD HAVE TO BE ASSIGNED AN
266    REM     ARBITRARY TE, SAY 1, ITS CORRECT DATA STATEMENT
268    REM     WOULD TAKE THE FORM,  XXXX DATA ------1-.
270 
272 
274 
276    REM     DON'T FORGET TO ENTER 'T', THE NUMBER OF EVENTS
278    REM     IN THE NETWORK. 
280    REM     EACH EVENT IN THE NETWORK MUST HAVE 8 PIECES OF DATA
282    REM     ENTERED FOR IT.
284 
286    REM     IF THERE ARE MORE THAN TEN EVENTS IN THE NETWORK
288    REM     ENTER A DIM STATEMENT IN LINE 610 SUCH THAT E(T,13),
290    REM     P(T), AND S(T) ARE DIMENSIONED, WHERE T= NUMBER OF EVENTS.
292    REM    
300'
310' THIS PROGRAM WAS WRITTEN FOR STUDENT USE AT AMOS TUCK SCHOOL
320' OF HANOVER, N.H. WHICH DOES NOT ASSUME RESPONSIBILITY FOR ITS
330' ACCURACY.
340'
350' * * * * * * * * * * * MAIN PROGRAM * * * * * * * * * * *
360'
600 READ T
610 DIME(21,13),P(21),S(21)
620 FOR N= 1 TO T
630  FOR I= 1 TO 8
640   READ E(N,I)
650  NEXT I
660  FOR I= 9 TO 13
670   LET E(N,I) = 0
680  NEXT I
690 NEXT N
695 
700 
710 
720  REM FIND TE
730 
740 FOR I= 1 TO T
750  LET P(I) = 0
760 NEXT I
770 LET I = 1
780 LET P(1) = 1
790 LET N = 1
800 LET N = E(N,1)
810 LET I = I + 1
820 LET P(I) = N
830 IF E(N,7) = 0 THEN 800
840 LET I = I - 1
850 IF I = 0 THEN 1250
860 LET N = P(I)
870 IF S(N) = 2 THEN 1060
880 IF E(N,4)<> 0 THEN 920
890 LET E(N,7) = E(N,2) + E(P(I+1),7)
900 LET E(N,8) =  E(N,3) + E(P(I+1),8)
910 GO TO 840
920 LET A = E(P(I+1),7) + E(N,2)
930 LET F = E(P(I+1),8) + E(N,3)
940 LET N = E(N,4)
950 LET I = I + 1
960 LET P(I) = N
970 IF E(N,7) <> 0 THEN 1000
980 LET S(P(I-1)) = 2
990 GO TO 800
1000 LET I = I - 1
1010 IF I = 0 THEN 1120
1020 LET N=P(I)
1030 LET B = E(P(I+1),7) + E(N,5)
1040 LET G = E(P(I+1),8) + E(N,6)
1050 GO TO 1140
1060 LET B = E(P(I+1),7) + E(N,5)
1070 LET G = E(P(I+1),8) + E(N,6)
1080 LET N = E(N,1)
1090 LET C = E(N,7)
1100 LET H = E(N,8)
1110 LET N = P(I)
1120 LET A = C + E(N,2)
1130 LET F = H + E(N,3)
1140 IF A > B THEN 1180
1150 LET E(N,7) = B
1160 LET E(N,8) = G
1170 GO TO 840
1180 LET E(N,7) = A
1190 LET E(N,8) = F
1200 GO TO 840
1210 
1220 
1230  REM  FIND SUCCESSOR EVENTS AND RECORD TE'S
1240 
1250 FOR I = 1 TO T
1260  LET N = E(I,1)
1270  IF N = 0 THEN 1340
1280  IF E(N,9) <> 0 THEN 1320
1290  LET E(N,9) = I
1300  LET E(N,10) = E(I,2)
1310  GO TO 1340
1320  LET E(N,11) = I
1330  LET E(N,12) = E(I,2)
1340  LET N = E(I,4)
1350  IF N = 0 THEN 1420
1360  IF E(N,9) <> 0 THEN 1400
1370  LET E(N,9) = I
1380  LET E(N,10) = E(I,5)
1390  GO TO 1420 
1400  LET E(N,11) = I
1410  LET E(N,12) = E(I,5)
1420 NEXT I
1430 
1440  
1450  REM  FIND TL
1460 
1470 LET E(1,13) = E(1,7)
1480 FOR K= 1 TO T
1490  IF E(K,13) = 0 THEN 1520
1500 NEXT K
1510 GO TO 1810
1520 LET N = K
1530 LET I = 1
1540 LET P(1) = N
1550 IF E(N,13) <> 0 THEN 1690
1560 LET A = E(N,9)
1570 IF E(A,13) = 0 THEN 1730
1580 LET B = E(N,11)
1590 IF B = 0 THEN 1680
1600 IF E(B,13) = 0 THEN 1770
1610 LET T1 = E(A,13) - E(N,10)
1620 LET T2 = E(B,13) - E(N,12)
1630 IF T1 < T2 THEN 1660
1640 LET E(N,13) = T2
1650 GO TO 1690
1660 LET E(N,13) = E(A,13) - E(N,10)
1670 IF I = 1 THEN 1480
1680 LET E(N,13) = E(A,13) - E(N,10)
1690 IF I = 1 THEN 1480
1700 LET I = I - 1
1710 LET N = P(I)
1720 GO TO 1550
1730 LET N = A
1740 LET I = I + 1
1750 LET P(I) = N
1760 GO TO 1550
1770 LET N = B
1780 LET I = I + 1
1790 LET P(I) = N
1800 GO TO 1550
1810 
1820 
1830  REM PRINT RESULTS
1840 
1850 PRINT "EVENT NUMBER","TE","V","TL","TOTAL SLACK"
1855 PRINT "----- ------","--","-","--","----- -----"
1860 PRINT
1870 FOR N = T TO 1 STEP -1
1880  PRINT N,E(N,7),E(N,8),E(N,13),E(N,13)-E(N,7)
1890 NEXT N
1900 
1910 
2000 DATA 21
2001 DATA 2,4,1.77,3,8,0,0,0
2002 DATA 4,0,0,5,10,4,0,0
2003 DATA 9,0,0,0,0,0,0,0
2004 DATA 6,6,.11,0,0,0,0,0
2005 DATA 9,0,0,0,0,0,0,0
2006 DATA 7,12,.11,8,10,.44,0,0
2007 DATA 10,24,21.77,0,0,0,0 ,0
2008 DATA 11,20,5.44,14,0,0,0,0
2009 DATA 7,12,.11,8,10,.44,0,0
2010 DATA 15,0,0,16,30,44.44,0,0
2011 DATA 15,0,0,16,30,44.44,0,0
2012 DATA 21,0,0,0,0,0,0,0
2013 DATA 20,40,177.59,0,0,0,0,0
2014 DATA 13,10,2.77,12,28,75.17,0,0
2015DATA  20,40,177.59,0,0,0,0,0
2016 DATA 17,8,1.77,0,0,0,0,0
2017 DATA 18,20,.44,0,0,0,0,0
2018 DATA 19,10,0,0,0,0,0,0
2019 DATA 0,0,0,0,0,0,1,0
2020 DATA 21,0,0,0,0,0,0,0
2021 DATA 19,10,0,0,0,0,0,0
9999 END