Informatik, Modellbau und Privates von Georg
[ start | index | login ]
Home > ICFP 2004 > Finished and Improved

Finished and Improved

Created by georg. Last edited by georg, 4 years and 124 days ago. Viewed 194 times. #6
[diff] [history] [edit] [rdf]
labels
attachments
finished.tgz (26751)
improved.tgz (19181)

Finished Version

Jörg has finished the ant program as described in Our_Approach. The version can be downloaded from the side panel >>finished.tgz

See Screenshots.

Improved Version

I could not resist to improve the finished version. I have added a queen that will guard the food storage and some ants that maintain the hill and kill enemies. The new stategy is described below. You can download the source from the side panel >>improved.tgz

See Screenshots

Global Strategy:

There are 4 different kind of ants:
  • queen
  • mark paths -> become explorers later
  • explore & get food
  • stay-at-home

Initial phase:

In the initial phase it is decided which ant becomes what.
  • queen election: The ant that sees 3 non-home fields is the queen
  • mark paths: all ant at the border of the hill
  • the rest is devided with the ratio 7:1 in explore and stay-at-home ants

Queen stategy:

  • go to center of hill
  • mark center as storage with Marker5
(reuse, since foodtracks are not used inside the hill)
  • stay ot storage cell and look aound for comming friends with food
  • clear the cell for very little time and go back.

mark path stategy:

  • turn to the outside of the hill
  • go straight and mark the passed cells with 3 2 1 periodicly
  • occasionally they go left or right but then the next time they
go in the opposite side -> allways go away from the base
  • rocks and obstacles are avoided and the original direction is memorised
  • finish if the own cell and the cell ahead is marked and we see a rock
  • become explorer

explorer stategy:

  • go around until find food or food path
  • if at foodpath: follow it in the right way and
decrement the foodpath stength by one
  • if at food: pickup and look for marked way
  • follow way to base
  • during carrying food mark the path with maximal food strength (3) and
write the gradient 3 2 1
  • if at home: drop at the inside border and explore

stay-at-home stategy:

  • go around the inside border of the hill
  • if see food: take it and follow the border until reach a corner
  • if at corner turn to center and try to access it and drop food there
  • during the whole time make sure to stay in the base
and look for enemies
  • if see enemy try to follow him and stick at his ass!
Occasionally try to change to relative position to the enemy to give other ants a better chance help surrounding.

Results:

On map 5 the Black colony has a clear disadvantage since the food is much more far away. The food-storage stategy with the queen and the killer ants shows its potential:

RED : Rewrite BLACK : Rewrite2 Map : sample5.world

Iterations: 10000 Red colony won! Score: 203 : 62 (Red : Black) Killed: 1 : 0 (Red : Black)

Iterations: 20000 Red colony won! Score: 236 : 148 (Red : Black) Killed: 2 : 1 (Red : Black)

Iterations: 40000 Black colony won! Score: 202 : 269 (Red : Black) Killed: 5 : 1 (Red : Black)

Finaly: Iterations: 100000 Black colony won! Score: 0 : 632 (Red : Black) Killed: 50 : 1 (Red : Black)

Yeah!

no comments | post comment

Content

Help
For hints about formatting text see snipsnap-help.

Logged in Users: (0)
… and a Guest.

Recently Changed
snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt