00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <FlowShopOpMutationExchange.h>
00014
00015
00016 std::string FlowShopOpMutationExchange::className() const
00017 {
00018 return "FlowShopOpMutationExchange";
00019 }
00020
00021
00022 bool FlowShopOpMutationExchange::operator()(FlowShop & _flowshop)
00023 {
00024 bool isModified;
00025 FlowShop result = _flowshop;
00026
00027 unsigned int point1, point2;
00028 do
00029 {
00030 point1 = rng.random(result.size());
00031 point2 = rng.random(result.size());
00032 } while (point1 == point2);
00033
00034 std::swap (result[point1], result[point2]);
00035
00036 if (result != _flowshop)
00037 {
00038
00039 _flowshop.value(result);
00040
00041 isModified = true;
00042 }
00043 else
00044 {
00045
00046 isModified = false;
00047 }
00048
00049 return isModified;
00050 }