Hi Gabriel,

thank you very much for your answer,
While I was waiting I tried to implement something but failed epicly.

I now implemented your method and it seems to work fine.
To thoroughly test it, I need to create a sort of ideal Individual, which I haven't figured out yet how to do.
The questions regarding this will be in an extra mail, since it is a new topic..

Thanks again, you helped me alot.

Best Regards,

-----Ursprüngliche Nachricht-----
Von: "Gabriel Catalin Balan" <[log in to unmask]>
Gesendet: 23.03.09 16:02:18
An: [log in to unmask]
Betreff: Re: GPNode that can sum


Say YourData extends GPData (just like ParityData extends GPData in, except you'd need a "double x" instead of an "int x").

1. Old_e:
Add a YourData field to this node,  call it bufferedData, or lastData,
etc.  In the "eval(... GPData input)" function, eval the child


then switch the values inside input and bufferedData.

Also, you're gonna need to initialize the bufferedData.

2. Sum_e:

same as before, but instead of switching, you add the value of input.x to

You might need to reset the "sum" back to zero  (if you evaluate the tree
on multiple inputs; i.e. test your controller on multiple initial
conditions). You could have these nodes extend an interface, say

	public interface ResetableNode{public void reset();}

and call reset on all ResetableNode in your tree(s) before you evaluate it
on each initial condition. (you do this inside your problem's eval()


On Mon, 23 Mar 2009, Thorsten TIede wrote:

> Hi,
> I am  pretty new to evolutionary Computation and thus not experienced. So
> forgive me, if my questions are dull..
> I am trying to set up a GP-System that can create a PID-controller
> (
> Thus for doing that, I need
> a) a node, that can sum up the value another node holds and
> b) a node, that contains the value another node had in the cycle before.
> The solution my GP System should find is:
> y = Kp * e + Ki * Ta * esum + Kd * (e – ealt)/Ta
> where Kp, Ki, Ta, Kd are constants
> and e is calculated out of values changing each timestep. ( so practically
> "e" isn't a terminal symbol, but rather a subtree which result is the value
> of "e".
> so, plainly speaking I have a subtree which returns the value of "e". I then
> need a node "e_sum" and a node "e_old".
> Any hints on how to implement those nodes? Do you need additional information?
> Best Regards,
> Thorsten Tiede


Thorsten Tiede
Rappenberghalde 27
72070 Tübingen
Te: 07071 / 750159
Mobil: 0177 / 795 58 02