Print

Print


Hi

Say YourData extends GPData (just like ParityData extends GPData in
ec.app.parity, 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

	children[0].eval(state,thread,input,stack,individual,problem);

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
bufferedData.x

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()
method).


Gabriel



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
> (http://en.wikipedia.org/wiki/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
>