#ifndef __WALKSAT_H__ #define __WALKSAT_H__ #include "Formula.h" #include "Assignment.h" //----------------------------------------------------------------------------- // class WalkSat // Encapsulation of the WalkSAT algorithm for solving CNF formulae //----------------------------------------------------------------------------- class WalkSat { protected: float fProbability; // Probability of a random flip int iMaxFlips; // Maximum number of flips public: // Get or set the probability with which WalkSAT will flip at random // or with a purpose void SetProbability( float p ) { this->fProbability = p; } float GetProbability() { return this->fProbability; } // Get or set the number of flips that the WalkSAT algorithm will // perform void SetMaxFlips( int max ) { this->iMaxFlips = max; } int GetMaxFlips() { return this->iMaxFlips; } // Solve the given formula using WalkSAT Assignment* Solve( Formula* f ); }; #endif