Wednesday, November 4, 2009

A Computer Program for Relative Location of Spherical Facilities

Jsun Yui Wong

The computer programn listed below is concerned with an extension of the assumption that "facilities have circular shapes, and that the distance between facilities is measured from center to center," Drezner (1980, p. 1375). In this paper the facilities are spheres of different sizes. For the following program for five facilities, the facility radii are 12.6156, 12.6156, 18.2818, 13.8197, and 14.9270. These radii are based on the rectangles of Heragu (2008, p. 220). Sums of pairs of radii are used in line 551 through line 589; from Heragu (2008), the flows are shown in line 1621 through line 1632 of the following program.

0 DEFSNG A-Z
3 DEFINT I,J,K
4 DIM X(466),A(466),L(466),K(466),P(466),B(466),S(466),J(466),HS(99)
6 DIM T(11,11,5),TZ(11,11),TL(33)
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
291 HS(1)=((X(1)-X(2))^2+(X(6)-X(7))^2+(X(11)-X(12))^2)^.5
292 HS(2)=((X(1)-X(3))^2+(X(6)-X(8))^2+(X(11)-X(13))^2)^.5
293 HS(3)=((X(1)-X(4))^2+(X(6)-X(9))^2+(X(11)-X(14))^2)^.5
294 HS(4)=((X(1)-X(5))^2+(X(6)-X(10))^2+(X(11)-X(15))^2)^.5
295 HS(5)=((X(2)-X(3))^2+(X(7)-X(8))^2+(X(12)-X(13))^2)^.5
296 HS(6)=((X(2)-X(4))^2+(X(7)-X(9))^2+(X(12)-X(14))^2)^.5
297 HS(7)=((X(2)-X(5))^2+(X(7)-X(10))^2+(X(12)-X(15))^2)^.5
298 HS(8)=((X(3)-X(4))^2+(X(8)-X(9))^2+(X(13)-X(14))^2)^.5
299 HS(9)=((X(3)-X(5))^2+(X(8)-X(10))^2+(X(13)-X(15))^2)^.5
300 HS(10)=((X(4)-X(5))^2+(X(9)-X(10))^2+(X(14)-X(15))^2)^.5
551 IF HS(1)-25.2312<-.00001 THEN HS(1)=999999!
553 IF HS(2)-30.8974<-.00001 THEN HS(2)=999999!
554 IF HS(3)-26.4353<-.00001 THEN HS(3)=999999!
555 IF HS(4)-27.5426<-.00001 THEN HS(4)=999999!
565 IF HS(5)-30.8974<-.00001 THEN HS(5)=999999!
568 IF HS(6)-26.4353<-.00001 THEN HS(6)=999999!
569 IF HS(7)-27.5426<-.00001 THEN HS(7)=999999!
584 IF HS(8)-32.1015<-.00001 THEN HS(8)=999999!
585 IF HS(9)-33.2088<-.00001 THEN HS(9)=999999!
589 IF HS(10)-28.7467<-.00001 THEN HS(10)=999999!
1621 PR1=-10*HS(1)-15*HS(2)-20*HS(3)-.01*HS(4)
1622 PR2=-30*HS(5)-35*HS(6)-10*HS(7)
1631 PR3=-10*HS(8)-20*HS(9)
1632 PR4=-15*HS(10)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1914 PRINT A(6),A(7),A(8),A(9),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ

One notes that the flow of .01 in line 1621 above is an artificial flow.

This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the best candidate solutions produced during the first ten hours of running are presented below. What immediately follows is a manual copy from the computer screen.

660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413

307.2313 324.6127 336.2557 325.9749 350.9761
887.4272 870.5788 898.0033 872.8292 867.5846
762.154 747.3267 755.9315 773.7556 760.2586
-4880.799 -29546

Interpreted in accordance with line 1912 through line 1919, the candidate solutions above were produced during the first ten hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.

References

Z. Drezner, "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).

S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.