/*
Copyright 2006 by Sean Luke
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package ec.gp;
import ec.*;
import ec.util.*;
import java.io.*;
/*
* GPSpecies.java
*
* Created: Tue Aug 31 17:00:10 1999
* By: Sean Luke
*/
/**
* GPSpecies is a simple individual which is suitable as a species
* for GP subpopulations. GPSpecies' individuals must be GPIndividuals,
* and often their pipelines are GPBreedingPipelines (at any rate,
* the pipelines will have to return members of GPSpecies!).
*
Default Base
gp.species
*
* @author Sean Luke
* @version 1.0
*/
public class GPSpecies extends Species
{
public static final String P_GPSPECIES = "species";
public Parameter defaultBase()
{
return GPDefaults.base().push(P_GPSPECIES);
}
public void setup(final EvolutionState state, final Parameter base)
{
super.setup(state,base);
// check to make sure that our individual prototype is a GPIndividual
if (!(i_prototype instanceof GPIndividual))
state.output.fatal("The Individual class for the Species " + getClass().getName() + " is must be a subclass of ec.gp.GPIndividual.", base );
}
public Individual newIndividual(EvolutionState state, int thread)
{
GPIndividual newind = ((GPIndividual)(i_prototype)).lightClone();
// Initialize the trees
for (int x=0;x
Ads help maintain this website.