EuclidicDistanceFitnessStrategy.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2009 by Robot Group Leipzig                        *
00003  *    martius@informatik.uni-leipzig.de                                    *
00004  *    fhesse@informatik.uni-leipzig.de                                     *
00005  *    der@informatik.uni-leipzig.de                                        *
00006  *    guettler@informatik.uni-leipzig.de                                   *
00007  *    jhoffmann@informatik.uni-leipzig.de                                  *
00008  *    joergweide84@aol.com (robot12)                                       *
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  *   This program is distributed in the hope that it will be useful,       *
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00018  *   GNU General Public License for more details.                          *
00019  *                                                                         *
00020  *   You should have received a copy of the GNU General Public License     *
00021  *   along with this program; if not, write to the                         *
00022  *   Free Software Foundation, Inc.,                                       *
00023  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00024  ***************************************************************************
00025  *                                                                         *
00026  *   This class implements the getFitness function from IFitnessStrategy.  *
00027  *   The function self calculate the euclidic distance to zero of all gens *
00028  *   which are giving for the individual (accept only double gens!).       *
00029  *                                                                         *
00030  *   $Log: EuclidicDistanceFitnessStrategy.h,v $
00031  *   Revision 1.2  2009/07/21 08:37:59  robot12
00032  *   add some comments
00033  *
00034  *   Revision 1.1  2009/06/15 13:58:36  robot12
00035  *   3 new fitness strategys and IFitnessStrategy and SumFitnessStragegy with comments.
00036  *
00037  *
00038  ***************************************************************************/
00039 
00040 #ifndef EUCLIDICDISTANCEFITNESSSTRATEGY_H_
00041 #define EUCLIDICDISTANCEFITNESSSTRATEGY_H_
00042 
00043 //forward declaration
00044 class Individual;
00045 
00046 //ga_tools include
00047 #include "IFitnessStrategy.h"
00048 
00049 /**
00050  * This fitness strategy calculate from all double gens (IValue<double>) the euclidic
00051  * distance to zero.
00052  */
00053 class EuclidicDistanceFitnessStrategy: public IFitnessStrategy {
00054 public:
00055         /**
00056          * default constructor
00057          * do nothing
00058          */
00059         EuclidicDistanceFitnessStrategy();
00060 
00061         /**
00062          * default destructor
00063          * do nothing
00064          */
00065         virtual ~EuclidicDistanceFitnessStrategy();
00066 
00067         /**
00068          * this function calculate the euclidic distance of all double gen which
00069          * individual has.
00070          * @param individual (const Individual*) the Individual
00071          * @return (double) the distance
00072          */
00073         virtual double getFitness(const Individual* individual);
00074 };
00075 
00076 #endif /* EUCLIDICDISTANCEFITNESSSTRATEGY_H_ */

Generated on Fri Oct 30 16:29:01 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7