All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ec.select.FitProportionateSelection Maven / Gradle / Ivy

Go to download

ECJ, A Java-based Evolutionary Computation Research System. ECJ is a research EC system written in Java. It was designed to be highly flexible, with nearly all classes (and all of their settings) dynamically determined at runtime by a user-provided parameter file. All structures in the system are arranged to be easily modifiable. Even so, the system was designed with an eye toward efficiency. ECJ is developed at George Mason University's ECLab Evolutionary Computation Laboratory. The software has nothing to do with its initials' namesake, Evolutionary Computation Journal. ECJ's sister project is MASON, a multi-agent simulation system which dovetails with ECJ nicely.

The newest version!
/*
  Copyright 2006 by Sean Luke
  Licensed under the Academic Free License version 3.0
  See the file "LICENSE" for more information
*/


package ec.select;
import ec.util.*;
import ec.*;

/* 
 * FitProportionateSelection.java
 * 
 * Created: Thu Feb 10 16:31:24 2000
 * By: Sean Luke
 */

/**
 * Picks individuals in a population in direct proportion to their
 * fitnesses as returned by their fitness() methods.  This is expensive to
 * set up and bring down, so it's not appropriate for steady-state evolution.
 * If you're not familiar with the relative advantages of 
 * selection methods and just want a good one,
 * use TournamentSelection instead.   Not appropriate for
 * multiobjective fitnesses.
 *
 * 

* Note: Fitnesses must be non-negative. 0 is assumed to be the worst fitness. *

Typical Number of Individuals Produced Per produce(...) call
Always 1.

Default Base
select.fitness-proportionate * * @author Sean Luke * @version 1.0 */ public class FitProportionateSelection extends SelectionMethod { /** Default base */ public static final String P_FITNESSPROPORTIONATE = "fitness-proportionate"; /** Normalized, totalized fitnesses for the population */ public double[] fitnesses; public Parameter defaultBase() { return SelectDefaults.base().push(P_FITNESSPROPORTIONATE); } // don't need clone etc. public void prepareToProduce(final EvolutionState s, final int subpopulation, final int thread) { // load fitnesses fitnesses = new double[s.population.subpops[subpopulation].individuals.length]; for(int x=0;x





© 2015 - 2024 Weber Informatics LLC | Privacy Policy