00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <FlowShopInit.h>
00014
00015
00016 FlowShopInit::FlowShopInit(unsigned int _N) : N(_N)
00017 {}
00018
00019
00020 void FlowShopInit::operator()(FlowShop & _flowshop)
00021 {
00022
00023 std::vector<unsigned int> scheduling(N);
00024
00025 std::vector<unsigned int> possibles(N);
00026 for (unsigned int i=0 ; i<N ; i++)
00027 possibles[i] = i;
00028
00029 unsigned int rInd;
00030 for (unsigned int i=0; i<N; i++)
00031 {
00032 rInd = (unsigned int) rng.uniform(N-i);
00033 scheduling[i] = possibles[rInd];
00034 possibles[rInd] = possibles[N-i-1];
00035 }
00036 _flowshop.resize(N);
00037 _flowshop.value(scheduling);
00038 _flowshop.invalidate();
00039 }