diff --git a/.vs/Serial/v15/.suo b/.vs/Serial/v15/.suo index f01ed7f..a2c05af 100644 Binary files a/.vs/Serial/v15/.suo and b/.vs/Serial/v15/.suo differ diff --git a/.vs/Serial/v15/Browse.VC.db b/.vs/Serial/v15/Browse.VC.db index 52932ab..bf81ac3 100644 Binary files a/.vs/Serial/v15/Browse.VC.db and b/.vs/Serial/v15/Browse.VC.db differ diff --git a/.vs/Serial/v15/ipch/AutoPCH/583288fe27abf4bb/ITERATIVE2.ipch b/.vs/Serial/v15/ipch/AutoPCH/583288fe27abf4bb/ITERATIVE2.ipch new file mode 100644 index 0000000..2d0df7c Binary files /dev/null and b/.vs/Serial/v15/ipch/AutoPCH/583288fe27abf4bb/ITERATIVE2.ipch differ diff --git a/.vs/Serial/v15/ipch/AutoPCH/b8c887c2f3daad0f/MAIN.ipch b/.vs/Serial/v15/ipch/AutoPCH/b8c887c2f3daad0f/MAIN.ipch new file mode 100644 index 0000000..5e95182 Binary files /dev/null and b/.vs/Serial/v15/ipch/AutoPCH/b8c887c2f3daad0f/MAIN.ipch differ diff --git a/.vs/Serial/v15/ipch/AutoPCH/f96043564c3c6078/TOUR.ipch b/.vs/Serial/v15/ipch/AutoPCH/f96043564c3c6078/TOUR.ipch new file mode 100644 index 0000000..07f762f Binary files /dev/null and b/.vs/Serial/v15/ipch/AutoPCH/f96043564c3c6078/TOUR.ipch differ diff --git a/Debug/Serial.exe b/Debug/Serial.exe index b3305f7..6c06a59 100644 Binary files a/Debug/Serial.exe and b/Debug/Serial.exe differ diff --git a/Debug/Serial.ilk b/Debug/Serial.ilk index 8985c15..7184508 100644 Binary files a/Debug/Serial.ilk and b/Debug/Serial.ilk differ diff --git a/Debug/Serial.pdb b/Debug/Serial.pdb index bcf0e1e..329b42d 100644 Binary files a/Debug/Serial.pdb and b/Debug/Serial.pdb differ diff --git a/Serial/Debug/Serial.log b/Serial/Debug/Serial.log index 95f20f9..1f1ab2a 100644 --- a/Serial/Debug/Serial.log +++ b/Serial/Debug/Serial.log @@ -1,2 +1,2 @@  iterative2.cpp - Serial.vcxproj -> C:\Users\Solomon\Documents\Unity Projects\TopDownStealth\ParallelProgrammingProject\Debug\Serial.exe + Serial.vcxproj -> E:\Other Projects\ParallelProgrammingProject\ParallelProgrammingProject\Debug\Serial.exe diff --git a/Serial/Debug/Serial.tlog/CL.command.1.tlog b/Serial/Debug/Serial.tlog/CL.command.1.tlog index f5fa6c6..a5d3ab6 100644 Binary files a/Serial/Debug/Serial.tlog/CL.command.1.tlog and b/Serial/Debug/Serial.tlog/CL.command.1.tlog differ diff --git a/Serial/Debug/Serial.tlog/CL.read.1.tlog b/Serial/Debug/Serial.tlog/CL.read.1.tlog index 2ba5fde..cac2199 100644 Binary files a/Serial/Debug/Serial.tlog/CL.read.1.tlog and b/Serial/Debug/Serial.tlog/CL.read.1.tlog differ diff --git a/Serial/Debug/Serial.tlog/CL.write.1.tlog b/Serial/Debug/Serial.tlog/CL.write.1.tlog index 4e9dfac..b330b27 100644 Binary files a/Serial/Debug/Serial.tlog/CL.write.1.tlog and b/Serial/Debug/Serial.tlog/CL.write.1.tlog differ diff --git a/Serial/Debug/Serial.tlog/Serial.lastbuildstate b/Serial/Debug/Serial.tlog/Serial.lastbuildstate index de31aa0..cac6afa 100644 --- a/Serial/Debug/Serial.tlog/Serial.lastbuildstate +++ b/Serial/Debug/Serial.tlog/Serial.lastbuildstate @@ -1,2 +1,2 @@ #TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.16299.0 -Debug|Win32|C:\Users\Solomon\Documents\Unity Projects\TopDownStealth\ParallelProgrammingProject\| +Debug|Win32|E:\Other Projects\ParallelProgrammingProject\ParallelProgrammingProject\| diff --git a/Serial/Debug/Serial.tlog/link.read.1.tlog b/Serial/Debug/Serial.tlog/link.read.1.tlog index 9f6c5db..e5acbf9 100644 Binary files a/Serial/Debug/Serial.tlog/link.read.1.tlog and b/Serial/Debug/Serial.tlog/link.read.1.tlog differ diff --git a/Serial/Debug/Serial.tlog/link.write.1.tlog b/Serial/Debug/Serial.tlog/link.write.1.tlog index 9d93c2e..df2b1a0 100644 Binary files a/Serial/Debug/Serial.tlog/link.write.1.tlog and b/Serial/Debug/Serial.tlog/link.write.1.tlog differ diff --git a/Serial/Debug/iterative1.obj b/Serial/Debug/iterative1.obj index a68c3ef..858c126 100644 Binary files a/Serial/Debug/iterative1.obj and b/Serial/Debug/iterative1.obj differ diff --git a/Serial/Debug/iterative2.obj b/Serial/Debug/iterative2.obj index 8e07d64..26aa8a9 100644 Binary files a/Serial/Debug/iterative2.obj and b/Serial/Debug/iterative2.obj differ diff --git a/Serial/Debug/main.obj b/Serial/Debug/main.obj index ae2cdc9..68eb645 100644 Binary files a/Serial/Debug/main.obj and b/Serial/Debug/main.obj differ diff --git a/Serial/Debug/recursive.obj b/Serial/Debug/recursive.obj index c211a81..769a8b0 100644 Binary files a/Serial/Debug/recursive.obj and b/Serial/Debug/recursive.obj differ diff --git a/Serial/Debug/vc141.idb b/Serial/Debug/vc141.idb index 74136e1..ba88d29 100644 Binary files a/Serial/Debug/vc141.idb and b/Serial/Debug/vc141.idb differ diff --git a/Serial/Debug/vc141.pdb b/Serial/Debug/vc141.pdb index 9b67077..71f5126 100644 Binary files a/Serial/Debug/vc141.pdb and b/Serial/Debug/vc141.pdb differ diff --git a/Serial/Serial.vcxproj b/Serial/Serial.vcxproj index 6532161..7224024 100644 --- a/Serial/Serial.vcxproj +++ b/Serial/Serial.vcxproj @@ -123,13 +123,11 @@ - - diff --git a/Serial/Serial.vcxproj.filters b/Serial/Serial.vcxproj.filters index 48821e5..3c2f7d7 100644 --- a/Serial/Serial.vcxproj.filters +++ b/Serial/Serial.vcxproj.filters @@ -27,9 +27,6 @@ Source Files - - Source Files - @@ -41,8 +38,5 @@ Header Files - - Header Files - \ No newline at end of file diff --git a/Serial/Tour.cpp b/Serial/Tour.cpp index 6d23780..0e4a777 100644 --- a/Serial/Tour.cpp +++ b/Serial/Tour.cpp @@ -53,11 +53,6 @@ size_t Tour::GetCityCount() const return size_t(); } -size_t Tour::GetCityCount() const -{ - return size_t(); -} - size_t Tour::GetTotalTourCost() const { return size_t(); diff --git a/Serial/iterative2.cpp b/Serial/iterative2.cpp index 4fcc96b..27f7ba7 100644 --- a/Serial/iterative2.cpp +++ b/Serial/iterative2.cpp @@ -15,7 +15,11 @@ iterative2::~iterative2() //Copies the passed tour and pushes it into the stack int * iterative2::PushCopy(int * tour) { - std::array newTour = tour; + int* newTour = new int[sizeof(tour)]; + for (int i = 0; i < sizeof(tour); i++) + { + newTour[i] = tour[i]; + } theStack.push(newTour); return newTour; } @@ -61,14 +65,23 @@ int iterative2::CityCount(int * currentTour) //Checks if the passed tour is a better tour than the current bestTour bool iterative2::BestTour(int * currentTour) { + //for (int i = 0; i < sizeof(currentTour); i++) + //{ + // cout << currentTour[i] << endl; + //} + int newTour = 0; //current tour score int cTourScore = 0; + //cout << "Got before for loop" << endl; for (int i = 0; i < NUM_CITIES - 1; i++) { newTour += adjMat[currentTour[i]][currentTour[i + 1]]; - currentTour += adjMat[bestTour[i]][bestTour[i + 1]]; + //cout << "newTour = " << newTour << endl; + cTourScore += adjMat[bestTour[i]][bestTour[i + 1]]; + //cout << "currentTour = " << currentTour << endl; } + //cout << "Got through for loop" << endl; newTour += adjMat[currentTour[NUM_CITIES - 1]][currentTour[HOMETOWN]]; cTourScore += adjMat[bestTour[NUM_CITIES - 1]][currentTour[HOMETOWN]]; return newTour < cTourScore; @@ -105,16 +118,17 @@ void iterative2::RemoveLastCity(int * currentTour) //Does a breadth first search to find the best tour using a stack of partial tours void iterative2::DepthFirstSearch(int * currentTour) { - cout << "DepthFirstSearchStarting" << endl; + //cout << "DepthFirstSearchStarting" << endl; PushCopy(currentTour); while (!Empty()) { int* currTour = Pop(); if (CityCount(currTour) == NUM_CITIES) { - cout << "if" << endl; + //cout << "if" << endl; if (BestTour(currTour)) { + //cout << "if" << endl; UpdateBestTour(currTour); } } @@ -122,7 +136,7 @@ void iterative2::DepthFirstSearch(int * currentTour) { for (int nbr = NUM_CITIES - 1; nbr >= 1; nbr--) { - cout << "Else" << endl; + //cout << "Else" << endl; if (Feasible(currTour, nbr)) { AddCity(currTour, nbr);