After 63 generations, the blue robot evolved to almost always win against the most annoying enemy (Tracker).
The below graph shows how the fitness was changing with every generation. Something important happened around 40th generation.
The Push program that the blue robot is using is quite concise:
(integer.ln ((() (((exec.pop integer.yank (integer.ln ((integer.fromboolean exec.y (((exec.pop)) false (exec.stackdepth (robot.turngunright) (exec.stackdepth exec.swap integer.* (exec.stackdepth integer.pow robot.ahead))) robot.turnradarleft (exec.stackdepth integer.rot robot.turnright robot.fire))))))) false (false) robot.turnradarleft (exec.stackdepth integer.rot robot.turnright robot.fire))) integer.stackdepth) integer.=)
Create ROBOCODE_HOME
environment variable set to, e.g., c:\robocode
.
-Xmx512M -Djava.security.manager=allow -XX:+IgnoreUnrecognizedVMOptions "--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED" "--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED" "--add-opens=java.desktop/sun.awt=ALL-UNNAMED"
Also, since you set NOSECURITY
to true
, do not forget to add the next paths to the classpath (see this issue):
/Users/yaskovdev/robocode/robots
/Users/yaskovdev/robocode/robots/robocode-push-1.0-SNAPSHOT-jar-with-dependencies.jar