The central class used for gene coding is TGenCode. Problem specifications are encoded into gene (see User's Guide). Each specification is either integer or a real number, is encoded binary or using Gray encoding, has its accuracy, has its bounds (min_value and max_value) and is either a scalar value or a vector. Specification encoded into gene is also called gene part.
In fitness expression the user can use gene parts for fitness evaluation. Gene part is transformed into an element in the expression stack (see fitness function) as type variable. When the expression stack is produced this variable must be translated to a corresponding number. This means indexing into array of gene parts (if this gene part is a vector then another indexing inside the vector has to be performed.
Storing ratio p is counted for each gene part (p=(max_value-min_value)/2^accuracy). It says how to scale specification value so it is possible to store this value into space available in the specific gene part. We recommend to use p <= 1 for integers and for real numbers the smaller the value of p the better.
Coding (specification->gene part):where:
i is the index of specification/gene part
j is the index of element in specification/gene part