1 // This file is part of Golly. 2 // See docs/License.html for the copyright notice. 3 4 #ifndef RULETREEALGO_H 5 #define RULETREEALGO_H 6 #include "ghashbase.h" 7 /** 8 * An algorithm that uses an n-dary decision diagram. 9 */ 10 class ruletreealgo : public ghashbase { 11 public: 12 ruletreealgo() ; 13 virtual ~ruletreealgo() ; 14 virtual state slowcalc(state nw, state n, state ne, state w, state c, 15 state e, state sw, state s, state se) ; 16 virtual const char* setrule(const char* s) ; 17 virtual const char* getrule() ; 18 virtual const char* DefaultRule() ; 19 virtual int NumCellStates() ; 20 static void doInitializeAlgoInfo(staticAlgoInfo &) ; 21 22 // these two methods are needed for RuleLoader algo 23 bool IsDefaultRule(const char* rulename); 24 const char* LoadTree(FILE* rulefile, int lineno, char endchar, const char* s); 25 26 private: 27 int *a, base ; 28 state *b ; 29 int num_neighbors, num_states, num_nodes ; 30 char rule[MAXRULESIZE] ; 31 }; 32 #endif 33