Print

Print


Short version: you're doing gp.fs.1.func.0.arg=1 and gp.fs.1.func. 
1.arg=2 when you should be doing gp.fs.1.func.0.arg=0 and gp.fs. 
1.func.1.arg=1.

Long version.  ADFs are called like any other function; they can have  
arguments.  For example,

	(adf1 4 (sin 3))

Will pass in the 4 and Sin(3) to the ADF1 function.  The ADF1  
function will then call the ADF1 tree.  Inside the ADF1 tree you can  
access 4 and Sin(3) respectively using two ADFArgument functions --  
let's call them ARG0 and ARG1, like this:

	(arg0)
or
	(arg1)

Arg0 and Arg1 are just names.  To know which argument an arg function  
will return, you need to tell it.  Specifically, ADFArgument  
functions have each will have an 'arg' parameter, for example, gp.fs. 
1.func.0.arg, which says which argument number that ADFArgument  
represents.  Argument numbers start at 0, so the '4' argument is  
number 0 and the 'Sin(3)' argument is 1.  You're starting at in each  
of your trees rather than 0.

Sean

On May 29, 2006, at 6:41 AM, Mehdi Khoury wrote:

> Hi,
>
> I would like to have the following structure:
>
>    main tree
> ADF0 ADF1 ADF2
>
> Where ADF1 may contain as arguement ADF0,
> and ADF2 may contain as arguements ADF0 and ADF1
>
> I have prepared my parameter file (see bottom of the message), but  
> it does
> give me the following error message while running :
> ...
> Initializing Generation 0
> ERROR:
> The node ADF0[1] in individual pop.subpop.0.species.ind would call its
> associated tree, which has an argument terminal with an argument  
> number
> (1) >= the ADF/ADM's arity (0).  The argument terminal in question  
> is ARG
> [1]
> ERROR:
> The node ADF0[1] in individual pop.subpop.0.species.ind would call its
> associated tree, which has an argument terminal with an argument  
> number
> (2) >= the ADF/ADM's arity (0).  The argument terminal in question  
> is ARG
> [2]
> ERROR:
> The node ADF1[2] in individual pop.subpop.0.species.ind would call its
> associated tree, which has an argument terminal with an argument  
> number
> (1) >= the ADF/ADM's arity (1).  The argument terminal in question  
> is ARG
> [1]
> WARNING:
> There is no argument terminal for argument #0 for the node ADF1[2] in
> individual pop.subpop.0.species.ind
> WARNING:
> There is no argument terminal for argument #0 for the node ADF2[3] in
> individual pop.subpop.0.species.ind
> WARNING:
> There is no argument terminal for argument #1 for the node ADF2[3] in
> individual pop.subpop.0.species.ind
> SYSTEM EXITING FROM ERRORS
>
> I don't understand why it can't find the terminal for the  
> arguements. Any
> idea of what is going on ?
>
> Here is my parameter file :
> parent.0 = koza.params
> pop.subpop.0.species.ind.numtrees = 4
> pop.subpop.0.species.ind.tree.0 = ec.gp.GPTree
> pop.subpop.0.species.ind.tree.0.tc  = tc0
> pop.subpop.0.species.ind.tree.1 = ec.gp.GPTree
> pop.subpop.0.species.ind.tree.1.tc  = tc1
> pop.subpop.0.species.ind.tree.2 = ec.gp.GPTree
> pop.subpop.0.species.ind.tree.2.tc  = tc2
> pop.subpop.0.species.ind.tree.3 = ec.gp.GPTree
> pop.subpop.0.species.ind.tree.3.tc  = tc3
> gp.tc.size = 4
> gp.tc.0 = ec.gp.GPTreeConstraints
> gp.tc.0.name = tc0
> gp.tc.0.fset = f0
> gp.tc.0.returns = nil
> gp.tc.0.init = ADFtreeBuilder
> gp.tc.0.init.growp = 0.5
> gp.tc.0.init.min-depth = 2
> gp.tc.0.init.max-depth = 2
> gp.tc.1 = ec.gp.GPTreeConstraints
> gp.tc.1.name = tc3
> gp.tc.1.fset = f1
> gp.tc.1.returns = nil
> gp.tc.1.init = ec.gp.koza.HalfBuilder
> gp.tc.1.init.growp = 0.5
> gp.tc.1.init.min = 2
> gp.tc.1.init.max = 10
> gp.tc.2 = ec.gp.GPTreeConstraints
> gp.tc.2.name = tc2
> gp.tc.2.fset = f2
> gp.tc.2.returns = nil
> gp.tc.2.init = ec.gp.koza.HalfBuilder
> gp.tc.2.init.growp = 0.5
> gp.tc.2.init.min = 2
> gp.tc.2.init.max = 10
> gp.tc.3 = ec.gp.GPTreeConstraints
> gp.tc.3.name = tc1
> gp.tc.3.fset = f3
> gp.tc.3.returns = nil
> gp.tc.3.init = ec.gp.koza.HalfBuilder
> gp.tc.3.init.growp = 0.5
> gp.tc.3.init.min = 2
> gp.tc.3.init.max = 10
> gp.fs.size = 4
> gp.fs.0.name = f0
> gp.fs.0.info = ec.gp.GPFuncInfo
> gp.fs.0.size = 4
> gp.fs.0 = ec.gp.GPFunctionSet
> gp.fs.0.func.0 = AdfReceptor
> gp.fs.0.func.0.nc = nc3
> gp.fs.0.func.1 = ec.gp.ADF
> gp.fs.0.func.1.nc = nc0
> gp.fs.0.func.1.tree = 1
> gp.fs.0.func.1.name = 0
> gp.fs.0.func.2 = ec.gp.ADF
> gp.fs.0.func.2.nc = nc1
> gp.fs.0.func.2.tree = 2
> gp.fs.0.func.2.name = 1
> gp.fs.0.func.3 = ec.gp.ADF
> gp.fs.0.func.3.nc = nc2
> gp.fs.0.func.3.tree = 3
> gp.fs.0.func.3.name = 2
>
>  # ADF1's tree
> gp.fs.1 = ec.gp.GPFunctionSet
> gp.fs.1.name = f1
> gp.fs.1.info = ec.gp.GPFuncInfo
> gp.fs.1.size = 9
> gp.fs.1.func.0 = Var1
> gp.fs.1.func.0.nc = nc0
> gp.fs.1.func.1 = MyAdd
> gp.fs.1.func.1.nc = nc2
> gp.fs.1.func.2 = MySub
> gp.fs.1.func.2.nc = nc2
> gp.fs.1.func.3 = MyMul
> gp.fs.1.func.3.nc = nc2
> gp.fs.1.func.4 = MyERC
> gp.fs.1.func.4.nc = nc0
> gp.fs.1.func.5 = MyMinus
> gp.fs.1.func.5.nc = nc1
> gp.fs.1.func.6 = MyDiv
> gp.fs.1.func.6.nc = nc2
> gp.fs.1.func.7 = MyInv
> gp.fs.1.func.7.nc = nc1
> gp.fs.1.func.8 = MyDeriv
> gp.fs.1.func.8.nc = nc1
>
>  # ADF2's tree
> gp.fs.2 = ec.gp.GPFunctionSet
> gp.fs.2.name = f2
> gp.fs.2.info = ec.gp.GPFuncInfo
> gp.fs.2.size = 11
> # ARG1
> gp.fs.2.func.0 = ec.gp.ADFArgument
> gp.fs.2.func.0.nc = nc0
> gp.fs.2.func.0.arg = 1
> gp.fs.2.func.1 = Var1
> gp.fs.2.func.1.nc = nc0
> gp.fs.2.func.2 = Var2
> gp.fs.2.func.2.nc = nc0
> gp.fs.2.func.3 = MyAdd
> gp.fs.2.func.3.nc = nc2
> gp.fs.2.func.4 = MySub
> gp.fs.2.func.4.nc = nc2
> gp.fs.2.func.5 = MyMul
> gp.fs.2.func.5.nc = nc2
> gp.fs.2.func.6 = MyERC
> gp.fs.2.func.6.nc = nc0
> gp.fs.2.func.7 = MyMinus
> gp.fs.2.func.7.nc = nc1
> gp.fs.2.func.8 = MyDiv
> gp.fs.2.func.8.nc = nc2
> gp.fs.2.func.9 = MyInv
> gp.fs.2.func.9.nc = nc1
> gp.fs.2.func.10 = MyDeriv
> gp.fs.2.func.10.nc = nc1
>
>  # ADF3's tree
> gp.fs.3 = ec.gp.GPFunctionSet
> gp.fs.3.name = f3
> gp.fs.3.info = ec.gp.GPFuncInfo
> gp.fs.3.size = 13
> # ARG1
> gp.fs.3.func.0 = ec.gp.ADFArgument
> gp.fs.3.func.0.nc = nc0
> gp.fs.3.func.0.arg = 1
> # ARG2
> gp.fs.3.func.1 = ec.gp.ADFArgument
> gp.fs.3.func.1.nc = nc0
> gp.fs.3.func.1.arg = 2
> gp.fs.3.func.2 = Var1
> gp.fs.3.func.2.nc = nc0
> gp.fs.3.func.3 = Var2
> gp.fs.3.func.3.nc = nc0
> gp.fs.3.func.4 = Var3
> gp.fs.3.func.4.nc = nc0
> gp.fs.3.func.5 = MyAdd
> gp.fs.3.func.5.nc = nc2
> gp.fs.3.func.6 = MySub
> gp.fs.3.func.6.nc = nc2
> gp.fs.3.func.7 = MyMul
> gp.fs.3.func.7.nc = nc2
> gp.fs.3.func.8 = MyERC
> gp.fs.3.func.8.nc = nc0
> gp.fs.3.func.9 = MyMinus
> gp.fs.3.func.9.nc = nc1
> gp.fs.3.func.10 = MyDiv
> gp.fs.3.func.10.nc = nc2
> gp.fs.3.func.11 = MyInv
> gp.fs.3.func.11.nc = nc1
> gp.fs.3.func.12 = MyDeriv
> gp.fs.3.func.12.nc = nc1
> stat= ec.simple.SimpleStatistics
> stat.num-children = 1
> stat.child.0 = SimpleXYSeriesChartStatistics
> stat.child.0.title = Best of Generation
> stat.child.0.x-axis-label = generation
> stat.child.0.y-axis-label = fitness
> eval.problem = FuzzySymbolicRegression
> eval.problem.data = FuzzyTuple
> eval.problem.stack.context.data = FuzzyTuple
>
> Just to tell you , that ecj is really cool and that you are doing a  
> great
> job!
> Thanks !