00001 /* 00002 * Copyright (C) 2008 Kamil Dudka <xdudka00@stud.fit.vutbr.cz> 00003 * 00004 * This file is part of fss (Fast SAT Solver). 00005 * 00006 * fss is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * any later version. 00010 * 00011 * fss is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with fss. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef GASATSOLVER_H 00021 #define GASATSOLVER_H 00022 00031 #include "SatSolver.h" 00032 00033 class GAGenome; 00034 class GABinaryString; 00035 class GAParameterList; 00036 class GAGeneticAlgorithm; 00037 class GAStatistics; 00038 00039 namespace FastSatSolver { 00040 00045 class GaSatItem: public ISatItem { 00046 public: 00050 GaSatItem(const GABinaryString &bs); 00051 virtual ~GaSatItem(); 00052 virtual int getLength() const; 00053 virtual bool getBit(int) const; 00054 virtual GaSatItem* clone() const; 00055 private: 00056 struct Private; 00057 Private *d; 00058 }; 00059 00067 class SatItemGalibAdatper: public ISatItem { 00068 public: 00072 SatItemGalibAdatper(const GABinaryString &bs); 00073 virtual ~SatItemGalibAdatper(); 00074 virtual int getLength() const; 00075 virtual bool getBit(int) const; 00076 virtual SatItemGalibAdatper* clone() const; 00077 private: 00078 const GABinaryString &bs_; 00079 }; 00080 00086 class GaSatSolver: public AbstractSatSolver 00087 { 00088 public: 00089 virtual ~GaSatSolver(); 00090 00097 static GaSatSolver* create( 00098 SatProblem *problem, 00099 const GAParameterList ¶ms); 00100 00105 static void registerDefaultParameters(GAParameterList ¶ms); 00106 00110 const GAStatistics& getStatistics() const; 00111 virtual SatProblem* getProblem(); 00112 virtual int getSolutionsCount(); 00113 virtual SatItemVector* getSolutionVector(); 00114 virtual float minFitness(); 00115 virtual float avgFitness(); 00116 virtual float maxFitness(); 00117 00118 protected: 00126 GaSatSolver (SatProblem *problem, const GAParameterList ¶ms); 00127 00128 virtual void initialize(); 00129 virtual void doStep(); 00130 00131 private: 00132 struct Private; 00133 Private *d; 00134 }; 00135 00136 00137 } // namespace FastSatSolver 00138 00139 #endif // GASATSOLVER_H 00140
1.5.4