Monday 25 May 2009

First Results from a New Corewar Evolver

Over the last few days I've been working on a short program written in GWBasic to evolve Corewar programs. After a test run earlier today, plateau entered SAL's nano hill:
;redcode-nano
;name plateau
;author John Metcalf
;strategy evolved mad mad bomber
;strategy hit a plateau after 4 hours
;assert CORESIZE==80

spl.b #16,  <28
mov.i <-15, {-35
mov.i {-1,  {-3
mov.i <-28, <25
djn.f $-3,  <33
end
The evolver creates warriors through pure evolution. The soup is seeded with random instructions and evolution is guided only by performance against the 2007 Nano Benchmark. If a benchmark test is scoring below a certain threshold, the test breaks out early.

Evolution is by mutation only. Crossover, insertion and deletion are not implemented. The lower a warrior scores, the more it is changed by mutation. After each round, a high scoring program replaces a randomly chosen low scoring program.

Here are the plans for the next version:
  • keep a checksum of warriors to prevent duplicates in the pool
  • add a hint mode, but to keep it pure it'll hint what we don't want
  • implement crossover
  • think of a decent name (I think revolver is already taken)
Any suggestions would be greatly appreciated.

2 comments:

Z said...

Hi,

could you please disclose more about evolver performance ? Population size, generations per hour, scores on hill ?

Cheers Pavel

John said...

Hi Pavel,

I've been using a population of 20. At the moment it's evaluating about 6800 nano warriors an hour on a 1.6GHz Celeron. Warriors are evaluated by calling pMARS.

After about 4 hours, the score against the benchmark reaches 160. Plateau scores 142.6 on SAL's nano hill.

I'm not sure how the evolver performs on the tiny hill yet.

The program is only 31 lines of code (approx 1800 bytes). I'll publish as soon as I've finished tweaking ;-)

Cheers,

John