I have a situation where i dont want to create terminal of a specific type (type which can be only achieved as a result of another primitive) and on the other hand i have a primitive that requires terminal of a type which doesnt have its own primitive.
With pset like this gp.generate raises an error. To make it work i am forced to create redundant terminals and primitives like this:
pset.addPrimitive(identity, [int], int)pset.addTerminal(True, bool)
which then leads to redundant situations like this:
'if_then_else(True, identity(identity(identity(5))), 6)'
Hi,
I have a situation where i dont want to create terminal of a specific type (type which can be only achieved as a result of another primitive) and on the other hand i have a primitive that requires terminal of a type which doesnt have its own primitive. With pset like this gp.generate raises an error. To make it work i am forced to create redundant terminals and primitives like this:
pset.addPrimitive(identity, [int], int)
pset.addTerminal(True, bool)
which then leads to redundant situations like this:'if_then_else(True, identity(identity(identity(5))), 6)'