00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef MAKE_GENOTYPE_FLOWSHOP_H_
00014 #define MAKE_GENOTYPE_FLOWSHOP_H_
00015
00016 #include <utils/eoParser.h>
00017 #include <utils/eoState.h>
00018 #include <FlowShop.h>
00019 #include <FlowShopInit.h>
00020 #include <FlowShopBenchmarkParser.h>
00021
00022
00023
00024
00025
00026
00027 eoInit<FlowShop> & do_make_genotype(eoParser& _parser, eoState& _state)
00028 {
00029
00030 std::string benchmarkFileName = _parser.getORcreateParam(std::string(), "BenchmarkFile", "Benchmark file name (benchmarks are available at www.lifl.fr/~liefooga/benchmarks/)", 'B',"Representation", true).value();
00031 if (benchmarkFileName == "") {
00032 std::string stmp = "*** Missing name of the benchmark file\n";
00033 stmp += " Type '-B=the_benchmark_file_name' or '--BenchmarkFile=the_benchmark_file_name'\n";
00034 stmp += " Benchmarks files are available at www.lifl.fr/~liefooga/benchmarks";
00035 throw std::runtime_error(stmp.c_str());
00036 }
00037
00038 FlowShopBenchmarkParser fParser(benchmarkFileName);
00039 unsigned int N = fParser.getN();
00040
00041 eoInit<FlowShop>* init = new FlowShopInit(N);
00042
00043 _state.storeFunctor(init);
00044
00045 return *init;
00046 }
00047
00048 #endif