English
Kamil Dudka

Fast SAT Solver (C++, GAlib)

Detail souboru

Jméno:StáhnoutGaSatSolver_8h-source.html [Stáhnout]
Umístění: fss > doc > api > html
Velikost:14.0 KB
Poslední změna:2022-09-09 13:06

Zdrojový kód

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Fast SAT Solver: GaSatSolver.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.4 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>GaSatSolver.h</h1><a href="GaSatSolver_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2008 Kamil Dudka &lt;xdudka00@stud.fit.vutbr.cz&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of fss (Fast SAT Solver).</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * fss is free software: you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> * any later version.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * fss is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"> *</span>
<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> * along with fss.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"> */</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef GASATSOLVER_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define GASATSOLVER_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="SatSolver_8h.html" title="ISatItem, IObserver and AbstractSatSolver with its base classes.">SatSolver.h</a>"</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">class </span>GAGenome;
<a name="l00034"></a>00034 <span class="keyword">class </span>GABinaryString;
<a name="l00035"></a>00035 <span class="keyword">class </span>GAParameterList;
<a name="l00036"></a>00036 <span class="keyword">class </span>GAGeneticAlgorithm;
<a name="l00037"></a>00037 <span class="keyword">class </span>GAStatistics;
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>FastSatSolver {
<a name="l00040"></a>00040 
<a name="l00045"></a><a class="code" href="classFastSatSolver_1_1GaSatItem.html">00045</a>   <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1GaSatItem.html" title="ISatItem implementation used by GaSatSolver.">GaSatItem</a>: <span class="keyword">public</span> <a class="code" href="classFastSatSolver_1_1ISatItem.html" title="Abstraction of solution candidate.">ISatItem</a> {
<a name="l00046"></a>00046     <span class="keyword">public</span>:
<a name="l00050"></a>00050       <a class="code" href="classFastSatSolver_1_1GaSatItem.html#9a7f9bea9f7f2870c44d1692b989881e">GaSatItem</a>(<span class="keyword">const</span> GABinaryString &amp;bs);
<a name="l00051"></a>00051       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1GaSatItem.html#1ab756a0f3ce624a1d1c0f45cd9b4dde">~GaSatItem</a>();
<a name="l00052"></a>00052       <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1GaSatItem.html#f59b115e86eaeac1f15673766852e428" title="Returns count of bits (resp. variables) managed by object.">getLength</a>() <span class="keyword">const</span>;
<a name="l00053"></a>00053       <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classFastSatSolver_1_1GaSatItem.html#02914b181415dd30b58db5408487a8e1" title="Returns value of desired bit (resp. variable).">getBit</a>(<span class="keywordtype">int</span>) <span class="keyword">const</span>;
<a name="l00054"></a>00054       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1GaSatItem.html" title="ISatItem implementation used by GaSatSolver.">GaSatItem</a>* <a class="code" href="classFastSatSolver_1_1GaSatItem.html#be193dccd5bf6292787bda695498aace" title="Returns clone of object&amp;#39;s instance.">clone</a>() <span class="keyword">const</span>;
<a name="l00055"></a>00055     <span class="keyword">private</span>:
<a name="l00056"></a>00056       <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1GaSatItem_1_1Private.html">Private</a>;
<a name="l00057"></a>00057       <a class="code" href="structFastSatSolver_1_1GaSatItem_1_1Private.html">Private</a> *d;
<a name="l00058"></a>00058   };
<a name="l00059"></a>00059 
<a name="l00067"></a><a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html">00067</a>   <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html" title="Leightweight, optimized ISatItem implementation used by GaSatSolver time-critical...">SatItemGalibAdatper</a>: <span class="keyword">public</span> <a class="code" href="classFastSatSolver_1_1ISatItem.html" title="Abstraction of solution candidate.">ISatItem</a> {
<a name="l00068"></a>00068     <span class="keyword">public</span>:
<a name="l00072"></a>00072       <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html#a16fa6f95b23e204bc8bd49a268e00f3">SatItemGalibAdatper</a>(<span class="keyword">const</span> GABinaryString &amp;bs);
<a name="l00073"></a>00073       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html#b3dfe49bcf358268bd5b67def3472e64">~SatItemGalibAdatper</a>();
<a name="l00074"></a>00074       <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html#f59b115e86eaeac1f15673766852e428" title="Returns count of bits (resp. variables) managed by object.">getLength</a>() <span class="keyword">const</span>;
<a name="l00075"></a>00075       <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html#02914b181415dd30b58db5408487a8e1" title="Returns value of desired bit (resp. variable).">getBit</a>(<span class="keywordtype">int</span>) <span class="keyword">const</span>;
<a name="l00076"></a>00076       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html" title="Leightweight, optimized ISatItem implementation used by GaSatSolver time-critical...">SatItemGalibAdatper</a>* <a class="code" href="classFastSatSolver_1_1SatItemGalibAdatper.html#63bba39b2b1ae2152c70546532ffccc6" title="Returns clone of object&amp;#39;s instance.">clone</a>() <span class="keyword">const</span>;
<a name="l00077"></a>00077     <span class="keyword">private</span>:
<a name="l00078"></a>00078       <span class="keyword">const</span> GABinaryString &amp;bs_;
<a name="l00079"></a>00079   };
<a name="l00080"></a>00080 
<a name="l00086"></a><a class="code" href="classFastSatSolver_1_1GaSatSolver.html">00086</a>   <span class="keyword">class </span><a class="code" href="classFastSatSolver_1_1GaSatSolver.html" title="Solver using GAlib library to solve SAT problem.">GaSatSolver</a>: <span class="keyword">public</span> <a class="code" href="classFastSatSolver_1_1AbstractSatSolver.html" title="SAT Solver base class.">AbstractSatSolver</a>
<a name="l00087"></a>00087   {
<a name="l00088"></a>00088     <span class="keyword">public</span>:
<a name="l00089"></a>00089       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#85731baa47549065bff3846628f55e0f">~GaSatSolver</a>();
<a name="l00090"></a>00090 
<a name="l00097"></a>00097       <span class="keyword">static</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html" title="Solver using GAlib library to solve SAT problem.">GaSatSolver</a>* <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#c162276cd1a753ecbba6e64f367fef60" title="Simple factory method.">create</a>(
<a name="l00098"></a>00098                                  <a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a>             *problem,
<a name="l00099"></a>00099                                  <span class="keyword">const</span> GAParameterList  &amp;params);
<a name="l00100"></a>00100       
<a name="l00105"></a>00105       <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#dfe44037a7f3a1f48e063707acca8c5e" title="Extends GAParameterList with GA-specific parameters.">registerDefaultParameters</a>(GAParameterList &amp;params);
<a name="l00106"></a>00106       
<a name="l00110"></a>00110       <span class="keyword">const</span> GAStatistics&amp; <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#a7b4044638ce63985c719e6f456a8ea5" title="Returns useful statistic data managed by GAStatistics class.">getStatistics</a>() <span class="keyword">const</span>;
<a name="l00111"></a>00111       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a>* <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#0f8b9a0b5b88a1091aee75779d1b7cb7" title="Returns pointer to instance of SatProblem used by solver.">getProblem</a>();
<a name="l00112"></a>00112       <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#7b0abc45218a7539d5c842d0d23d1c2e" title="Returns current count solutions founded by solver.">getSolutionsCount</a>();
<a name="l00113"></a>00113       <span class="keyword">virtual</span> <a class="code" href="classFastSatSolver_1_1SatItemVector.html" title="Linear storage container for ISatItem objects.">SatItemVector</a>* <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#afe4f04b889ee848eb52271ea1f4f9ef" title="Returns a set of solutions founded by solver.">getSolutionVector</a>();
<a name="l00114"></a>00114       <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#3e12cbdb3e43385dc45fc10f703af769" title="Returns fitness of the Worst solution managed by solver.">minFitness</a>();
<a name="l00115"></a>00115       <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#c38f955a6e6a313249883aa555ab36b6" title="Returns average fitness computed by solver.">avgFitness</a>();
<a name="l00116"></a>00116       <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#a4ff4f00ef1022a70f538e32d7a2e07b" title="Returns the Best fitness founded by solver.">maxFitness</a>();
<a name="l00117"></a>00117 
<a name="l00118"></a>00118     <span class="keyword">protected</span>:
<a name="l00126"></a>00126       <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#5800d77805ee60252d59d43e4a786cdc" title="Non-public constructor. Use static method create() instead.">GaSatSolver</a> (<a class="code" href="classFastSatSolver_1_1SatProblem.html" title="SAT Problem module&amp;#39;s facade.">SatProblem</a> *problem, <span class="keyword">const</span> GAParameterList &amp;params);
<a name="l00127"></a>00127 
<a name="l00128"></a>00128       <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#25a40b6614565f755233080a384c35f1" title="Initialize process.">initialize</a>();
<a name="l00129"></a>00129       <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classFastSatSolver_1_1GaSatSolver.html#931514cf013abbc0b9511a44c1f7fe48" title="Do one step of process.">doStep</a>();
<a name="l00130"></a>00130 
<a name="l00131"></a>00131     <span class="keyword">private</span>:
<a name="l00132"></a>00132       <span class="keyword">struct </span><a class="code" href="structFastSatSolver_1_1GaSatSolver_1_1Private.html">Private</a>;
<a name="l00133"></a>00133       <a class="code" href="structFastSatSolver_1_1GaSatSolver_1_1Private.html">Private</a> *d;
<a name="l00134"></a>00134   };
<a name="l00135"></a>00135 
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 } <span class="comment">// namespace FastSatSolver</span>
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 <span class="preprocessor">#endif // GASATSOLVER_H</span>
<a name="l00140"></a>00140 <span class="preprocessor"></span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Wed Nov 5 22:30:21 2008 for Fast SAT Solver by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>
</body>
</html>