Introduction to Natural Computation

Hints for the Firefly Continuous Assessment

You can complete the assignment with a fairly simple program. You will need a two-dimensional array to represent the population, and the CURRENT state of each cell. You will need another array to record the NEXT state of each cell. Then at each iteration, you use a for-loop to go through all the cells and work out what the next state should be. If a cell is currently flashing, then the next state will be back to the beginning of the cycle. If a neighbour is flashing, AND the cell is in a sensitive state, then the next state will be back to the beginning of the cycle. Otherwise, the cell simply increments its state to the next one in the cycle. Once all the next states have been recorded in the second array, go back through it and copy all the new states to the first array. Then do another iteration....

The main thing you have to think about is what experiments you want to try, what data you want to collect, and how best to analyse the data.

It is not essential that you write a graphical front-end to the code, although it is a nice extra task you can try if you have time and motivation - you might receive a bonus mark or two!

N.B. If you are having trouble synchronising your fireflies, try a 10 by 10 grid with Moore neighbourhood, with a cycle length of 10. Experiment with sensitivity thresholds between 5 and 8. Make sure you run each simulation for long enough (say, 200 time steps).