00001 /* 00002 * @file Individual.h 00003 * @author Antonio Jesus Nebro Urbaneja 00004 * @version 1.0 00005 * @date 29 January 2004 00006 * @brief Header file of Individual.cpp 00007 */ 00008 00009 #include <Configuration.h> 00010 #include <MultiobjectiveProblem.h> 00011 #include <Chromosome.h> 00012 #include <Random.h> 00013 00014 #ifndef __INDIVIDUAL__ 00015 #define __INDIVIDUAL__ 00016 00021 class Individual { 00022 public: 00023 MultiobjectiveProblem * problem_ ; 00024 Random * random_ ; 00025 Chromosome * chromosome_ ; 00026 double * fitness_ ; 00027 00028 int gridLocation_ ; 00029 00030 // Constructors 00031 Individual(MultiobjectiveProblem * problem, Random * random) ; 00032 Individual(Individual & individual) ; 00033 Individual(Individual * individual) ; 00034 00035 // Destructor 00036 ~Individual() ; 00037 00038 // Methods 00039 void setFitness(double * fitness) ; 00040 double *getFitness() const ; 00041 00042 int dominanceTest(Individual * individual) ; 00043 int constraintComparison(Individual * individual) ; 00044 bool identicalFitness(Individual * individual) ; 00045 00046 // Binary mutation operators 00047 int bitFlipMutation(double mutationProbability) ; 00048 00049 // Real mutation operators 00050 int randomMutation(double mutationProbability) ; 00051 int polynomialMutation(double mutationProbability, 00052 double distributionIndex) ; 00053 int uniformMutation(double mutationProbability, 00054 double perturbation) ; 00055 // Operators 00056 Individual & operator=(Individual &individual) ; 00057 friend ostream& operator<< (ostream& outputStream, Individual& individual) ; 00058 00059 void printFitness() ; 00060 00061 } ; // Individual 00062 00063 00064 #endif