ECJ Ant Trail - Xholon App (GP)

What is it

This model is a Xholon version of the Ant Trail application included with ECJ, an open-source evolutionary computation system written in Java. You will need to download ECJ separately from Xholon. This version of the model generates an optimal solution using genetic programming (GP). The discussion that follows assumes you are generally familiar with GP. If not, see the references later in this document.

This application demonstrates how to combine Xholon with ECJ.

How to use it

Run it:

  1. Run the Java application through the XhnEalontro GUI (, and select File --> Open --> ealontro --> EcjAntTrail --> EcjAntTrail_1_xhn.xml.
  2. Expand the Controller node in the tree.
  3. Press the Start node.
  4. You should see the following text, or something similar, displayed in the console window.
  5. If you have JFreeChart installed, and if you have selected "JFreeChart" as the value of the UseDataPlotter parameter in Tutorial4_1_xhn.xml, you should also see a chart showing the increase in fitness from one generation to the next (0.0 is the ideal fitness). If you don't have JFreeChart installed, then change the value of UseDataPlotter to "gnuplot", and look at the results that are saved to a .csv file in the statistics folder. If you have gnuplot installed, it can read the .plt script in the statistics folder to produce a displayable .png file from the .csv file, that should look similar to the one below.

Opening model: C:\Primordion\workspace\Ealontro\config\ealontro\EcjAntTrail\EcjAntTrail_1_xhn.xml
AppM : false
InfoM : false
ErrorM : true
MaxProcessLoops : 400
TimeStepInterval : 10
InheritanceHierarchyFile : ./config/ealontro/EcjAntTrail/InheritanceHierarchy.xml
CompositeStructureHierarchyFile : ./config/ealontro/EcjAntTrail/EcjCompositeStructureHierarchy.xml
ClassDetailsFile : ./config/ealontro/EcjAntTrail/EcjClassDetails.xml
JavaClassName :
UseDataPlotter : true
SaveSnapshots : false
EcjArgs : -file bin/ec/app/ant/ant.params

| An evolutionary computation system (version 15)
| By Sean Luke
| Contributors: L. Panait, G. Balan, S. Paus, Z. Skolicki,
|               J. Bassett, R. Hubley, and A. Chircop
| URL:
| Mail:
|       (better: join ECJ-INTEREST at URL above)
| Date: April 4, 2006
| Current Java: 1.4.2_10 / Java HotSpot(TM) Client VM-1.4.2_10-b03
| Required Minimum Java: 1.3

Threads:  breed/1 eval/1
Seed: 1056442937 
Job: 0
Setting up
Processing GP Types
Processing GP Node Constraints
Processing GP Function Sets
Processing GP Tree Constraints
Initializing Generation 0
Population: 1024
Generation 1
Generation 2
Generation 3
Generation 48
Generation 49
Generation 50

ECJ Ant Trail with GP

Things to notice

The ECJ file out.stat contains the best solution found each generation, and the best individual found in the entire run. The Xholon file EcjCompositeStructureHierarchy_Best.xml contains the best solution, in Xholon format. It can be copied into another CompositeStructureHierarchy.xml file to be run as a hard-coded optimal solution, as is done in the config files for AntTrail_1_xhn.xml. See CompositeStructureHierarchy_1.xml, CompositeStructureHierarchy_2.xml, etc. The ECJ file organizes nodes in textual lists, while Xholon formats the same information using XML trees.

Things to try

Extending the model

Xholon and Ealontro features

Generating an optimal solution to a problem using genetic programming (GP).

Displaying results in a chart.

Credits and references

This application was described in: Koza, J. (1992). Genetic Programming. p.147-162

To learn more about genetic programming (GP), start with the wikipedia page.


Visit the ECJ website to find out more about this tool.