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