Skip to content

Commit

Permalink
Improving auto-tuning output messages
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Jun 14, 2024
1 parent aa74703 commit 6158867
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/apex/exhaustive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ void Exhaustive::evaluate(double new_cost) {
if (new_cost < cost) {
if (new_cost < best_cost) {
best_cost = new_cost;
std::cout << "New best! " << new_cost << " k: " << k;
std::cout << "New best! " << new_cost << " k: " << k
<< " kmax: " << kmax;
for (auto& v : vars) { v.second.save_best(); }
for (auto& v : vars) { std::cout << ", " << v.first << ": " << v.second.toString(); }
std::cout << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/apex/genetic_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ void GeneticSearch::evaluate(double new_cost) {
if (new_cost < cost) {
if (new_cost < best_cost) {
best_cost = new_cost;
std::cout << "New best! " << new_cost << " k: " << k;
std::cout << "New best! " << new_cost << " k: " << k
<< " kmax: " << kmax;
for (auto& v : vars) { v.second.save_best(); }
for (auto& v : vars) { std::cout << ", " << v.first << ": " << v.second.toString(); }
std::cout << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/apex/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void Random::evaluate(double new_cost) {
if (new_cost < cost) {
if (new_cost < best_cost) {
best_cost = new_cost;
std::cout << "New best! " << new_cost << " k: " << k;
std::cout << "New best! " << new_cost << " k: " << k
<< " kmax: " << kmax;
for (auto& v : vars) { v.second.save_best(); }
for (auto& v : vars) { std::cout << ", " << v.first << ": " << v.second.toString(); }
std::cout << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/apex/simulated_annealing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ void SimulatedAnnealing::evaluate(double new_cost) {
for (auto& v : vars) { v.second.choose_neighbor(); }
if (new_cost < best_cost) {
best_cost = new_cost;
std::cout << "New best! " << new_cost << " k: " << k << " temp: " << temp;
std::cout << "New best! " << new_cost << " k: " << k
<< " kmax: " << kmax << " temp: " << temp;
for (auto& v : vars) { v.second.save_best(); }
for (auto& v : vars) { std::cout << ", " << v.first << ": " << v.second.toString(); }
std::cout << std::endl;
Expand Down

0 comments on commit 6158867

Please sign in to comment.