- All Implemented Interfaces:
- public class SymbolicRegressionWorld
- extends World
The symbolic regression problem of Koza, to find the formula x^4+x^3+x^2+x
given 20 random points for x in the range [-1,1]. Uses a population size of 500
with fitness-proportionate selection, and runs for 50 generations.
Note: this is where I found that I had to protect the EXP and LN functions against extremely
large values, since they would return infinity and then other functions operating on that
value (especially SIN and COS) would return Not-a-Number, which would totally throw everything
Probably a better solution would have been to protect functions against infinity arguments.
Copyright (c) 2000 Robert Baruch. This code is released under
the GNU General Public License (GPL).
- $Id: SymbolicRegressionWorld.java,v 1.4 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 int run(int numGenerations)
public void runProb(int numGenerations,
public static void main(java.lang.String args)