GaSatSolver Class Reference
[SAT Solver]

#include <GaSatSolver.h>

Inheritance diagram for GaSatSolver:

Inheritance graph
[legend]
Collaboration diagram for GaSatSolver:

Collaboration graph
[legend]

List of all members.


Detailed Description

Solver using GAlib library to solve SAT problem.

Note:
Design pattern simple factory

Definition at line 86 of file GaSatSolver.h.


Public Member Functions

virtual ~GaSatSolver ()
const GAStatistics & getStatistics () const
 Returns useful statistic data managed by GAStatistics class.
virtual SatProblemgetProblem ()
 Returns pointer to instance of SatProblem used by solver.
virtual int getSolutionsCount ()
 Returns current count solutions founded by solver.
virtual SatItemVectorgetSolutionVector ()
 Returns a set of solutions founded by solver.
virtual float minFitness ()
 Returns fitness of the Worst solution managed by solver.
virtual float avgFitness ()
 Returns average fitness computed by solver.
virtual float maxFitness ()
 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.

Static Public Member Functions

static GaSatSolvercreate (SatProblem *problem, const GAParameterList &params)
 Simple factory method.
static void registerDefaultParameters (GAParameterList &params)
 Extends GAParameterList with GA-specific parameters.

Protected Member Functions

 GaSatSolver (SatProblem *problem, const GAParameterList &params)
 Non-public constructor. Use static method create() instead.
virtual void initialize ()
 Initialize process.
virtual void doStep ()
 Do one step of process.
void notify ()
 Send notification to all observers (listeners).

Classes

struct  Private

Constructor & Destructor Documentation

~GaSatSolver (  )  [virtual]

Definition at line 109 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga, GaSatSolver::Private::genome, and GaSatSolver::Private::resultSet.

GaSatSolver ( SatProblem problem,
const GAParameterList &  params 
) [protected]

Non-public constructor. Use static method create() instead.

Parameters:
problem SatProblem instance containing SAT problem to solve.
params GAParameterList containing GA-specific parameters.
Returns:
Returns initialized object of GaSatSolver.
Note:
Design pattern Simple factory

Definition at line 92 of file GaSatSolver.cpp.

References GaSatSolver::Private::fitness(), GaSatSolver::Private::ga, GaSatSolver::Private::genome, SatProblem::getVarsCount(), GaSatSolver::Private::maxFitness, GaSatSolver::Private::problem, GaSatSolver::Private::resultSet, and GaSatSolver::Private::solver.

Referenced by GaSatSolver::create().


Member Function Documentation

GaSatSolver * create ( SatProblem problem,
const GAParameterList &  params 
) [static]

Simple factory method.

Parameters:
problem SatProblem instance containing SAT problem to solve.
params GAParameterList containing GA-specific parameters.
Returns:
Returns initialized object of GaSatSolver.

Definition at line 115 of file GaSatSolver.cpp.

References GaSatSolver::GaSatSolver(), and GaSatSolver::initialize().

void registerDefaultParameters ( GAParameterList &  params  )  [static]

Extends GAParameterList with GA-specific parameters.

Parameters:
params Reference to GAParameterList object managed by caller.

Definition at line 120 of file GaSatSolver.cpp.

const GAStatistics & getStatistics (  )  const

Returns useful statistic data managed by GAStatistics class.

Definition at line 128 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga.

Referenced by main(), and FitnessWatch::notify().

SatProblem * getProblem (  )  [virtual]

Returns pointer to instance of SatProblem used by solver.

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

Implements AbstractSatSolver.

Definition at line 125 of file GaSatSolver.cpp.

References GaSatSolver::Private::problem.

int getSolutionsCount (  )  [virtual]

Returns current count solutions founded by solver.

Returns:
Returns current count solutions founded by solver.

Implements AbstractSatSolver.

Definition at line 131 of file GaSatSolver.cpp.

References SatItemSet::getLength(), and GaSatSolver::Private::resultSet.

SatItemVector * getSolutionVector (  )  [virtual]

Returns a set of solutions founded by solver.

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

Implements AbstractSatSolver.

Definition at line 134 of file GaSatSolver.cpp.

References SatItemSet::createVector(), and GaSatSolver::Private::resultSet.

float minFitness (  )  [virtual]

Returns fitness of the Worst solution managed by solver.

Implements AbstractSatSolver.

Definition at line 137 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga.

float avgFitness (  )  [virtual]

Returns average fitness computed by solver.

Implements AbstractSatSolver.

Definition at line 140 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga.

float maxFitness (  )  [virtual]

Returns the Best fitness founded by solver.

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

Implements AbstractSatSolver.

Definition at line 143 of file GaSatSolver.cpp.

References GaSatSolver::Private::maxFitness.

void initialize (  )  [protected, virtual]

Initialize process.

Note:
Design pattern template method

Implements AbstractProcess.

Definition at line 147 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga, and GaSatSolver::Private::maxFitness.

Referenced by GaSatSolver::create().

void doStep (  )  [protected, virtual]

Do one step of process.

Note:
Design pattern template method

Implements AbstractProcess.

Definition at line 155 of file GaSatSolver.cpp.

References GaSatSolver::Private::ga, and AbstractProcessWatched::stop().

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().

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