BestFit.h

Go to the documentation of this file.
00001 // ---------------------------------------------------------------------
00002 // $Id: BestFit.h 230 2008-08-14 01:45:04Z daaugusto $
00003 //
00004 //   BestFit.h (created on Sat Nov 19 18:00:35 BRT 2005)
00005 // 
00006 //   Genetic Algorithm File Fitter (gaffitter)
00007 //
00008 //   Copyright (C) 2005-2008 Douglas A. Augusto
00009 // 
00010 // This file is part of gaffitter.
00011 // 
00012 // gaffitter is free software; you can redistribute it and/or modify it
00013 // under the terms of the GNU General Public License as published by the
00014 // Free Software Foundation; either version 3 of the License, or (at
00015 // your option) any later version.
00016 // 
00017 // gaffitter is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // General Public License for more details.
00021 // 
00022 // You should have received a copy of the GNU General Public License
00023 // along with gaffitter; if not, see <http://www.gnu.org/licenses/>.
00024 //
00025 // ---------------------------------------------------------------------
00026 
00027 #ifndef BestFit_hh
00028 #define BestFit_hh
00029 
00030 #include "../Optimizer.h"
00031 #include <algorithm>
00032 
00033 // ---------------------------------------------------------------------
00037 class BestFit: public Optimizer {
00038 public:
00042    BestFit( Input& i ): Optimizer( i ) 
00043    {
00044       // sorts files by size (reverse order)
00045       std::sort( m_files.begin(), m_files.end(), SizeName::CmpSizeRev );
00046    }
00047 
00048    ~BestFit() { delete m_solution; }
00049 
00056    void Evolve();
00057 
00058 protected:
00059 
00064    std::ostream& Write( std::ostream& ) const; 
00065 };
00066 
00067 // ---------------------------------------------------------------------
00068 
00069 #endif