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

IntChromosome.h

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