Closed xgdgsc closed 5 years ago
Hi @xgdgsc,
The GE backend doesn't currently support the () construct. The genotype in GE is a string of integers and the sequential nature means that the types can change if an integer occurring before it changes (which happens when applying genetic operators). As a result, it is not simple to add () support for GE.
In your second code snippet, you have 2 M
's in the expression. Each M
is treated as a separate nonterminal. The simplest way to avoid this is to define another function:
Fun2(sig, M, Add) = Fun(sig, M+Add, M)
and use Fun2 in the grammar instead.
Thanks. That works for me.
I have a function
Fun(sig,N, M)
that needs input constrains like N > M, so I tried using grammer ofand it doesn' t support this kind. Using
rand
without_(
would result in expressions that contains a rand(1:50) so I could not know what is the exact input. I also triedand the result is some different M in the expression, like (Fun(sig, 3+10, 5)) .
What is the recommended way of doing this for now if supporting
_()
is hard, with inputing integers with some constraints? Thanks.