#include <Ca.h>
Moreover it can gathers various statistics about the CA's run, mostly useful to present the found solution to user.
Definition at line 282 of file Ca.h.
Public Member Functions | ||||
| CaEvaluator (const IGate &gate, const IGateBinding &binding, const CaEvalParams ¶ms) | ||||
| ||||
| ~CaEvaluator () | ||||
| size_t | caSize () const | |||
| Return size of CA in one direction. | ||||
| float | eval (const ICaRules *ca) | |||
| Evaluate given CA and compute its fitness. | ||||
| bool | cntSteps (const ICaRules *ca, unsigned &min, unsigned &max) | |||
| Simulate given CA and check how much steps it needs to compute the desired result. | ||||
| void | simulate (const ICaRules *ca, std::ostream &str, TBus in) | |||
| Simulate given CA for given input and dump to stream in human-readable (colorized if possible) format. | ||||
| void | simulate (const ICaRules *ca, std::ostream &str) | |||
| Simulate given CA for all possible inputs and dump to stream in human-readable (colorized if possible) format. | ||||
Private Attributes | ||||
| Private * | d | |||
| CaEvaluator | ( | const IGate & | gate, | |
| const IGateBinding & | binding, | |||
| const CaEvalParams & | params | |||
| ) |
| gate | Gate definition used to compute CA's fitness. |
| binding | Binding object defining gate-CA signals mapping. | |
| params | Additional evaluation parameters. |
Definition at line 209 of file Ca.cpp.
References IGateBinding::clone(), IGate::clone(), and d.

| ~CaEvaluator | ( | ) |
| size_t caSize | ( | ) | const |
Return size of CA in one direction.
Definition at line 226 of file Ca.cpp.
References d.
Referenced by CaDesigner::CaDesigner(), main(), and simulate().

| float eval | ( | const ICaRules * | ca | ) |
Evaluate given CA and compute its fitness.
| ca | Non-uniform CA defined by the set of rules. |
Definition at line 230 of file Ca.cpp.
References applyRules(), d, IGateBinding::getOutput(), and IGateBinding::setInput().
Referenced by main().


| bool cntSteps | ( | const ICaRules * | ca, | |
| unsigned & | min, | |||
| unsigned & | max | |||
| ) |
Simulate given CA and check how much steps it needs to compute the desired result.
The maximum is bounded by params.nSteps value given as initialization parameter.
| ca | Non-uniform CA defined by the set of rules. | |
| min | Destination to store minimal steps value. | |
| max | Destination to store maximal steps value. |
Definition at line 288 of file Ca.cpp.
References applyRules(), d, IGateBinding::getOutput(), and IGateBinding::setInput().
Referenced by main().


Simulate given CA for given input and dump to stream in human-readable (colorized if possible) format.
| ca | Non-uniform CA defined by the set of rules. | |
| str | Standard output stream to dump the output. | |
| in | Desired gate's input to simulate CA for. |
Definition at line 381 of file Ca.cpp.
References applyRules(), C_LIGHT_BLUE, C_NO_COLOR, caSize(), d, IGateBinding::setInput(), IGateBinding::setOutput(), and writeCaState().
Referenced by main(), and simulate().


| void simulate | ( | const ICaRules * | ca, | |
| std::ostream & | str | |||
| ) |
Simulate given CA for all possible inputs and dump to stream in human-readable (colorized if possible) format.
| str | Standard output stream to dump the output. | |
| ca | Non-uniform CA defined by the set of rules. |
Definition at line 417 of file Ca.cpp.
References C_LIGHT_GREEN, C_NO_COLOR, d, and simulate().

Private* d [private] |
Definition at line 336 of file Ca.h.
Referenced by CaEvaluator(), caSize(), cntSteps(), eval(), simulate(), and ~CaEvaluator().
1.5.4