ac.essex.ca.neighbourhoods
Class VonNeumannNeighbourhood

java.lang.Object
  extended by ac.essex.ca.neighbourhoods.Neighbourhood
      extended by ac.essex.ca.neighbourhoods.VonNeumannNeighbourhood

public class VonNeumannNeighbourhood
extends Neighbourhood

Von Neumann's Neighbourhood, where a cell looks at the three cells above it to decide what its state should be. This produces a triangular shape. Cellular Automata using Von Neumann's neighbourhoods thus often have lots of triangle shapes in them.

xxx
 p 

As the neighbourhood only looks at three cells, there are 8 different situations to look at:

111 110 101 100 011 010 001 000

For each of the situations above, there the rule can set the pixel to be either 1 or 0. This gives 256 possible rule sets.

Von Neumann encoded the rule sets into a set of decimal values between 1 - 256. Binary readers will be able to see the rule below is set number 30

Pixels: 111 110 101 100 011 010 001 000 Output: 0 0 0 1 1 1 1 0

Other neighbourhoods will have many more combinations of rule sets

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version, provided that any use properly credits the author. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org


Field Summary
 
Fields inherited from class ac.essex.ca.neighbourhoods.Neighbourhood
positions
 
Constructor Summary
VonNeumannNeighbourhood()
           
 
Method Summary
 void createNeighbourhood()
          Creates the neighbourhood by specifying the location of the three cells above the current position.
 
Methods inherited from class ac.essex.ca.neighbourhoods.Neighbourhood
addPosition, getPosition, getPositions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VonNeumannNeighbourhood

public VonNeumannNeighbourhood()
Method Detail

createNeighbourhood

public void createNeighbourhood()
Creates the neighbourhood by specifying the location of the three cells above the current position. If you change the locations of these three pixels, you can cause the CA to produce different shapes.

Specified by:
createNeighbourhood in class Neighbourhood