ShuhuaGao / geppy

A framework for gene expression programming (an evolutionary algorithm) in Python
https://geppy.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
207 stars 76 forks source link

How to set n_genes = 3 #19

Closed Tacitate closed 4 years ago

Tacitate commented 4 years ago

Hello!

I want to set n_genes = 3, but since I did it, it throwed a error as the following:

image

image

ShuhuaGao commented 4 years ago

Note the last but one line of your error information: there is a linker function. I guess you are using an add as the linker, which by default only accepts two arguments like a + b. In GEP, the output of each gene acts as an argument of the linker function. There are three arguments in your case, and an error thus happens.

You should provide a custom addition function as the linker that accepts three addends instead of two.

Tacitate commented 4 years ago

Soga~ got it, thx~