22 #ifndef SIMPLIFICATION_H_INCLUDED 23 #define SIMPLIFICATION_H_INCLUDED 29 extern bool RANDOM_SEED;
31 extern const int NUMBER_OF_MUTATIONS;
33 extern const int NATURAL_SELECTION;
35 extern const int NUMBER_OF_GENERATION;
37 extern const int GENERATION_BEFORE_SELECTION;
78 const Expr& newAlternate,
79 bool add_factor_expand=
true);
120 Expr
Simplify(
const Expr& expr,
int depth=-1);
122 int numberOfMutatingNodes(
const Expr& expr);
124 bool insertSortMutant(csl::vector_expr& vec,
const Expr& newExpr);
126 bool addMutants(csl::vector_expr& individuals,
127 const csl::vector_expr& mutants);
129 csl::vector_expr getRandomMutation(
const Expr& expr);
131 void naturalSelection(csl::vector_expr& individuals);
133 Expr evolve(
const Expr& baseIndividual);
const int MAX_ALTERNATE_FORMS
Maximum number of alternate forms given by getRecursiveAlternateForms(). When getting alternate forms...
Definition: alternateForms.cpp:39
void addAlternateForm(csl::vector_expr &alternateForms, const Expr &newAlternate, bool add_factor_expand=true)
Tried to add newAlternate in the set alternateForms. We simply test if the alternate is already prese...
Definition: alternateForms.cpp:48
Namespace for csl library.
Definition: abreviation.h:34
Expr Simplify(const Expr &expr, int depth=-1)
Simplifies expr depending on its type.
Definition: alternateForms.cpp:230
csl::vector_expr getRecursiveAlternateForms(const Expr &expr, int depth=-1)
Returns the alternate forms of expr by applying recursively internalRecursiveAlternateForms() MAX_REC...
Definition: alternateForms.cpp:110
const int SIMPLIFICATION_METHOD
Determines which simplification method is applied. Ther used to be 2, now there is only one method...
Definition: alternateForms.cpp:38
void clearRedundancyAlternate(csl::vector_expr &alternateForms)
Search and remove redundancies (equal alternate forms) in alternateForms.
Definition: alternateForms.cpp:100
const int MAX_RECURSION_ALTERNATE
When getting alternateForms, we iterate MAX_RECURSION_ALTERNATE times (getting alternate forms of the...
Definition: alternateForms.cpp:40
csl::vector_expr internalRecursiveAlternateForms(const Expr &expr, int depth=-1)
Calculates and return all alternate forms of expr, by getting (once) alternate forms of the possible ...
Definition: alternateForms.cpp:156
Base classes for all exprs in the program.
void printVector(const csl::vector_expr &vector)
Display a vector of expressions. Useful in debug.
Definition: alternateForms.cpp:42
void reduceAlternate(csl::vector_expr &alternateForms)
Reduces the number of elements in alternateForms to MAX_ALTERNATE_FORMS.
Definition: alternateForms.cpp:72