MTK++ Latest version: 0.2.0

gaWorld.h
Go to the documentation of this file.
00001 
00036 #ifndef GAWORLD_H
00037 #define GAWORLD_H
00038 
00039 #include <iostream>
00040 #include <string>
00041 #include <stdlib.h>
00042 #include <vector>
00043 #include <algorithm>
00044 #include <time.h>
00045 
00046 #include "Utils/constants.h"
00047 
00048 namespace MTKpp
00049 {
00050 
00051 class gaRegion;
00052 class gaOutput;
00053 
00054 // ============================================================
00055 // Class : gaWorld()
00056 // ------------------------------------------------------------
00064 // ============================================================
00065 
00066 class gaWorld
00067 {
00068     friend class gaRegion;
00069     friend class gaOutput;
00070 public:
00071 
00076     gaWorld(std::string name = "world");
00077 
00079     virtual ~gaWorld();
00080 
00085     gaRegion* addRegion();
00086 
00091     void delRegion(gaRegion* reg);
00092 
00100     gaRegion* getRegion(int n,bool id, bool index);
00101 
00107     gaRegion* getRegion(std::string name);
00108 
00113     std::vector<gaRegion*> getRegions();
00114 
00119     int getNumRegions();
00120 
00134     void setup(const int& chrPerInd, std::vector<int> genePerChr, std::vector<int> geneSizes,
00135                const std::string outputFile, const std::string restartFile, const std::string convergFile, const int outputLevel);
00136 
00141     gaOutput* getGaOutput();
00142 
00146     void initialize();
00147 
00151     void rank();
00152 
00153     //---------------//
00154     // - GET / SET - //
00155     //---------------//
00156 
00161     void setName(std::string name);
00162 
00167     std::string getName();
00168 
00173     int getChrPerInd();
00174 
00179     void setGenePerChr(std::vector<int> gPc);
00180 
00185     std::vector<int> getGenePerChr();
00186 
00191     void setGeneSizes(std::vector<int> gS);
00192 
00197     std::vector<int> getGeneSizes();
00198 
00203     std::string getOutputFileName();
00204 
00209     std::string getRestartFileName();
00210 
00215     std::string getConvergFileName();
00216 
00221     int getLevelOfOutput();
00222 
00231     void setAuthor(std::string name);
00232 
00237     std::vector<std::string> getAuthors();
00238 
00246     void setStatus(int status);
00247 
00255     int getStatus();
00256 
00257 protected:
00258 
00260     typedef std::vector<gaRegion*>::iterator regionIterator;
00261 
00263     std::vector<gaRegion*>   itsRegionList;
00264 
00266     gaRegion*                pGaRegion;
00267 
00269     gaOutput*                pGaOutput;
00270 
00272     std::string              itsName;
00273 
00275     int                      chrPerInd;
00276 
00278     std::vector<int>         genePerChr;
00279 
00281     std::vector<int>         geneSizes;
00282 
00284     std::string              outputFile;
00285 
00287     std::string              restartFile;
00288 
00290     std::string              convergFile;
00291 
00293     int                      levelOfOutput;
00294 
00296     std::vector<std::string> authors;
00297 
00304     int                      status;
00305 
00307     time_t                   startTime;
00308 
00310     time_t                   endTime;
00311 };
00312 
00313 } // MTKpp namespace
00314 
00315 #endif // GAWORLD_H

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