Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
/ evocode Public archive

Create robocode robots, using genetic programming.

Notifications You must be signed in to change notification settings

algoristic/evocode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

evocode

Create robocode robots, using genetic programming.

🔧 Configuration

The configuration of the simulation happens inside a .properties file. This file controls the current run of the simulation as well as the general configuration of the simulation project.

Example

An extensive and documented configuration can be found under default.properties.

🚧 Running the application

As of now there are three possibilities to run the application:

Run the simulation

Run the simulation until the termination condition is met.

de.algoristic.evocode.EvocodeApplication
  -m,--mode     run
  -p,--project  /absolute/path/to/your/config.properties

Compile a specific individual

Compile a specific individual to its default target directory.

de.algoristic.evocode.EvocodeApplication
  -m,--mode        compile
  -p,--project     /absolute/path/to/your/config.properties
  -g,--generation  generation number
  -i,--individual  individual number

Compile and test a specific individual

Compile and run the test for a specific individual. (Delete all generated resources afterwards.)

de.algoristic.evocode.EvocodeApplication
  -m,--mode        test
  -p,--project     /absolute/path/to/your/config.properties
  -g,--generation  generation number
  -i,--individual  individual number
  -v,--visualize   [optional] set flag to display the battle

🚀 Getting Started

Installation

Download robocode from sourceforge.net.

Install robocode to C:\robocode, using java -jar robocode-installer.x.y.z.jar.

In C:\robocode\robocode.bat adjust the lines depending on your Java version. Test run via robocode.bat or from start menu.

Follow the guide Create a project on robowiki.

  1. Add C:\robocode\libs\robocode.jar according to guide.

  2. Link javadoc according to guide.

Also add the robocode.api at correct version to pom.xml for your convenience. In robocode under Options > Preferences > Development Options add your Eclipse project. In Eclipse follow the guide Running from Eclipse to make your robots runnable and debuggable from Eclipse.

Misc

Check, if this problem occurs: https://stackoverflow.com/a/70600427.

💬 Consideration

You may have wondered why there is no support for concurrency/multi-threading. Well, I have also tried around with this - in fact there is no way to run multiple instances of the robocode engine (API) in eclipse. You may instantiate multiple objects, but there will be always one underlying factory, performing all tasks, resulting in no improvement in performance…​

Sidenote (for myself)

Yes, I also considered running multiple copies of robocode (complete clones of C:\robocode) under C:\robocode\<thread number> to prevent the described problem. Sadly it is hardcoded in the robocode API to primarily use the instance that is part of the classpath of the caller.

About

Create robocode robots, using genetic programming.

Topics

Resources

Stars

Watchers

Forks

Languages