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
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 »
Posted on December 2nd, 2007 by headwedge
I have recently had a little time to play around with some classes for cellular automata as per my spec [link].
Filed under: Java, automata, code | No Comments »
Posted on November 7th, 2007 by headwedge
…again.
I want to like XCode 3 I really do.
I like:
1/ The in-code error messages:
2/ erm…
3/ that’s it
I do not like:
1/ That code sense no longer auto-completes print to System.out.println(…), oh no now you have to type System.out.print before it will auto-complete wtf?! So, take one of the most commonly typed pieces of Java code [...]
Filed under: Java, code, mac, os x, rants, xcode | No Comments »
Posted on October 15th, 2007 by headwedge
A couple of Data Flow Diagrams quickly showed me that the extreme pull method for pixel subscriber results in way too much coupling and that the extreme push model for pixel data using an intelligent data wrapper in the form of PixelSpace remains the best approach.
But, when large pixel arrays are displayed at the single [...]
Filed under: Java, code, news, pixel, solutions | No Comments »