METSlib 0.5
mets::best_ever_solution Class Reference

The best ever solution recorder can be used as a simple solution recorder that just records the best copyable solution found during its lifetime. More...

#include <abstract-search.hh>

Inheritance diagram for mets::best_ever_solution:
Inheritance graph
Collaboration diagram for mets::best_ever_solution:
Collaboration graph

Public Member Functions

 best_ever_solution (evaluable_solution &best)
 The mets::evaluable_solution will be stored as a reference: please provide an instance that is not modified/needed elsewhere.
 
 best_ever_solution ()
 Unimplemented default ctor.
 
 best_ever_solution (const best_ever_solution &)
 Unimplemented copy ctor.
 
best_ever_solutionoperator= (const best_ever_solution &)
 Unimplemented assignment operator.
 
bool accept (const feasible_solution &sol)
 Accept is called at the end of each iteration for an opportunity to record the best solution found during the search.
 
const evaluable_solutionbest_seen () const
 Returns the best solution found since the beginning.
 
gol_type best_cost () const
 Best cost seen.
 
- Public Member Functions inherited from mets::solution_recorder
 solution_recorder ()
 Default ctor.
 
 solution_recorder (const solution_recorder &)
 Unimplemented copy ctor.
 
solution_recorderoperator= (const solution_recorder &)
 Unimplemented assignment operator.
 
virtual ~solution_recorder ()
 A virtual dtor.
 

Protected Attributes

evaluable_solutionbest_ever_m
 Records the best solution.
 

Detailed Description

The best ever solution recorder can be used as a simple solution recorder that just records the best copyable solution found during its lifetime.

Constructor & Destructor Documentation

◆ best_ever_solution()

mets::best_ever_solution::best_ever_solution ( evaluable_solution & best)
inline

The mets::evaluable_solution will be stored as a reference: please provide an instance that is not modified/needed elsewhere.

Parameters
bestThe instance used to store the best solution found (will be modified).

Member Function Documentation

◆ accept()

bool mets::best_ever_solution::accept ( const feasible_solution & sol)
inlinevirtual

Accept is called at the end of each iteration for an opportunity to record the best solution found during the search.

Implements mets::solution_recorder.

◆ best_cost()

gol_type mets::best_ever_solution::best_cost ( ) const
inlinevirtual

Best cost seen.

Implements mets::solution_recorder.


The documentation for this class was generated from the following file:

Return to METSlib home page