Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

IntGCChromosome.h

Go to the documentation of this file.
00001 
00010 /*
00011  * GALib v2.0- A simple C++ library for Genetic Algorithms
00012  * Arthur van Dam <dam@math.uu.nl>
00013  * $Id: IntGCChromosome.h 441 2007-11-15 16:55:50Z adam $
00014  */
00015 #ifndef __GAL_INTGCCHROMOSOME_H
00016 #define __GAL_INTGCCHROMOSOME_H
00017 
00018 #include <string>
00019 #include <sstream>
00020 #include "GrayCodeChromosome.h"
00021 #include "Util.h"
00022 
00023 namespace gal {
00030     class IntGCChromosome : public GrayCodeChromosome<int> {
00031     public:
00032 
00037         IntGCChromosome(int length) : GrayCodeChromosome<int>(length)
00038         {
00039             if (length > (sizeof(int)*8 - 1)) {
00040                 std::cerr << "Warning: IntGCChromosome: bitstring length "
00041                         << length << " exceeds size of standard int type." << std::endl;
00042             }
00043         }
00044 
00048         int const getValue()
00049         {
00050 
00051             /*** Compute the decimal value of the chromosome bits here ***/
00052             return 0;
00053 
00054 
00055 
00056         }
00057 
00061         std::string const getValueText()
00062         {
00063 
00064             /*** create a string representation of the value
00065                  this chromosome represents. ***/
00066             return "empty";
00067 
00068 
00069 
00070         }
00071     };
00072 }
00073 #endif /* __GAL_INTCHROMOSOME_H */

Generated on Tue Oct 20 12:59:20 2009 for LabSci GALib optimisation by genetic algorithms, student version by  doxygen 1.3.9.1