CaDesigner Class Reference

#include <CaDesigner.h>

Inheritance diagram for CaDesigner:

Inheritance graph
[legend]

List of all members.


Detailed Description

Non-uniform CA designer using GAlib library.

Note:
Design pattern simple factory

Mostly copy-pasted from FSS (Fast SAT Solver) project.

Definition at line 265 of file CaDesigner.h.


Public Member Functions

virtual ~CaDesigner ()
const GAStatistics & getStatistics () const
 Return useful statistic data managed by GAStatistics class.
int getSolutionsCount ()
 Return total count of solutions alredy found by designer.
int stopAtGeneration () const
 Return current limit for count of generations.
float minFitness ()
float avgFitness ()
float maxFitness ()
virtual void start ()
 Start process execution.
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 CaDesignercreate (CaEvaluator *evaluator)
 Use this to create CaDesigner object instead of calling constructor directly.

Protected Member Functions

 CaDesigner (CaEvaluator *evaluator)
 Non-public constructor.
virtual void initialize ()
 Initialize process.
virtual void doStep ()
 Do one step of process.
void notify ()
 Send notification to all observers (listeners).

Private Attributes

Private * d

Constructor & Destructor Documentation

~CaDesigner (  )  [virtual]

Definition at line 184 of file CaDesigner.cpp.

References d.

CaDesigner ( CaEvaluator evaluator  )  [protected]

Non-public constructor.

Use static method create() instead.

Definition at line 166 of file CaDesigner.cpp.

References CaEvaluator::caSize(), d, GA_INITAL_NGEN, GA_POP_SIZE, and RULE_WIDTH.

Referenced by create().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

CaDesigner * create ( CaEvaluator evaluator  )  [static]

Use this to create CaDesigner object instead of calling constructor directly.

Parameters:
evaluator An instance of CaEvaluator object which has to be valid until CaDesigner is destroeyd.

Definition at line 192 of file CaDesigner.cpp.

References CaDesigner(), and initialize().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

const GAStatistics & getStatistics (  )  const

Return useful statistic data managed by GAStatistics class.

Definition at line 198 of file CaDesigner.cpp.

References d.

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

Here is the caller graph for this function:

int getSolutionsCount (  ) 

Return total count of solutions alredy found by designer.

Definition at line 202 of file CaDesigner.cpp.

References d.

Referenced by ResultsWatch::notify().

Here is the caller graph for this function:

int stopAtGeneration (  )  const

Return current limit for count of generations.

Definition at line 206 of file CaDesigner.cpp.

References d.

Referenced by writeStats().

Here is the caller graph for this function:

float minFitness (  ) 

Definition at line 210 of file CaDesigner.cpp.

References d.

Referenced by writeStats().

Here is the caller graph for this function:

float avgFitness (  ) 

Definition at line 214 of file CaDesigner.cpp.

References d.

Referenced by writeStats().

Here is the caller graph for this function:

float maxFitness (  ) 

Definition at line 218 of file CaDesigner.cpp.

References d.

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

Here is the caller graph for this function:

void initialize (  )  [protected, virtual]

Initialize process.

Note:
Design pattern template method

Implements AbstractProcess.

Definition at line 223 of file CaDesigner.cpp.

References d, and GA_INITAL_NGEN.

Referenced by create().

Here is the caller graph for this function:

void doStep (  )  [protected, virtual]

Do one step of process.

Note:
Design pattern template method

Implements AbstractProcess.

Definition at line 231 of file CaDesigner.cpp.

References C_NO_COLOR, C_YELLOW, d, and AbstractProcessWatched::stop().

Here is the call graph for this function:

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 399 of file CaDesigner.cpp.

References AbstractProcess::start().

Here is the call graph for this function:

void stop (  )  [virtual, inherited]

Stop currently executed process as soon as possible.

Reimplemented from AbstractProcess.

Definition at line 406 of file CaDesigner.cpp.

References AbstractProcess::stop().

Referenced by doStep().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset (  )  [virtual, inherited]

Reset process to its initial state.

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

Reimplemented from AbstractProcess.

Definition at line 415 of file CaDesigner.cpp.

References AbstractProcess::reset().

Here is the call graph for this function:

long getTimeElapsed (  )  [virtual, inherited]

Returns time elapsed by activity.

Returns:
Returns time elapsed by activity.

Definition at line 422 of file CaDesigner.cpp.

Referenced by writeStats().

Here is the caller graph for this function:

int getStepsCount (  )  [virtual, inherited]

Returns current step number.

Returns:
Returns current step number.

Definition at line 369 of file CaDesigner.cpp.

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 320 of file CaDesigner.cpp.

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 324 of file CaDesigner.cpp.

References IObserver::notify().

Referenced by AbstractProcess::start().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Private* d [private]

Reimplemented from AbstractProcessWatched.

Definition at line 307 of file CaDesigner.h.

Referenced by avgFitness(), CaDesigner(), doStep(), getSolutionsCount(), getStatistics(), initialize(), maxFitness(), minFitness(), stopAtGeneration(), and ~CaDesigner().


The documentation for this class was generated from the following files:
Generated on Sat May 2 16:39:37 2009 for nucad by  doxygen 1.5.4