Commit 12b109f8 authored by Robert Ricci's avatar Robert Ricci

Fix the names of some very badly-name variables

The 'best' variable didn't really store the best score seen so far,
so rename it to prev_score. Likewise for the bestviolated variable.
parent 26e0a6c6
This diff is collapsed.
...@@ -84,8 +84,8 @@ extern float temp_rate; ...@@ -84,8 +84,8 @@ extern float temp_rate;
extern pclass_types type_table; extern pclass_types type_table;
extern pclass_list pclasses; extern pclass_list pclasses;
extern pnode_pvertex_map pnode2vertex; extern pnode_pvertex_map pnode2vertex;
extern double absbest; extern double best_score;
extern int absbestviolated, iters, iters_to_best; extern int best_violated, iters, iters_to_best;
extern bool allow_overload; extern bool allow_overload;
#ifdef PER_VNODE_TT #ifdef PER_VNODE_TT
......
...@@ -145,9 +145,19 @@ bool ptop_rspec_input = false; ...@@ -145,9 +145,19 @@ bool ptop_rspec_input = false;
bool vtop_rspec_input = false; bool vtop_rspec_input = false;
#endif #endif
// XXX - shouldn't be in this file /*
double absbest; * Score and violations for the best score found so far
int absbestviolated, iters, iters_to_best; * XXX - shouldn't be in this file
*/
double best_score;
int best_violated;
/*
* Number of iterations executed so far, and how many it took us to find the
* best solution
* XXX - shouldn't be in this file
*/
int iters, iters_to_best;
// Map of all physical types in use in the system // Map of all physical types in use in the system
tb_ptype_map ptypes; tb_ptype_map ptypes;
...@@ -831,7 +841,7 @@ void exit_unretryable(int signal) { ...@@ -831,7 +841,7 @@ void exit_unretryable(int signal) {
extern double temp; extern double temp;
void status_report(int signal) { void status_report(int signal) {
cout << "I: " << iters << " T: " << temp << " S: " << get_score() << " V: " cout << "I: " << iters << " T: " << temp << " S: " << get_score() << " V: "
<< violated << " (Best S: " << absbest << " V:" << absbestviolated << ")" << violated << " (Best S: " << best_score << " V:" << best_violated << ")"
<< endl; << endl;
cout.flush(); cout.flush();
} }
...@@ -1218,11 +1228,11 @@ int main(int argc,char **argv) { ...@@ -1218,11 +1228,11 @@ int main(int argc,char **argv) {
fclose(deltaout); fclose(deltaout);
#endif #endif
if ((!compare_scores(get_score(),absbest)) || (violated > absbestviolated)) { if ((!compare_scores(get_score(),best_score)) || (violated > best_violated)) {
cout << "WARNING: Internal scoring inconsistency." << endl; cout << "WARNING: Internal scoring inconsistency." << endl;
cout << "score:" << get_score() << " absbest:" << absbest << cout << "score:" << get_score() << " best_score:" << best_score <<
" violated:" << violated << " absbestviolated:" << " violated:" << violated << " best_violated:" <<
absbestviolated << endl; best_violated << endl;
} }
cout << " BEST SCORE: " << get_score() << " in " << iters << cout << " BEST SCORE: " << get_score() << " in " << iters <<
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment