home *** CD-ROM | disk | FTP | other *** search
-
- TABLE 3: The Neighbourhoods
-
-
- ArcAut currently permits the use of two distinct neighbourhood schemes, called Moore & Margolus.
- To select a particular neighbourhood for an automaton, set the system variable
- called 'neig' to either 'moore' or 'margolus' within the initialisation (see table 4).
- Before any neighbour can be referred to within the rules defining an automaton, the command READ_NEIG must be included.
- All automatons that I have come across in magazines use the Moore neighbourhood, so i'll describe it first.
-
- The Moore neighbourhood: each cell is surrounded by eight diagonally or orthogonally adjacent neighbours.
- Within automaton code these are given the following names;
-
- TL TM TR
- ML CELL MR
- BL BM BR
-
- T meaning top, M middle, B bottom, L left & R right, with respect to the central cell
- under consideration (which is called CELL).
- Many of the more colourful automatons use the Moore neighbourhood.
-
- The Margolus neighbourhood is rather more complex to describe; it is well suited to the programming of particle based
- automatons such as DLA, Brownian Motion & Sound, to name a few. It was originally devised by Norman Margolus to investigate the
- possibility of a reversible 'ballistic computer' automaton.
-
- The Margolus neighbourhood: we ensure both the width & height of the CA universe are even. A partition is then imposed,
- dividing the universe up by a grid into blocks, each made up from 4 cells in a 2x2 arrangement
- for example in an 4x4 universe;
-
- ab cd We say that a grid aligned with the universe in this way has
- ef gh even phase
-
- ij kl
- mn op
-
- Each cell has 3 other neighbours, these being the other three cells within the same block.
- All 4 cell within a particular block can be referred to by the names;
-
- UL UR
- LL LR
-
- UL meaning upper left, UR upper right, LL lower left & LR lower right
- More usefully we can refer to all four cells via their location relative to the cell under
- consideration, with the names CELL, CW, CCW & OPP
- CW meaning clockwise, CCW counter clockwise & OPP opposite
- The four possible actual orientations are;
-
- CELL CW CCW CELL OPP CCW CW OPP
- CCW OPP OPP CW CW CELL CELL CCW
-
- If we were to leave the partition positioned as above, then the cells in different blocks could
- never communicate & we couldn't do anything interesting. Instead, we allow the phase of the grid
- to alternate between even & odd, as the generations progress. An even partition is shown above.
- The odd partition is obtained by shifting the even grid by one cell diagonally.
- For the 4x4 universe this would give us;
-
- a bc d
-
- e fg h
- i jk l
-
- m no p
-
- where, using wrap around, the cells form blocks as follows; pm no he fg
- da bc li jk
-
- It is often useful within the automaton code to know what the phase is, or which position within
- the block CELL has. This information can be passed with the register that is referred to by
- the name FLAG. Either the phase, the orientation, both or neither are held in FLAG depending
- on the setting of the system variable flag; see table 4
- The Margolus scheme is quite different from the Moore, & at first may seem unnecessarily
- complicated & of no obvious use. To dispell this idea consider the following trivial example.
- We define a simple automaton which starts from a single white point on a black background, & then
- applies the rule (OPP ==). Imagine this yourself, acting on a small universe. It soon becomes
- clear that this results in the white point appearing to move along a diagonal - the direction it
- goes in depends on it's position within the 2x2 block containing it. Just try and design an
- automaton using the Moore neighbourhood which does this; even if you can work out how, it will
- be very cumbersome & difficult to follow (although I ought to point out that anything you can do
- with the Margolus neighbourhood can also be done with the Moore). Take a look at any of the
- automatons provided which use the margolus neighbourhood; see if you can work out what they do
- before you run them.
- While an automaton is running, you can force it to use the same phase on two succesive generations
- rather than automatically alternating, by clicking menu & then selecting the Phase option from the
- menu; either resume with Cont. or watch the action a frame at a time by clicking on Next. In some
- cases this can have a dramatic effect, even causing the automaton to run backwards! (As would be
- the case with the trivial example given above).
-