Corewars Redcode Evolver (CRE)
Version 1.2 BETA, Release 2
Manual


CONTENTS
--------------------------------------------------------------------------------

Introduction 
What's New 
Getting CRE 
Installing CRE 
Using CRE 
The Future
Support, Bugs, Resources, Ect. 


INTRODUCTION
--------------------------------------------------------------------------------

CRE is an acronym for Corewars Redcode Evolver. CRE evolves a population of Redcode warriors using a genetic algorithm.
CRE was written on a Windows XP machine, but the source code is portable to almost any operating system with a C compiler.
CRE is released under the terms of the GNU GPL (http://www.gnu.org.)

CRE uses the optimized version of Exhaust by Martin Ankerl, originally written by M Joonas Pihlaja.


WHAT'S NEW
--------------------------------------------------------------------------------

Version 1.2 BETA, Release 2
-A bug was fixed in the mutate_line function. When generating new opcodes, the random number generated was too big, resulting in warriors with bad opcodes.
-The option for multi-point mutations was removed and replaced with an option on the number of mutations per line.
-The source code was cleaned up some to make it easier to read. More cleanup of the source code is planned for future versions.
-In the change_settings function, the different settings now show the expected values for each parameter.
-The optimized version of Exhaust by Martin Ankerl (exhaust-ma) replaces the original version of Exhaust.

Version 1.2 BETA, Release 1
-There is only one option for evolving warriors. The population competes in a round-robin style tournament, and the highest scoring half of the population reproduce. 
-A new function for generating random numbers was added. This new function ensures that numbers are more random. See http://c-faq.com/lib/randrange.html for more information. 
-The user interface was changed slightly to make it easier to use CRE. 
-The results of each battle are no longer printed to the screen. Only the current round is shown. This is to speed up the evolution process.
-The Windows version is no longer in a setup executable. It now comes in a zip file. 

Version 1.1
-The changes for version 1.1 were not documented.

Version 1.0 R2
-This release fixes a problem in the manual for CRE and fixes a minor problem found in the program itself. 
-The Windows version of CRE now comes in a setup program. 

Version 1.0
-CRE has been tested enough to be considered stable. This is the first stable release. 
-An experimental algorithm has been added (option 1.) 
-New interface allows you to enter evolver values in the program (no text config file.) 
-Compiles under Linux 

Version 1.0.0.742 <dev>
-Exhaust is used as the Redcode simulator. You do not have to download pMARS. 
-Made changes in the source code for Linux compatibility. 
-Added a function to make sure that your configuration file is valid. 
-Labels are used in the configuration file. However, parameters still have to remain in the same position. 


GETTING CRE
--------------------------------------------------------------------------------

CRE can be downloaded from http://cre.sourceforge.net/.  


INSTALLING CRE
--------------------------------------------------------------------------------

WINDOWS: Extract the zip file to the location you wish to run CRE from (See the note below about ramdisks).

OTHER PLATFORMS: To use CRE on other platforms, download the source .zip file and extract to a location of your choice. Then use a C compiler to compile CRE to an executable for your computer (currently, there is no makefile for CRE.) If you use Linux, use gcc. The following command should work (you should cd to the directory that the source is in):

gcc *.c exhaust/*.c -o evolve

You can now run CRE by changing to the src directory and typing evolve.

NOTE: CRE relies heavily on disk access. Because of the heavy disk usage, I suggest that CRE be run from a ramdisk. Failure to do so could result in excess disk wear, and eventually cause your hard disk to fail.

NOTE: CRE doesn't work on 16-bit operating systems (MS-DOS, for example). You should run CRE on a 32-bit operating system (I haven't tested on 64-bit operating systems yet).


USING CRE
--------------------------------------------------------------------------------

1) The configuration file- Evolver settings can be changed when the program starts.  Simply enter the option for a custom configuration (option 2) and enter your new settings. The options are:

Core size: The size of the core that the warriors battle in.
Cycles per battle: The maximum number of cycles a battle can run before a tie is declared.
Threads per warrior: The maximum number of processes each warrior can have.
Distance between warriors: The minimum space between two warriors in the core.
Population size: The number of individuals in the population.
Maximum size of warrior: The maximum number of instructions a warrior can have.
Insert rate: The chance of a new instruction being inserted.
Delete rate: The chance of an instruction being deleted.
Mutation rate: The chance of an instruction being changed.
(NOTE: The sum of the above three options should be less than 100.)
Mutations per line: The number of mutations that can occur in a single line.
Battles per pair: The number of battles that will occur for each pair of warriors.
Evolution cycles: The number of rounds of evolution that will occur. Enter '-1' for no limit (infinite evolution).

2) Evolver- Once you have your settings configured like you want, use option 1 on the main menu. This will start the evolution process. CRE needs no more human input, so you can go off and leave your computer and check on the warriors later.

The program will run until you stop it or until the number of battle cycles you specified has been reached. (in Windows, just click the close button or press Alt+F4. In Linux, use CTRL+C)

Your warriors will be in the same directory as CRE. They are the files with the names cre_###.red. 


THE FUTURE
--------------------------------------------------------------------------------
I plan to continue development on CRE 1.x for several more months. CRE 2.0 is also in development. CRE 2.0 is an almost complete rewrite of the CRE source code. New features in CRE 2.0 are:

-Warriors will be stored in memory, eliminating the need for a ramdisk.
-Warriors will reproduce by a simulation of sexual reproduction (two warriors will make one by selecting a crossover point).

CRE 2.0 will still be portable to other operating systems, and will still be written in pure C code.


SUPPORT, BUGS, RESOURCES, ETC.
--------------------------------------------------------------------------------

SUPPORT: http://sourceforge.net/tracker/?atid=553448&group_id=78492&func=browse.
BUGS: http://sourceforge.net/tracker/?atid=553447&group_id=78492&func=browse.
FEATURE REQUESTS: http://sourceforge.net/tracker/?atid=553450&group_id=78492&func=browse.
OTHER: E-mail gamesharker2002@users.sourceforge.net for any other questions you may have. You can also use the forums at http://sourceforge.net/forum/?group_id=78492.
