AbstractSatSolver Class Reference
[SAT Solver]

#include <SatSolver.h>

Inheritance diagram for AbstractSatSolver:

Inheritance graph
[legend]
Collaboration diagram for AbstractSatSolver:

Collaboration graph
[legend]

List of all members.


Detailed Description

SAT Solver base class.

It defines common interface (and partially behavior) for both solver implementations - BlindSolver and GaSolver.

Definition at line 328 of file SatSolver.h.


Public Member Functions

virtual ~AbstractSatSolver ()
virtual SatProblemgetProblem ()=0
 Returns pointer to instance of SatProblem used by solver.
virtual int getSolutionsCount ()=0
 Returns current count solutions founded by solver.
virtual SatItemVectorgetSolutionVector ()=0
 Returns a set of solutions founded by solver.
virtual float minFitness ()=0
 Returns fitness of the Worst solution managed by solver.
virtual float avgFitness ()=0
 Returns average fitness computed by solver.
virtual float maxFitness ()=0
 Returns the Best fitness founded by solver.
virtual void start ()
 Start process execution. This method returns control after process ends (or after it is stopped by stop() or reset() method).
virtual void stop ()
 Stop currently executed process as soon as possible.
virtual void reset ()
 Reset process to its initial state.
virtual long getTimeElapsed ()
 Returns time elapsed by activity.
virtual int getStepsCount ()
 Returns current step number.
virtual void addObserver (IObserver *)
 Add observer to list of listeners.

Protected Member Functions

 AbstractSatSolver ()
virtual void initialize ()=0
 Initialize process.
virtual void doStep ()=0
 Do one step of process.
void notify ()
 Send notification to all observers (listeners).

Constructor & Destructor Documentation

~AbstractSatSolver (  )  [virtual]

Definition at line 147 of file SatSolver.cpp.

AbstractSatSolver (  )  [protected]

Definition at line 146 of file SatSolver.cpp.


Member Function Documentation

virtual SatProblem* getProblem (  )  [pure virtual]

Returns pointer to instance of SatProblem used by solver.

Returns:
Returns pointer to instance of SatProblem used by solver.

Implemented in BlindSatSolver, and GaSatSolver.

virtual int getSolutionsCount (  )  [pure virtual]

Returns current count solutions founded by solver.

Returns:
Returns current count solutions founded by solver.

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by ResultsWatch::notify(), and SolutionsCountStop::notify().

virtual SatItemVector* getSolutionVector (  )  [pure virtual]

Returns a set of solutions founded by solver.

Returns:
Returns on heap allocated instance of SatItemVector containing solutions founded by solver.

Implemented in BlindSatSolver, and GaSatSolver.

virtual float minFitness (  )  [pure virtual]

Returns fitness of the Worst solution managed by solver.

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by FitnessWatch::notify().

virtual float avgFitness (  )  [pure virtual]

Returns average fitness computed by solver.

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by FitnessWatch::notify().

virtual float maxFitness (  )  [pure virtual]

Returns the Best fitness founded by solver.

Note:
This should be always 1.0 if solution was found.

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by FitnessWatch::notify().

void start (  )  [virtual, inherited]

Start process execution. This method returns control after process ends (or after it is stopped by stop() or reset() method).

Reimplemented from AbstractProcess.

Definition at line 111 of file SatSolver.cpp.

References AbstractProcessWatched::Private::running, AbstractProcess::start(), and AbstractProcessWatched::Private::start.

void stop (  )  [virtual, inherited]

Stop currently executed process as soon as possible.

Reimplemented from AbstractProcess.

Definition at line 117 of file SatSolver.cpp.

References AbstractProcessWatched::Private::currentElapsed(), AbstractProcessWatched::Private::running, AbstractProcess::stop(), and AbstractProcessWatched::Private::total.

Referenced by GaSatSolver::doStep(), BlindSatSolver::doStep(), TimedStop::notify(), and SolutionsCountStop::notify().

void reset (  )  [virtual, inherited]

Reset process to its initial state.

Note:
This implies stop() if process is running.

Reimplemented from AbstractProcess.

Definition at line 125 of file SatSolver.cpp.

References AbstractProcess::reset(), AbstractProcessWatched::Private::running, and AbstractProcessWatched::Private::total.

long getTimeElapsed (  )  [virtual, inherited]

Returns time elapsed by activity.

Returns:
Returns time elapsed by activity.

Implements IStopWatch.

Definition at line 131 of file SatSolver.cpp.

References AbstractProcessWatched::Private::currentElapsed(), AbstractProcessWatched::Private::running, and AbstractProcessWatched::Private::total.

Referenced by ResultsWatch::notify(), FitnessWatch::notify(), and TimedStop::notify().

int getStepsCount (  )  [virtual, inherited]

Returns current step number.

Returns:
Returns current step number.

Definition at line 86 of file SatSolver.cpp.

References AbstractProcess::Private::steps.

Referenced by ProgressWatch::notify().

virtual void initialize (  )  [protected, pure virtual, inherited]

Initialize process.

Note:
Design pattern template method

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by AbstractProcess::reset().

virtual void doStep (  )  [protected, pure virtual, inherited]

Do one step of process.

Note:
Design pattern template method

Implemented in BlindSatSolver, and GaSatSolver.

Referenced by AbstractProcess::start().

void addObserver ( IObserver observer  )  [virtual, inherited]

Add observer to list of listeners.

Parameters:
observer Observer object to add to list of listeners.
Note:
Observers are notified in the same order, as there are added to lsit of listeners.

Design pattern observer

Implements ISubject.

Definition at line 46 of file SatSolver.cpp.

References AbstractSubject::Private::container.

Referenced by main().

void notify (  )  [protected, inherited]

Send notification to all observers (listeners).

Note:
Observers are notified in the same order, as there are added to lsit of listeners.

Definition at line 49 of file SatSolver.cpp.

References AbstractSubject::Private::container, and IObserver::notify().

Referenced by BlindSatSolver::doStep(), GaSatSolver::Private::fitness(), and AbstractProcess::start().


The documentation for this class was generated from the following files:
Generated on Wed Nov 5 22:30:22 2008 for Fast SAT Solver by  doxygen 1.5.4