Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Automatons/DLA

!AWJan92/Goodies/ArcAut/Automatons/DLA

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Automatons/DLA
Read OK:
File size: 0925 bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  DLA

  This is an interesting automaton. It simulates the physical process known
  as diffusion limited aggregation. An example screen of a typical resultant
  object, known as a dendrite, is included in the screens directory, disc
  space permitting; to view it run the automaton with a window 256x256, click
  menu, select the load option & enter the name 'den1'. The process of DLA
  works as follows. Take an initial seed, in this case a point & introduce
  some randomly moving particles (as in the Brownian Motion automaton). Allow
  the particles to wander until one comes close to the seed; as soon as this
  happens, the particle concerned 'adheres' to the seed & becomes a part of
  it. This results in a gradually growing stable structure, the shape of
  which should be quite familiar - similar processes frequently occur in
  nature; for example the way that frost spreads across a window or mould
  grows on a wall. Differing degrees of stringiness/clumping can be produced
  by altering the initial density of wandering particles; this is controlled
  by the final parameter in the call to PROCsoup below. You might also like
  to try using a more complex initial seed, such as a line or circle. The
  Margolus neighbourhood is of course used, to enable the easy programming
  required to make the particles wander. A window of 50x50 will very quickly
  give you a good idea of how the process works; a full screen version
  (256x256), with the initial density below of 20 percent will take about
  half an hour until all particles are caught.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap on
  30*SetEval neig margolus
  40*SetEval rndb -1
  50*SetEval i 1
  60*SetEval t 249
  70*SetEval b 17
  80ENDPROC

SCREEN*

  10DEF PROCdo
  20c%=FNacol(45)
  30PROCsoup(255,1,.2)
  40GCOL c%AND63 TINT c%:POINT 0,0
  50ENDPROC

CODE*

( READ_NEIG
  CELL IF (CELL 255 <>  IF (CELL ==))
  1 254 MCOUNT_NEIG IF (CELL IF (
                 OPP IF (OPP 255 <> IF (OPP <i> - DUP <b> >= IF (==) <t> ==))
                  CW IF ( CW 255 <> IF ( CW <i> - DUP <b> >= IF (==) <t> ==))
                                        CCW <i> - DUP <b> >= IF (==) <t> == )
                                                                    CELL == )
              2RNDB IF (CCW  ==) CW  ==                                     )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 44 4c  |AUTOMATON*..  DL|
00000010  41 0a 0a 20 20 54 68 69  73 20 69 73 20 61 6e 20  |A..  This is an |
00000020  69 6e 74 65 72 65 73 74  69 6e 67 20 61 75 74 6f  |interesting auto|
00000030  6d 61 74 6f 6e 2e 20 49  74 20 73 69 6d 75 6c 61  |maton. It simula|
00000040  74 65 73 20 74 68 65 20  70 68 79 73 69 63 61 6c  |tes the physical|
00000050  20 70 72 6f 63 65 73 73  20 6b 6e 6f 77 6e 0a 20  | process known. |
00000060  20 61 73 20 64 69 66 66  75 73 69 6f 6e 20 6c 69  | as diffusion li|
00000070  6d 69 74 65 64 20 61 67  67 72 65 67 61 74 69 6f  |mited aggregatio|
00000080  6e 2e 20 41 6e 20 65 78  61 6d 70 6c 65 20 73 63  |n. An example sc|
00000090  72 65 65 6e 20 6f 66 20  61 20 74 79 70 69 63 61  |reen of a typica|
000000a0  6c 20 72 65 73 75 6c 74  61 6e 74 0a 20 20 6f 62  |l resultant.  ob|
000000b0  6a 65 63 74 2c 20 6b 6e  6f 77 6e 20 61 73 20 61  |ject, known as a|
000000c0  20 64 65 6e 64 72 69 74  65 2c 20 69 73 20 69 6e  | dendrite, is in|
000000d0  63 6c 75 64 65 64 20 69  6e 20 74 68 65 20 73 63  |cluded in the sc|
000000e0  72 65 65 6e 73 20 64 69  72 65 63 74 6f 72 79 2c  |reens directory,|
000000f0  20 64 69 73 63 0a 20 20  73 70 61 63 65 20 70 65  | disc.  space pe|
00000100  72 6d 69 74 74 69 6e 67  3b 20 74 6f 20 76 69 65  |rmitting; to vie|
00000110  77 20 69 74 20 72 75 6e  20 74 68 65 20 61 75 74  |w it run the aut|
00000120  6f 6d 61 74 6f 6e 20 77  69 74 68 20 61 20 77 69  |omaton with a wi|
00000130  6e 64 6f 77 20 32 35 36  78 32 35 36 2c 20 63 6c  |ndow 256x256, cl|
00000140  69 63 6b 0a 20 20 6d 65  6e 75 2c 20 73 65 6c 65  |ick.  menu, sele|
00000150  63 74 20 74 68 65 20 6c  6f 61 64 20 6f 70 74 69  |ct the load opti|
00000160  6f 6e 20 26 20 65 6e 74  65 72 20 74 68 65 20 6e  |on & enter the n|
00000170  61 6d 65 20 27 64 65 6e  31 27 2e 20 54 68 65 20  |ame 'den1'. The |
00000180  70 72 6f 63 65 73 73 20  6f 66 20 44 4c 41 0a 20  |process of DLA. |
00000190  20 77 6f 72 6b 73 20 61  73 20 66 6f 6c 6c 6f 77  | works as follow|
000001a0  73 2e 20 54 61 6b 65 20  61 6e 20 69 6e 69 74 69  |s. Take an initi|
000001b0  61 6c 20 73 65 65 64 2c  20 69 6e 20 74 68 69 73  |al seed, in this|
000001c0  20 63 61 73 65 20 61 20  70 6f 69 6e 74 20 26 20  | case a point & |
000001d0  69 6e 74 72 6f 64 75 63  65 0a 20 20 73 6f 6d 65  |introduce.  some|
000001e0  20 72 61 6e 64 6f 6d 6c  79 20 6d 6f 76 69 6e 67  | randomly moving|
000001f0  20 70 61 72 74 69 63 6c  65 73 20 28 61 73 20 69  | particles (as i|
00000200  6e 20 74 68 65 20 42 72  6f 77 6e 69 61 6e 20 4d  |n the Brownian M|
00000210  6f 74 69 6f 6e 20 61 75  74 6f 6d 61 74 6f 6e 29  |otion automaton)|
00000220  2e 20 41 6c 6c 6f 77 0a  20 20 74 68 65 20 70 61  |. Allow.  the pa|
00000230  72 74 69 63 6c 65 73 20  74 6f 20 77 61 6e 64 65  |rticles to wande|
00000240  72 20 75 6e 74 69 6c 20  6f 6e 65 20 63 6f 6d 65  |r until one come|
00000250  73 20 63 6c 6f 73 65 20  74 6f 20 74 68 65 20 73  |s close to the s|
00000260  65 65 64 3b 20 61 73 20  73 6f 6f 6e 20 61 73 20  |eed; as soon as |
00000270  74 68 69 73 0a 20 20 68  61 70 70 65 6e 73 2c 20  |this.  happens, |
00000280  74 68 65 20 70 61 72 74  69 63 6c 65 20 63 6f 6e  |the particle con|
00000290  63 65 72 6e 65 64 20 27  61 64 68 65 72 65 73 27  |cerned 'adheres'|
000002a0  20 74 6f 20 74 68 65 20  73 65 65 64 20 26 20 62  | to the seed & b|
000002b0  65 63 6f 6d 65 73 20 61  20 70 61 72 74 20 6f 66  |ecomes a part of|
000002c0  0a 20 20 69 74 2e 20 54  68 69 73 20 72 65 73 75  |.  it. This resu|
000002d0  6c 74 73 20 69 6e 20 61  20 67 72 61 64 75 61 6c  |lts in a gradual|
000002e0  6c 79 20 67 72 6f 77 69  6e 67 20 73 74 61 62 6c  |ly growing stabl|
000002f0  65 20 73 74 72 75 63 74  75 72 65 2c 20 74 68 65  |e structure, the|
00000300  20 73 68 61 70 65 20 6f  66 0a 20 20 77 68 69 63  | shape of.  whic|
00000310  68 20 73 68 6f 75 6c 64  20 62 65 20 71 75 69 74  |h should be quit|
00000320  65 20 66 61 6d 69 6c 69  61 72 20 2d 20 73 69 6d  |e familiar - sim|
00000330  69 6c 61 72 20 70 72 6f  63 65 73 73 65 73 20 66  |ilar processes f|
00000340  72 65 71 75 65 6e 74 6c  79 20 6f 63 63 75 72 20  |requently occur |
00000350  69 6e 0a 20 20 6e 61 74  75 72 65 3b 20 66 6f 72  |in.  nature; for|
00000360  20 65 78 61 6d 70 6c 65  20 74 68 65 20 77 61 79  | example the way|
00000370  20 74 68 61 74 20 66 72  6f 73 74 20 73 70 72 65  | that frost spre|
00000380  61 64 73 20 61 63 72 6f  73 73 20 61 20 77 69 6e  |ads across a win|
00000390  64 6f 77 20 6f 72 20 6d  6f 75 6c 64 0a 20 20 67  |dow or mould.  g|
000003a0  72 6f 77 73 20 6f 6e 20  61 20 77 61 6c 6c 2e 20  |rows on a wall. |
000003b0  44 69 66 66 65 72 69 6e  67 20 64 65 67 72 65 65  |Differing degree|
000003c0  73 20 6f 66 20 73 74 72  69 6e 67 69 6e 65 73 73  |s of stringiness|
000003d0  2f 63 6c 75 6d 70 69 6e  67 20 63 61 6e 20 62 65  |/clumping can be|
000003e0  20 70 72 6f 64 75 63 65  64 0a 20 20 62 79 20 61  | produced.  by a|
000003f0  6c 74 65 72 69 6e 67 20  74 68 65 20 69 6e 69 74  |ltering the init|
00000400  69 61 6c 20 64 65 6e 73  69 74 79 20 6f 66 20 77  |ial density of w|
00000410  61 6e 64 65 72 69 6e 67  20 70 61 72 74 69 63 6c  |andering particl|
00000420  65 73 3b 20 74 68 69 73  20 69 73 20 63 6f 6e 74  |es; this is cont|
00000430  72 6f 6c 6c 65 64 0a 20  20 62 79 20 74 68 65 20  |rolled.  by the |
00000440  66 69 6e 61 6c 20 70 61  72 61 6d 65 74 65 72 20  |final parameter |
00000450  69 6e 20 74 68 65 20 63  61 6c 6c 20 74 6f 20 50  |in the call to P|
00000460  52 4f 43 73 6f 75 70 20  62 65 6c 6f 77 2e 20 59  |ROCsoup below. Y|
00000470  6f 75 20 6d 69 67 68 74  20 61 6c 73 6f 20 6c 69  |ou might also li|
00000480  6b 65 0a 20 20 74 6f 20  74 72 79 20 75 73 69 6e  |ke.  to try usin|
00000490  67 20 61 20 6d 6f 72 65  20 63 6f 6d 70 6c 65 78  |g a more complex|
000004a0  20 69 6e 69 74 69 61 6c  20 73 65 65 64 2c 20 73  | initial seed, s|
000004b0  75 63 68 20 61 73 20 61  20 6c 69 6e 65 20 6f 72  |uch as a line or|
000004c0  20 63 69 72 63 6c 65 2e  20 54 68 65 0a 20 20 4d  | circle. The.  M|
000004d0  61 72 67 6f 6c 75 73 20  6e 65 69 67 68 62 6f 75  |argolus neighbou|
000004e0  72 68 6f 6f 64 20 69 73  20 6f 66 20 63 6f 75 72  |rhood is of cour|
000004f0  73 65 20 75 73 65 64 2c  20 74 6f 20 65 6e 61 62  |se used, to enab|
00000500  6c 65 20 74 68 65 20 65  61 73 79 20 70 72 6f 67  |le the easy prog|
00000510  72 61 6d 6d 69 6e 67 0a  20 20 72 65 71 75 69 72  |ramming.  requir|
00000520  65 64 20 74 6f 20 6d 61  6b 65 20 74 68 65 20 70  |ed to make the p|
00000530  61 72 74 69 63 6c 65 73  20 77 61 6e 64 65 72 2e  |articles wander.|
00000540  20 41 20 77 69 6e 64 6f  77 20 6f 66 20 35 30 78  | A window of 50x|
00000550  35 30 20 77 69 6c 6c 20  76 65 72 79 20 71 75 69  |50 will very qui|
00000560  63 6b 6c 79 0a 20 20 67  69 76 65 20 79 6f 75 20  |ckly.  give you |
00000570  61 20 67 6f 6f 64 20 69  64 65 61 20 6f 66 20 68  |a good idea of h|
00000580  6f 77 20 74 68 65 20 70  72 6f 63 65 73 73 20 77  |ow the process w|
00000590  6f 72 6b 73 3b 20 61 20  66 75 6c 6c 20 73 63 72  |orks; a full scr|
000005a0  65 65 6e 20 76 65 72 73  69 6f 6e 0a 20 20 28 32  |een version.  (2|
000005b0  35 36 78 32 35 36 29 2c  20 77 69 74 68 20 74 68  |56x256), with th|
000005c0  65 20 69 6e 69 74 69 61  6c 20 64 65 6e 73 69 74  |e initial densit|
000005d0  79 20 62 65 6c 6f 77 20  6f 66 20 32 30 20 70 65  |y below of 20 pe|
000005e0  72 63 65 6e 74 20 77 69  6c 6c 20 74 61 6b 65 20  |rcent will take |
000005f0  61 62 6f 75 74 0a 20 20  68 61 6c 66 20 61 6e 20  |about.  half an |
00000600  68 6f 75 72 20 75 6e 74  69 6c 20 61 6c 6c 20 70  |hour until all p|
00000610  61 72 74 69 63 6c 65 73  20 61 72 65 20 63 61 75  |articles are cau|
00000620  67 68 74 2e 0a 0a 49 4e  49 54 49 41 4c 49 53 41  |ght...INITIALISA|
00000630  54 49 4f 4e 2a 0a 0a 20  20 31 30 44 45 46 20 50  |TION*..  10DEF P|
00000640  52 4f 43 64 6f 0a 20 20  32 30 2a 53 65 74 45 76  |ROCdo.  20*SetEv|
00000650  61 6c 20 77 72 61 70 20  6f 6e 0a 20 20 33 30 2a  |al wrap on.  30*|
00000660  53 65 74 45 76 61 6c 20  6e 65 69 67 20 6d 61 72  |SetEval neig mar|
00000670  67 6f 6c 75 73 0a 20 20  34 30 2a 53 65 74 45 76  |golus.  40*SetEv|
00000680  61 6c 20 72 6e 64 62 20  2d 31 0a 20 20 35 30 2a  |al rndb -1.  50*|
00000690  53 65 74 45 76 61 6c 20  69 20 31 0a 20 20 36 30  |SetEval i 1.  60|
000006a0  2a 53 65 74 45 76 61 6c  20 74 20 32 34 39 0a 20  |*SetEval t 249. |
000006b0  20 37 30 2a 53 65 74 45  76 61 6c 20 62 20 31 37  | 70*SetEval b 17|
000006c0  0a 20 20 38 30 45 4e 44  50 52 4f 43 0a 0a 53 43  |.  80ENDPROC..SC|
000006d0  52 45 45 4e 2a 0a 0a 20  20 31 30 44 45 46 20 50  |REEN*..  10DEF P|
000006e0  52 4f 43 64 6f 0a 20 20  32 30 63 25 3d 46 4e 61  |ROCdo.  20c%=FNa|
000006f0  63 6f 6c 28 34 35 29 0a  20 20 33 30 50 52 4f 43  |col(45).  30PROC|
00000700  73 6f 75 70 28 32 35 35  2c 31 2c 2e 32 29 0a 20  |soup(255,1,.2). |
00000710  20 34 30 47 43 4f 4c 20  63 25 41 4e 44 36 33 20  | 40GCOL c%AND63 |
00000720  54 49 4e 54 20 63 25 3a  50 4f 49 4e 54 20 30 2c  |TINT c%:POINT 0,|
00000730  30 0a 20 20 35 30 45 4e  44 50 52 4f 43 0a 0a 43  |0.  50ENDPROC..C|
00000740  4f 44 45 2a 0a 0a 28 20  52 45 41 44 5f 4e 45 49  |ODE*..( READ_NEI|
00000750  47 0a 20 20 43 45 4c 4c  20 49 46 20 28 43 45 4c  |G.  CELL IF (CEL|
00000760  4c 20 32 35 35 20 3c 3e  20 20 49 46 20 28 43 45  |L 255 <>  IF (CE|
00000770  4c 4c 20 3d 3d 29 29 0a  20 20 31 20 32 35 34 20  |LL ==)).  1 254 |
00000780  4d 43 4f 55 4e 54 5f 4e  45 49 47 20 49 46 20 28  |MCOUNT_NEIG IF (|
00000790  43 45 4c 4c 20 49 46 20  28 0a 20 20 20 20 20 20  |CELL IF (.      |
000007a0  20 20 20 20 20 20 20 20  20 20 20 4f 50 50 20 49  |           OPP I|
000007b0  46 20 28 4f 50 50 20 32  35 35 20 3c 3e 20 49 46  |F (OPP 255 <> IF|
000007c0  20 28 4f 50 50 20 3c 69  3e 20 2d 20 44 55 50 20  | (OPP <i> - DUP |
000007d0  3c 62 3e 20 3e 3d 20 49  46 20 28 3d 3d 29 20 3c  |<b> >= IF (==) <|
000007e0  74 3e 20 3d 3d 29 29 0a  20 20 20 20 20 20 20 20  |t> ==)).        |
000007f0  20 20 20 20 20 20 20 20  20 20 43 57 20 49 46 20  |          CW IF |
00000800  28 20 43 57 20 32 35 35  20 3c 3e 20 49 46 20 28  |( CW 255 <> IF (|
00000810  20 43 57 20 3c 69 3e 20  2d 20 44 55 50 20 3c 62  | CW <i> - DUP <b|
00000820  3e 20 3e 3d 20 49 46 20  28 3d 3d 29 20 3c 74 3e  |> >= IF (==) <t>|
00000830  20 3d 3d 29 29 0a 20 20  20 20 20 20 20 20 20 20  | ==)).          |
00000840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 43 43  |              CC|
00000860  57 20 3c 69 3e 20 2d 20  44 55 50 20 3c 62 3e 20  |W <i> - DUP <b> |
00000870  3e 3d 20 49 46 20 28 3d  3d 29 20 3c 74 3e 20 3d  |>= IF (==) <t> =|
00000880  3d 20 29 0a 20 20 20 20  20 20 20 20 20 20 20 20  |= ).            |
00000890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000008c0  20 20 20 20 20 20 20 20  43 45 4c 4c 20 3d 3d 20  |        CELL == |
000008d0  29 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |).              |
000008e0  32 52 4e 44 42 20 49 46  20 28 43 43 57 20 20 3d  |2RNDB IF (CCW  =|
000008f0  3d 29 20 43 57 20 20 3d  3d 20 20 20 20 20 20 20  |=) CW  ==       |
00000900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000910  20 20 20 20 20 20 20 20  20 20 20 20 20 20 29 0a  |              ).|
00000920  0a 45 4e 44 2a                                    |.END*|
00000925