 Introduction
 Methods
 Results/Discussion
 Code
 References

|
|
Code
The code is divided
into two parts and is written in
java:
ant.java
NetworkEvolution.java
To
run and view the code a good software is Dr. Java available for free
from:
http://www.drjava.org/
Once
installed one simply has to open both java files above in drjava and
click on compile. In the interactions pane one can
then start the program by typing:
java NetworkEvolution 10000 5 0.2 0.2
10
where the numbers after network evolution are
the following parameters in same order as used as arguments in the
code:
n
-
The size of the population to be
tested
hidden
-
The number of hidden units each ant
has
mFactor
-
The mutation factor, i.e. after each round the offspring will be
mutated by a
random number chosen from +/- mFactor
selectiveStrength -defines what fraction of the population is kept
for the generation of the next
offspring, i.e. a selective strength of 0.2 means the top 20% of the
generation
get to produce offspring for the next
generation
cycles
- The number of evolutionary cycles the program should
run for
The code as it is downloaded will currently
print out the cycle number and the mean fitness into the
interactions pane. This can be modified and other info added
by adding the line "System.out.println("Your text here "
+yourVariableHere);" (without outer apostrophes) in the desired code
location.
Web site and all contents © Copyright David Huland 2009, All rights reserved.
Free website templates
|
|