#include <BestFit.h>
Public Member Functions | |
BestFit (Input &i) | |
~BestFit () | |
void | Evolve () |
Protected Member Functions | |
std::ostream & | Write (std::ostream &) const |
BestFit::BestFit | ( | Input & | i | ) | [inline] |
Calls the base constructor and print some information if needed.
References SizeName::CmpSizeRev(), and Optimizer::m_files.
BestFit::~BestFit | ( | ) | [inline] |
References Optimizer::m_solution.
void BestFit::Evolve | ( | ) | [virtual] |
Create a reasonable solution via "Best Fit Search", i.e., select files from bigger to smaller until no more space left (less than target size). This algorithm usually produces locally optimal solutions, however, it is very fast!
Implements Optimizer.
References BinSet::AddBin(), Bin::AddItem(), BinSet::Count(), Optimizer::m_files, Optimizer::m_params, Optimizer::m_solution, Params::m_target, and Params::m_verbose.
std::ostream& BestFit::Write | ( | std::ostream & | ) | const [protected, virtual] |
Writes some information (like algorithm name and parameters) in ostream object (usually cout).
Reimplemented from Optimizer.