- All Implemented Interfaces:
- Direct Known Subclasses:
- public class MultiplexerWorld
- extends World
The 11-multiplexer problem from Koza, to find a formula to choose
one of eight boolean inputs based on the values of three other boolean inputs.
Uses a population size of 4000 with greedy overselection, and runs for 50 generations.
Note: This is where I found the need to optimize fitness calculations. By running this
program under the Java profiler (i.e. java -Xprof) I was able to determine where a majority
of the run time was being taken up. Originally the accesses to
Variable were the most time-consuming,
so I optimized Variable. Now the majority of time is taken by the code of
computeRawFitness, which I can't seem to get down any further.
Copyright (c) 2000 Robert Baruch. This code is released under
the GNU General Public License (GPL).
- $Id: MultiplexerWorld.java,v 1.3 2000/10/12 15:22:55 groovyjava Exp $
- Robert Baruch (firstname.lastname@example.org)
- See Also:
- Serialized Form
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void create()
public float computeFitness(Individual ind)
- Description copied from class:
- Computes the adjusted fitness of the given individual. The subclass must provide
an implementation of this method.
computeFitness in class
- Following copied from class:
individual - the Individual to evaulate
- the adjusted fitness, where bigger numbers are better. Does not necessarily
have to have a maximum value.
public float computeRawFitness(Individual ind)
public void run(int numGenerations)
public static void main(java.lang.String args)