Skip to content

Commit

Permalink
Rename plateau_local_minimum with plateau_escape
Browse files Browse the repository at this point in the history
  • Loading branch information
richoux committed Jun 18, 2024
1 parent bdccff4 commit 2d93d21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/search_unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ namespace ghost
{
data.tabu_list[ variable_to_change ] = options.tabu_time_local_min + data.local_moves;
must_compute_variable_candidates = true;
++data.plateau_local_minimum;
++data.plateau_escape;
#if defined GHOST_TRACE
COUT << "Escape from plateau; variables marked as tabu.\n";
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/search_unit_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace ghost
int search_iterations;
int local_minimum;
int plateau_moves;
int plateau_local_minimum;
int plateau_escape;

SearchUnitData( const Model& model )
: number_variables ( static_cast<int>( model.variables.size() ) ),
Expand All @@ -89,7 +89,7 @@ namespace ghost
search_iterations ( 0 ),
local_minimum ( 0 ),
plateau_moves ( 0 ),
plateau_local_minimum ( 0 )
plateau_escape ( 0 )
{ }

void initialize_matrix( const Model& model )
Expand Down
22 changes: 12 additions & 10 deletions include/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace ghost
int _search_iterations_total;
int _local_minimum_total;
int _plateau_moves_total;
int _plateau_local_minimum_total;
int _plateau_escape_total;

// stats of the winning thread
int _restarts;
Expand All @@ -143,7 +143,7 @@ namespace ghost
int _search_iterations;
int _local_minimum;
int _plateau_moves;
int _plateau_local_minimum;
int _plateau_escape;

std::string _variable_heuristic;
std::string _variable_candidates_heuristic;
Expand Down Expand Up @@ -365,14 +365,14 @@ namespace ghost
_search_iterations_total( 0 ),
_local_minimum_total( 0 ),
_plateau_moves_total( 0 ),
_plateau_local_minimum_total( 0 ),
_plateau_escape_total( 0 ),
_restarts( 0 ),
_resets( 0 ),
_local_moves( 0 ),
_search_iterations( 0 ),
_local_minimum( 0 ),
_plateau_moves( 0 ),
_plateau_local_minimum( 0 )
_plateau_escape( 0 )
{ }

/*!
Expand Down Expand Up @@ -534,7 +534,7 @@ namespace ghost
_search_iterations = search_unit.data.search_iterations;
_local_minimum = search_unit.data.local_minimum;
_plateau_moves = search_unit.data.plateau_moves;
_plateau_local_minimum = search_unit.data.plateau_local_minimum;
_plateau_escape = search_unit.data.plateau_escape;

_variable_heuristic = search_unit.variable_heuristic->get_name();
_variable_candidates_heuristic = search_unit.variable_candidates_heuristic->get_name();
Expand Down Expand Up @@ -658,7 +658,7 @@ namespace ghost
_search_iterations_total += units.at(i).data.search_iterations;
_local_minimum_total += units.at(i).data.local_minimum;
_plateau_moves_total += units.at(i).data.plateau_moves;
_plateau_local_minimum_total += units.at(i).data.plateau_local_minimum;
_plateau_escape_total += units.at(i).data.plateau_escape;
}

// ..then the most important: the best solution found so far.
Expand All @@ -676,7 +676,7 @@ namespace ghost
_search_iterations = units.at( winning_thread ).data.search_iterations;
_local_minimum = units.at( winning_thread ).data.local_minimum;
_plateau_moves = units.at( winning_thread ).data.plateau_moves;
_plateau_local_minimum = units.at( winning_thread ).data.plateau_local_minimum;
_plateau_escape = units.at( winning_thread ).data.plateau_escape;

_variable_heuristic = units.at( winning_thread ).variable_heuristic->get_name();
_variable_candidates_heuristic = units.at( winning_thread ).variable_candidates_heuristic->get_name();
Expand Down Expand Up @@ -712,7 +712,7 @@ namespace ghost
_search_iterations = units.at( best_non_solution ).data.search_iterations;
_local_minimum = units.at( best_non_solution ).data.local_minimum;
_plateau_moves = units.at( best_non_solution ).data.plateau_moves;
_plateau_local_minimum = units.at( best_non_solution ).data.plateau_local_minimum;
_plateau_escape = units.at( best_non_solution ).data.plateau_escape;

_variable_heuristic = units.at( best_non_solution ).variable_heuristic->get_name();
_variable_candidates_heuristic = units.at( best_non_solution ).variable_candidates_heuristic->get_name();
Expand Down Expand Up @@ -807,14 +807,16 @@ namespace ghost
<< "Satisfaction error: " << _best_sat_error << "\n"
<< "Number of search iterations: " << _search_iterations << "\n"
<< "Number of local moves: " << _local_moves << " (including on plateau: " << _plateau_moves << ")\n"
<< "Number of local minimum: " << _local_minimum << " (including on plateau: " << _plateau_local_minimum << ")\n"
<< "Number of local minimum: " << _local_minimum << "\n"
<< "Number of plateau escapes: " << _plateau_escape << "\n"
<< "Number of resets: " << _resets << "\n"
<< "Number of restarts: " << _restarts << "\n";

if( _options.parallel_runs )
std::cout << "Total number of search iterations: " << _search_iterations_total << "\n"
<< "Total number of local moves: " << _local_moves_total << " (including on plateau: " << _plateau_moves_total << ")\n"
<< "Total number of local minimum: " << _local_minimum_total << " (including on plateau: " << _plateau_local_minimum_total << ")\n"
<< "Total number of local minimum: " << _local_minimum_total << "\n"
<< "Total number of plateau escapes: " << _plateau_escape_total << "\n"
<< "Total number of resets: " << _resets_total << "\n"
<< "Total number of restarts: " << _restarts_total << "\n";

Expand Down

0 comments on commit 2d93d21

Please sign in to comment.