Skip to main content
. 2018 Oct 1;20(10):756. doi: 10.3390/e20100756
Algorithm 1: RGEP chromosome evaluation procedure.
for Each gene in chromosome do
if The gene is an operator then
  if Number of elements on stack ≥ arity of the operator then
   Pop necessary operands from stack
   Execute the operator
   Push the result back on stack
  end if
else  //Comment: the gene is an operand
  Push the operand on stack
end if
end for
The topmost element on the stack is the value of the evaluated expression.