Auto Commit

This commit is contained in:
2020-03-30 19:42:16 -06:00
parent d98b6cdc8f
commit 0b221f8a1d

View File

@@ -38,6 +38,7 @@ std::vector<double> MakePermutationMatrix::MakePermutation(std::vector<City> sou
do { do {
double cost = 0; double cost = 0;
//Add up the cost of the current permutation. //Add up the cost of the current permutation.
std::cout <<"Rank: " << rank << " Current perm: ";
for (int i = 0; i < myPerm.size(); i++) { for (int i = 0; i < myPerm.size(); i++) {
std::cout << myPerm[i].GetName() << " "; std::cout << myPerm[i].GetName() << " ";
cost += costMatrix[myPerm[i].GetName()][myPerm[i-1].GetName()]; cost += costMatrix[myPerm[i].GetName()][myPerm[i-1].GetName()];
@@ -47,7 +48,7 @@ std::vector<double> MakePermutationMatrix::MakePermutation(std::vector<City> sou
//Push permutation cost to the localCostVector. //Push permutation cost to the localCostVector.
localCostVector.push_back(cost); localCostVector.push_back(cost);
counter++; counter++;
} while (std::next_permutation(myPerm.begin()+1, myPerm.end()) && myPerm != nextPerm); } while (std::next_permutation(myPerm.begin(), myPerm.end()) && myPerm != nextPerm);
// //find the lowest and add it to a lowest vector. // //find the lowest and add it to a lowest vector.
// auto lowest = std::vector<double>(1,localCostVector[0]); // auto lowest = std::vector<double>(1,localCostVector[0]);