Definition in file Ca.cpp.
#include "config.h"
#include "Ca.h"
#include "Color.h"

Go to the source code of this file.
Functions | |
| std::ostream & | operator<< (std::ostream &str, const CaState &ca) |
| Write CA state in human-readable (colorized if possible) format. | |
| void | writeRule (std::ostream &str, const TRule5N &rule) |
| Write CA rule in human-readable (colorized if possible) format. | |
| bool | applyRule (const CaState &ca, Pos pos, const TRule5N &rule) |
| Return the result of applied rule. | |
| bool | applyRules (CaState &ca, const ICaRules *rules) |
| Apply the given rule set on given CA state synchronously and check if anything is changed. | |
| void | writeCaState (std::ostream &str, const CaState &state, const CaState &inputs, const CaState &outputs, const CaState &desiredOutputs, const CaState &lastState, bool preferInput=false) |
Return the result of applied rule.
The given CA is not changed at all.
| ca | The CA's state to compute new value for. | |
| pos | Position of the cell to compute the new value for. | |
| rule | The rule ought to be applied. |
Definition at line 97 of file Ca.cpp.
References D_BOTTOM, D_LEFT, D_RIGHT, D_TOP, CaState::getCellAtPos(), and neighbor().
Referenced by applyRules().


Apply the given rule set on given CA state synchronously and check if anything is changed.
| state | CA state to apply the rule set on. | |
| rules | The set of rules ought to be applied. |
Definition at line 123 of file Ca.cpp.
References applyRule(), ICaRules::getRuleAtPos(), CaState::setCellAtPos(), and CaState::size().
Referenced by CaEvaluator::cntSteps(), CaEvaluator::eval(), and CaEvaluator::simulate().


| std::ostream& operator<< | ( | std::ostream & | str, | |
| const CaState & | state | |||
| ) |
Write CA state in human-readable (colorized if possible) format.
| str | Standard output stream to write to. | |
| state | The CA state ought to be write. |
Definition at line 37 of file Ca.cpp.
References CaState::getCellAtPos(), and CaState::size().

| void @0::writeCaState | ( | std::ostream & | str, | |
| const CaState & | state, | |||
| const CaState & | inputs, | |||
| const CaState & | outputs, | |||
| const CaState & | desiredOutputs, | |||
| const CaState & | lastState, | |||
| bool | preferInput = false | |||
| ) | [static] |
Definition at line 330 of file Ca.cpp.
References C_LIGHT_BLUE, C_LIGHT_GREEN, C_LIGHT_RED, C_NO_COLOR, C_YELLOW, CaState::getCellAtPos(), and CaState::size().
Referenced by CaEvaluator::simulate().


| void writeRule | ( | std::ostream & | str, | |
| const TRule5N & | rule | |||
| ) |
Write CA rule in human-readable (colorized if possible) format.
| str | Standard output stream to write to. | |
| rule | The CA rule ought to be write. |
Definition at line 46 of file Ca.cpp.
References C_LIGHT_GREEN, C_LIGHT_RED, C_NO_COLOR, and RULE_WIDTH.
Referenced by writeRules().

1.5.4