Data Processing
30 Jan 2012 - Dr Anton Gerdelan -

Ken and Chris' Technical Report

"Artificial Unlife"

  • Civilian, soldier, zombie
  • Randomise starting conditions
  • At each step animat behaviour is based on probabilities
  • Which means different outcomes at each run
  • Lots of different things that can be measured
  • ← wrote each position to step-numbered RAW image (see code)
  • converted step00XXXXX.RAW to .png to .gif with ImageMagick (or GIMP)

Output Data From Programme

C code
  // end of step printing and logging
  if (i % printerval == 0) {
    printf("%i\t%i\n", i, gMaps.survivorCount); // step # and survivors left
Bash script:
for i in {0..10000}; do
./unlife 1000 100 > result$i.txt
I used the parameters to mean "run for 1000 steps and print stuff every 100 steps"

Process Data

C code fragment (after tedious file I/O)
for (int i = 0; i < xvalues.size(); i++) {
  // work out sum of y values for each x value
  // work out mean for each x value
  // sum of sq diffs from mean
  // std dev
  // write to "stats.txt"
  fileout << xvalues[i].x << "\t" << xvalues[i].meanOfYValues
  << "\t" << xvalues[i].standardDev << endl;

Processed Data

Plot Data

>plot "plot.xy" witherrorbars


Source code, scripts, and examples from my "Artificial Unlife" demo: