Posted on December 30th, 2007 by headwedge
Introduction
Cellular Automata are a fascinating and huge subject but I would like to get back to some of the rest of the game framework and the next key element would that of the game tile.
Background
Before GHz & Megabytes & 3D engines there were MHz Kilobytes and tile based 2D games. Storing images & parts of [...]
Filed under: game, game framework, specification | No Comments »
Posted on December 24th, 2007 by headwedge
Posted on December 23rd, 2007 by headwedge
As part of the hodge-podge specification [link] a widget for changing the infectivity was specified. The initial spec was for a slider, however, a more appropriate choice would be to allow int values to be entered by the user as well as to increase/decrease values in steps. The Java JSpinner widget using the SpinnerNumberModel is [...]
Filed under: Java, automata, code, hodge-podge, solutions | No Comments »
Posted on December 21st, 2007 by headwedge
HodgePodgePixel extends FlyweightCell by implementing the abstract
update(int x, int y, Neighbourhood neighbourhood, CellCollection cells);
method with the hodge-podge algorithm:
/**
* Selectively apply 1 of 3 rules to calculate the next generation depending on current state:
* ‘ill’ ie state = n
* ‘healthy’ [...]
Filed under: Java, automata, code | No Comments »
Posted on December 20th, 2007 by headwedge
Here is the colouriser for the hodge-podge machine. It extends HTMLColour16 by taking 2 colours and creating a table full of RGB colour values that range between them. The number of colours created matches the number of hodge-podge states but can be biased towards one or other of the original 2 starter colours.
The default constructor [...]
Filed under: Java, automata, code | No Comments »
Posted on December 13th, 2007 by headwedge
OOP encapsulation is about more than just hiding data…
Actually trying to use the automata package to write a hodge-podge machine highlighted that the Neighbourhood class still left the testing to the user. The class should hide the boundary testing and simply return valid neighbour locations as a list of points. The application can then [...]
Filed under: Java, automata, code | No Comments »
Posted on December 5th, 2007 by headwedge
Background
The Hodge-Podge machine is an example of a 2D Cellular Automata which mimics chemical reactions. Created by Martin Gerhardt and Heike Schuster of the University of Beilefeld and popularised by A.K.Dewdney in his ‘Computer Recreations’ columns in the Scientific American, August, 1988 magazine. It was designed to mimic a particular kind of ‘heterogeneous catalytic reaction’ [...]
Filed under: hodge-podge, specification | No Comments »
Posted on December 5th, 2007 by headwedge
The CellCollection is the data model it has the toPixels method…
/**
* Converts the cells to a linear array of pixels, through
* the colour convertor, ready for display
* @param Colouriser colours – the chosen false colouring process
* @return int[] – argb 24 bit colour format
*/
public int[] toPixels(Colouriser colours);
…that returns a coloured pixel array view of the [...]
Filed under: Java, automata, code | No Comments »
Posted on December 2nd, 2007 by headwedge
A key part of cellular automata functioning is the neighbourhood of cells each takes into account when calculating its state at t+1. There a many such sizes and shapes of neighbourhoods and the automata package needs to allow for that with extensibilty whilst providing a few basic types such as Von Neuman [link] and Moore [...]
Filed under: Java, automata, code | No Comments »