0
$\begingroup$

I create an individual in GP by using the full method. My individual trees have the same shape and size. I use a binary tree with all the leaves in maxdepth.

The problem is, I can not use the mathematical function set because it accepts two values. therefore I changed mathematical function set like sin (val1) to sin (val1+val2), sin (val1-val2) etc. in order to receive two values. ex

  • sin() become sin(+), sin(-), sin(/), sin(*)
  • round() become round(+), round(-), round(/), round(*)
  • sqrt() become sqrt(+), sqrt(-), sqrt(/), sqrt(*)

Is this allowed? If you can please show me the journal using this method.

$\endgroup$
  • $\begingroup$ You can do whatever you want. It's a free world. Be innovative. $\endgroup$ – Yuval Filmus Oct 9 '17 at 7:35
0
$\begingroup$

There are a couple of weird ideas here, I think. First, generally, you're not going to have all your trees the same size and shape. The algorithms should be allowed to create variations there.

Second, you should certainly be able to use functions with more than one argument. You can do this a number of ways. One, give each operator a "class" that you use to determine where it may legally appear. For instance, the "+" operator might be defined to take two operands, and thus it could only appear at a node with two children. Alternately, you can take the Common Lisp approach and simply define the result of applying those operations on too few arguments. For example, you might take that "+" operator and fill out any missing operands with 0s, so that applying (+) yields 0, (+ 5) yields 5, etc.

You're the one writing the program. You're allowed to make it behave however you like. I don't think you'll find a lot of references in the literature about this sort of thing because, honestly, it's an implementation issue that isn't interesting enough to publish.

$\endgroup$
  • $\begingroup$ Yeah i was wrong,. the algorithm should generate variations of shape and size to create variations. now im fixing it. $\endgroup$ – Arrofi Reza Satria Oct 11 '17 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.