
freak.core.fitness.AbstractFitnessFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of freak-core Show documentation
Show all versions of freak-core Show documentation
Core library of the Free Evolutionary Algorithm Toolkit
/*
* This file is part of FrEAK. For licensing and copyright information
* please see the file COPYING in the root directory of this
* distribution or contact .
*/
package freak.core.fitness;
import freak.core.control.ScheduleInterface;
import freak.core.modulesupport.AbstractModule;
import freak.core.population.Genotype;
/**
* An abstract superclass for all fitness functions with a link back
* to the current schedule. Concrete fitness functions should extend the either
* the class AbstractSingleObjectiveFitnessFunction
or the class
* AbstractSingleObjectiveFitnessFunction
, which both extend this
* class.
*
* @author Dirk, Heiko, Michael, Stefan
*/
public abstract class AbstractFitnessFunction extends AbstractModule implements FitnessFunction {
public AbstractFitnessFunction(ScheduleInterface schedule) {
super(schedule);
}
public Genotype getPhenotypeOptimum() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
public Genotype getGenotypeOptimum() throws UnsupportedOperationException {
if (getSchedule().getMapper() != null) {
return schedule.getMapper().phenotypeToGenotype(getPhenotypeOptimum());
} else {
// no mapper
return getPhenotypeOptimum();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy