Optimizer Class Reference

Base class for the search algorithms. More...

#include <Optimizer.h>

Inheritance diagram for Optimizer:

Inheritance graph
[legend]
Collaboration diagram for Optimizer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Optimizer (Input &i)
 Initialize some variables.
virtual ~Optimizer ()
 Optimizer's destructor.
virtual void Evolve ()=0
 Searches for a optimal solution (via Genetic Algorithm, Best Fit or Split).
void Output ()
 Print the result to the standard output.

Protected Member Functions

virtual std::ostream & Write (std::ostream &s) const
 Write to streams the name and parameters of the search algorithms.
Params::Size_t Evaluate (const BinSet &bs) const
 Evaluate candidates.

Protected Attributes

std::vector< const SizeName * > & m_files
 Vector of input files/sizes.
Paramsm_params
 Global parameters.
const Params::Size_t m_total_size
BinSetm_solution

Private Member Functions

 Optimizer (const Optimizer &)
 Copies are not allowed.
Optimizeroperator= (const Optimizer &)
 Attributions are not allowed.

Friends

std::ostream & operator<< (std::ostream &, const Optimizer &)
 This overloaded operator prints the name and parameters of the search algorithms.


Detailed Description

Base class for the search algorithms.

Constructor & Destructor Documentation

Optimizer::Optimizer ( Input i  )  [inline]

Initialize some variables.

References EPSILON, Params::m_bins_theo, m_params, Params::m_target, m_total_size, Params::m_verbose, and ROUND.

virtual Optimizer::~Optimizer (  )  [inline, virtual]

Optimizer's destructor.

Optimizer::Optimizer ( const Optimizer  )  [private]

Copies are not allowed.


Member Function Documentation

Optimizer& Optimizer::operator= ( const Optimizer  )  [private]

Attributions are not allowed.

virtual void Optimizer::Evolve (  )  [pure virtual]

Searches for a optimal solution (via Genetic Algorithm, Best Fit or Split).

Implemented in BestFit, GeneticAlgorithm, and Split.

Referenced by main().

void Optimizer::Output (  ) 

virtual std::ostream& Optimizer::Write ( std::ostream &  s  )  const [inline, protected, virtual]

Write to streams the name and parameters of the search algorithms.

Reimplemented in BestFit, GeneticAlgorithm, and Split.

References Params::m_bins_theo, m_files, m_params, Params::m_target, and Params::PrettySize().

Referenced by operator<<().

Params::Size_t Optimizer::Evaluate ( const BinSet bs  )  const [protected]

Evaluate candidates.

References BinSet::Count().

Referenced by GeneticAlgorithm::Evaluate().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const Optimizer optimizer 
) [friend]

This overloaded operator prints the name and parameters of the search algorithms.


Member Data Documentation

std::vector<const SizeName*>& Optimizer::m_files [protected]

Total size of the input items.

Referenced by Optimizer(), and Output().

Pointer to the best solution found.

Referenced by Split::Evolve(), GeneticAlgorithm::Evolve(), BestFit::Evolve(), Output(), BestFit::~BestFit(), and Split::~Split().


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