Skip to content
Haoxi Zhan edited this page Nov 16, 2013 · 1 revision

Leiningen

As Clojush is based on programming language Clojure, a Clojure environment is needed to run Clojush. To run Clojush easily, Leiningen is recommend.

Leiningen is included in Debian, Ubuntu and Fedora distribution. For Debian/Ubuntu users, Leiningen could be installed by running:

sudo apt-get install leiningen

For Fedora users, simply run:

sudo yum install leiningen

If your operating system doesn’t come with leiningen, you could download it from its website.

Clojush

Clojush is freely available on Lee Spector’s github repo. To get Clojush, change directory into a place in which you’d like to store Clojush and run

git clone https://github.com/lspector/Clojush.git

After cloning Clojush, move to the Clojush directory by

cd Clojush

Now you are able to run some Clojush examples. For instance, the following commands would run the factorial example:

lein run clojush.examples.factorial

If this is the first time to run Clojush, Leiningen would grab some dependencies from Clojars automatically. And it’s always simple to test another example by changing factorial to the name of another example. Changing parameters could be done by adding arguments after the command above.

lein run clojush.examples.factorial :population-size 500

would change the population-size from 1000 to 500. By doing that, the computing time for each generation would decrease while the total amount of generations might increase.

lein run clojush.examples.factorial :population-size 500 :max-generations 50

would limit the max number of generations to 50 in addition to defining the population-size to 500.

If Clojush didn’t find the solution inside the limitation of generations, the program would run into failure. The following output indicates that a specific run failed to find a solution:

--- Population Statistics ---
Average total errors in population: 2.42000073896E8
Median total errors in population: 62
Error averages by case: (4.800000129E7 4.200000123E7 4.600000468E7 5.6000016696E7 5.000005E7)
Error minima by case: (0 0 0 0 23)
Average program size in population (points): 93.402
Number of unique programs in population: 415
Max copy number of one program: 18
Min copy number of one program: 1
Median copy number: 1
--- Timings ---
Current time: 1384303103727 milliseconds
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

FAILURE
Note
Changing these parameters into unscientific values would easily make it fail.