MTK++ Latest version: 0.2.0

gaOutput.h
Go to the documentation of this file.
00001 
00033 #ifndef GAOUTPUT_H
00034 #define GAOUTPUT_H
00035 
00036 #include <iostream>
00037 #include <vector>
00038 #include <fstream>
00039 #include <iomanip>
00040 
00041 #include <stdio.h>
00042 #include <string.h>
00043 #include <time.h>
00044 
00045 namespace MTKpp
00046 {
00047 
00048 class gaWorld;
00049 class gaRegion;
00050 class gaPopulation;
00051 class gaIndividual;
00052 class gaChromosome;
00053 class gaGene;
00054 
00055 // ============================================================
00056 // Class : gaOutput()
00057 // ------------------------------------------------------------
00065 // ============================================================
00066 
00067 class gaOutput
00068 {
00069 public:
00070 
00075     gaOutput(gaWorld* w);
00076 
00078     virtual ~gaOutput();
00079 
00083     void openOutputFile();
00084 
00088     void writeInput();
00089 
00093     void writeResults();
00094 
00098     void writeConvergence();
00099 
00100 
00105     void setProgramName(std::string progName = "MTK++::GA");
00106 
00110     void prtHeader(std::ostream& os);
00111 
00116     void prtWorld(std::ostream& os);
00117 
00122     void prtOptions(std::ostream& os);
00123 
00128     void prtTail(std::ostream& os);
00129 
00135     void prtWarning(std::ostream& os, std::string warning);
00136 
00141     void writeWarning(std::string warning);
00142 
00148     void prtError(std::ostream& os, std::string error);
00149 
00154     void writeError(std::string error);
00155 
00156 protected:
00157 
00159     gaWorld*                      myWorld;
00160 
00162     std::string                   programName;
00163 
00165     std::ofstream                 outputFileStream;
00166 
00168     std::ofstream                 convergFileStream;
00169 
00171     typedef std::vector<gaRegion*>::iterator regionIterator;
00172 
00174     typedef std::vector<gaPopulation*>::iterator populationIterator;
00175 
00177     typedef std::vector<gaIndividual*>::iterator individualIterator;
00178 };
00179 
00180 } // MTKpp namespace
00181 
00182 #endif // GAOUTPUT_H

Generated on Fri Dec 23 2011 09:28:50 for MTK++ by Doxygen 1.7.5.1