Print

Print


Hello, I'm implementing the game Connect4 with GP. I did a long run with 4096 individuals and 10k generations. The problem is that after 1700 generations the best individual of every generation doesn't change (or hardly). This individual consists of a single terminal which can only mean the individual is bad. The result should of course be a large tree with multiple terminals and functions. The problem at hand is too complicated to be solved by a single terminal. I haven't had the problem with my earlier runs but then again I never did runs for 10k generations. The second longest run was for 2k generations. Elitism is used for the 10 best individuals. In my long run I did remove a small bug so that could have some influence but still, the result is HIGHLY suprising wouldn't you say? What could be the cause of this? I'd also like to test the best individual of an earlier generation, I only have it printed in "out.stat". This individual looks to be good. Can I load this individual somehow? Thanks. ========================================================================= Date: Tue, 25 Nov 2008 12:13:17 +1100 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Michael Hart <[log in to unmask]> Subject: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Hi all, I'm getting a NullPointerException due to a null parent in GPNode.parentType() when I use RandTree. I believe this is caused by line 416 in RandTree.java where the parent is set to null, but I'm not sure (I can verify that the argposition of the GPNode in question is 0 in this case too). Stack trace is attached. Exception in thread "main" java.lang.NullPointerException at ec.gp.GPNode.parentType(GPNode.java:219) at ec.gp.breed.MutateOneNodePipeline.produce(MutateOneNodePipeline.java: 216) at ec.breed.MultiBreedingPipeline.produce(MultiBreedingPipeline.java: 125) at ec.simple.SimpleBreeder.breedPopChunk(SimpleBreeder.java:182) at ec.simple.SimpleBreeder.breedPopulation(SimpleBreeder.java:119) at ec.simple.SimpleEvolutionState.evolve(SimpleEvolutionState.java:119) at ec.EvolutionState.run(EvolutionState.java:371) at ec.Evolve.main(Evolve.java:648) ========================================================================= Date: Mon, 24 Nov 2008 22:49:32 -0500 Reply-To: [log in to unmask] Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Sean Luke <[log in to unmask]> Subject: Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit First mistake: using RandTree. :-) No, seriously, RandTree is a mess. I strongly suggest using Uniform. In the meantime, let me poke around, but it will be a bit. Sean Michael Hart wrote: > Hi all, > > I'm getting a NullPointerException due to a null parent in > GPNode.parentType() when I use RandTree. I believe this is caused by > line 416 in RandTree.java where the parent is set to null, but I'm not > sure (I can verify that the argposition of the GPNode in question is 0 > in this case too). Stack trace is attached. > > Exception in thread "main" java.lang.NullPointerException > at ec.gp.GPNode.parentType(GPNode.java:219) > at > ec.gp.breed.MutateOneNodePipeline.produce(MutateOneNodePipeline.java:216) > at > ec.breed.MultiBreedingPipeline.produce(MultiBreedingPipeline.java:125) > at ec.simple.SimpleBreeder.breedPopChunk(SimpleBreeder.java:182) > at ec.simple.SimpleBreeder.breedPopulation(SimpleBreeder.java:119) > at ec.simple.SimpleEvolutionState.evolve(SimpleEvolutionState.java:119) > at ec.EvolutionState.run(EvolutionState.java:371) > at ec.Evolve.main(Evolve.java:648) ========================================================================= Date: Tue, 25 Nov 2008 22:10:35 +1100 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Michael Hart <[log in to unmask]> Subject: Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Thanks Sean - I'll steer clear for now. It just looked so meaty, I figured it had to be doing something interesting :-) Now, in terms of Uniform, I had to make UniformGPNodeStorage implement Serializable to allow for checkpointing. I also ran into an ArrayOutOfBoundsException on line 432 of Uniform.java which took me ages to track down. Turns out that it was due to some GPTypes specified in my params that I hadn't used yet in any of my GPNodeConstraints. It might be nice to be able to catch this or warn about it. Apart from that, smooth sailing again. Cheers, Michael On 25/11/2008, at 2:49 PM, Sean Luke wrote: > First mistake: using RandTree. :-) > > No, seriously, RandTree is a mess. I strongly suggest using Uniform. > > In the meantime, let me poke around, but it will be a bit. > > Sean > > Michael Hart wrote: >> Hi all, >> I'm getting a NullPointerException due to a null parent in >> GPNode.parentType() when I use RandTree. I believe this is caused >> by line 416 in RandTree.java where the parent is set to null, but >> I'm not sure (I can verify that the argposition of the GPNode in >> question is 0 in this case too). Stack trace is attached. >> Exception in thread "main" java.lang.NullPointerException >> at ec.gp.GPNode.parentType(GPNode.java:219) >> at >> ec >> .gp.breed.MutateOneNodePipeline.produce(MutateOneNodePipeline.java: >> 216) >> at >> ec.breed.MultiBreedingPipeline.produce(MultiBreedingPipeline.java: >> 125) >> at ec.simple.SimpleBreeder.breedPopChunk(SimpleBreeder.java:182) >> at ec.simple.SimpleBreeder.breedPopulation(SimpleBreeder.java:119) >> at >> ec.simple.SimpleEvolutionState.evolve(SimpleEvolutionState.java:119) >> at ec.EvolutionState.run(EvolutionState.java:371) >> at ec.Evolve.main(Evolve.java:648) ========================================================================= Date: Tue, 25 Nov 2008 10:33:16 -0500 Reply-To: [log in to unmask] Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Sean Luke <[log in to unmask]> Subject: Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Hmmm, I'll have to figure out what to do there with regard to warnings in Uniform. And now a warning: you're using typed GP with Uniform. The type extensions to Uniform are my own, not those of the original authors of the paper. And they've not been well tested (or really tested at all). Expect the possibility of some bugs. Sean Michael Hart wrote: > Thanks Sean - I'll steer clear for now. It just looked so meaty, I > figured it had to be doing something interesting :-) > > Now, in terms of Uniform, I had to make UniformGPNodeStorage implement > Serializable to allow for checkpointing. I also ran into an > ArrayOutOfBoundsException on line 432 of Uniform.java which took me ages > to track down. Turns out that it was due to some GPTypes specified in my > params that I hadn't used yet in any of my GPNodeConstraints. It might > be nice to be able to catch this or warn about it. > > Apart from that, smooth sailing again. ========================================================================= Date: Thu, 27 Nov 2008 16:42:20 +1100 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Michael Hart <[log in to unmask]> Subject: ArrayOutOfBoundsExceptions in Uniform (was Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?)) Comments: To: [log in to unmask] Comments: cc: [log in to unmask] In-Reply-To: <[log in to unmask]> Content-Type: multipart/mixed; boundary=Apple-Mail-10-349237303 Mime-Version: 1.0 (Apple Message framework v929.2) --Apple-Mail-10-349237303 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Indeed, bugs in Uniform... So far, they've been ArrayOutOfBoundsExceptions - I suspect mainly due to the fact that I'm using some GPNodes in more than one function set... or something like that. I've patched a few of the array exceptions - at least so that they don't appear, no idea if the code is doing what it's supposed to. I've also attached a patch for the InterPopulationExchange serialization, just in case it falls through the cracks (haven't noticed it in CVS yet). (if there's a better place to be bug reporting and sending patches, let me know) Cheers, Michael --Apple-Mail-10-349237303 Content-Disposition: attachment; filename=InterPopulationExchange.patch Content-Type: application/octet-stream; x-unix-mode=0740; name="InterPopulationExchange.patch" Content-Transfer-Encoding: quoted-printable Index:=20InterPopulationExchange.java=0D=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0ARCS=20file:=20= /cvs/ecj/ecj/ec/exchange/InterPopulationExchange.java,v=0D=0Aretrieving=20= revision=201.3=0D=0Adiff=20-r1.3=20InterPopulationExchange.java=0D=0A= 8a9,10=0D=0A>=20import=20java.io.Serializable;=0D=0A>=20=0D=0A130c132=0D=0A= <=20=20=20=20=20class=20IPEInformation=0D=0A---=0D=0A>=20=20=20=20=20= class=20IPEInformation=20implements=20Serializable=0D=0A=0D=0A= --Apple-Mail-10-349237303 Content-Disposition: attachment; filename=Uniform.patch Content-Type: application/octet-stream; x-unix-mode=0740; name="Uniform.patch" Content-Transfer-Encoding: quoted-printable Index:=20Uniform.java=0D=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0ARCS=20file:=20= /cvs/ecj/ecj/ec/gp/build/Uniform.java,v=0D=0Aretrieving=20revision=201.4=0D= =0Adiff=20-r1.4=20Uniform.java=0D=0A10a11=0D=0A>=20import=20= java.io.Serializable;=0D=0A257c258,259=0D=0A<=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20funcnodes.put(tmpn,new=20Integer(count++));=0D=0A= ---=0D=0A>=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20= (!funcnodes.containsKey(tmpn))=0D=0A>=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20funcnodes.put(tmpn,new=20Integer(count++));=0D= =0A405,408c407,410=0D=0A<=20=20=20=20=20=20=20=20=20for(int=20f=20=3D=20= 0;f=20=20= =20=20=20=20=20=20=20for(int=20f=20=3D=200;f=20=20=20=20=20=20=20=20=20=20=20=20=20= for(int=20p=3D0;p=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20for(int=20o=3D0;o=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20for(int=20c=3D0;c=20=20=20=20=20=20=20=20=20=20=20=20=20= ROOT_D[functionset][type][size],ROOT_D[functionset][type][size][0],=0D=0A= 563c565=0D=0A<=20class=20UniformGPNodeStorage=20implements=20= RandomChoiceChooserD=0D=0A---=0D=0A>=20class=20UniformGPNodeStorage=20= implements=20RandomChoiceChooserD,=20Serializable=0D=0A=0D=0A= --Apple-Mail-10-349237303 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 26/11/2008, at 2:33 AM, Sean Luke wrote: > Hmmm, I'll have to figure out what to do there with regard to > warnings in Uniform. > > And now a warning: you're using typed GP with Uniform. The type > extensions to Uniform are my own, not those of the original authors > of the paper. And they've not been well tested (or really tested at > all). Expect the possibility of some bugs. > > Sean > > Michael Hart wrote: > >> Thanks Sean - I'll steer clear for now. It just looked so meaty, I >> figured it had to be doing something interesting :-) >> Now, in terms of Uniform, I had to make UniformGPNodeStorage >> implement Serializable to allow for checkpointing. I also ran into >> an ArrayOutOfBoundsException on line 432 of Uniform.java which took >> me ages to track down. Turns out that it was due to some GPTypes >> specified in my params that I hadn't used yet in any of my >> GPNodeConstraints. It might be nice to be able to catch this or >> warn about it. >> Apart from that, smooth sailing again. --Apple-Mail-10-349237303-- ========================================================================= Date: Thu, 27 Nov 2008 09:52:32 -0500 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Eric B <[log in to unmask]> Subject: Special constraints on nodes (STGP) Comments: To: [log in to unmask] Hello, I'd like to put constraints on my nodes. I have 3 functions: 'if', 'or', 'and' with arity respectively 3, 2, 2. I also have 9 terminals. The if-function can accept ANYTHING as its parameters (including another if) while 'or' and 'and' should accept everything EXCEPT 'if'. So for example and( or(T, T), T) is acceptable while and(if(T,T,T),or(T,T)) is not because of the 'if' where 'T' represents a random terminal. If I could define 2 types: one more 'general' than the other my problem would be solved. However, as far as I know, this is not included in ECJ. Anyone can help me? (I prefer to not mess with the Tree Builders, putting these constraints in the .params file is of course prefered) ========================================================================= Date: Fri, 28 Nov 2008 08:42:09 +1100 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Michael Hart <[log in to unmask]> Subject: Re: Special constraints on nodes (STGP) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Hi Eric, Firstly - in this case, without knowing more about your problem, you might actually get better results if you don't try and restrict your types like this and actually allow 'or' and 'and' to accept an 'if' and ensure that the 'if' will return something that can be interpreted by the 'or' and 'and' - even if the 'if' just passes through it's boolean check, or returns whether the first or second path was taken. It may look weird, but the extra flexibility may result in a better answer. Now, if you do want to proceed with the type restrictions, then what you're looking for is 'set' types. The only thing I'm confused about is whether you actually do allow your 'if' node to take another 'if' as it's first parameter. I had assumed that your 'if' node would not be returning anything as you don't want it used in your 'and' and 'or' nodes and I had also assumed that the first parameter of your 'if' node was a 'boolean' check... but anyway, I'll lay out the problem exactly as you specified: gp.type.a.0.name = void-sort-of gp.type.a.1.name = boolean gp.type.a.size = 2 gp.type.s.0.name = boolean-and-void gp.type.s.0.size = 2 gp.type.s.0.member.0 = void-sort-of gp.type.s.0.member.1 = boolean gp.type.s.size = 1 gp.nc.0 = ec.gp.GPNodeConstraints gp.nc.0.name = if-constraint gp.nc.0.returns = void-sort-of gp.nc.0.size = 3 gp.nc.0.child.0 = boolean-and-void gp.nc.0.child.1 = boolean-and-void gp.nc.0.child.2 = boolean-and-void gp.nc.1 = ec.gp.GPNodeConstraints gp.nc.1.name = boolean-constraint gp.nc.1.returns = boolean gp.nc.1.size = 2 gp.nc.1.child.0 = boolean gp.nc.1.child.1 = boolean gp.nc.size = 2 Then you'd use 'if-constraint' for your 'if' node and 'boolean- constraint' for your 'and' and 'or' nodes. Hope that helps, Michael On 28/11/2008, at 1:52 AM, Eric B wrote: > Hello, > > I'd like to put constraints on my nodes. I have 3 functions: 'if', > 'or', > 'and' with arity respectively 3, 2, 2. I also have 9 terminals. > > The if-function can accept ANYTHING as its parameters (including > another if) > while 'or' and 'and' should accept everything EXCEPT 'if'. So for > example > and( or(T, T), T) is acceptable while and(if(T,T,T),or(T,T)) is not > because > of the 'if' where 'T' represents a random terminal. > > If I could define 2 types: one more 'general' than the other my > problem > would be solved. However, as far as I know, this is not included in > ECJ. > > > Anyone can help me? (I prefer to not mess with the Tree Builders, > putting > these constraints in the .params file is of course prefered) ========================================================================= Date: Thu, 27 Nov 2008 16:44:29 -0500 Reply-To: [log in to unmask] Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Sean Luke <[log in to unmask]> Subject: Re: ArrayOutOfBoundsExceptions in Uniform (was Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?)) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sending them to this list is fine, or you can send them directly to me or to [log in to unmask] (either way) to avoid torturing listgoers. Sean Michael Hart wrote: > Indeed, bugs in Uniform... > > So far, they've been ArrayOutOfBoundsExceptions - I suspect mainly due > to the fact that I'm using some GPNodes in more than one function set... > or something like that. > > I've patched a few of the array exceptions - at least so that they don't > appear, no idea if the code is doing what it's supposed to. I've also > attached a patch for the InterPopulationExchange serialization, just in > case it falls through the cracks (haven't noticed it in CVS yet). > > (if there's a better place to be bug reporting and sending patches, let > me know) > > Cheers, > > Michael > > > > > On 26/11/2008, at 2:33 AM, Sean Luke wrote: > >> Hmmm, I'll have to figure out what to do there with regard to warnings >> in Uniform. >> >> And now a warning: you're using typed GP with Uniform. The type >> extensions to Uniform are my own, not those of the original authors of >> the paper. And they've not been well tested (or really tested at >> all). Expect the possibility of some bugs. >> >> Sean >> >> Michael Hart wrote: >> >>> Thanks Sean - I'll steer clear for now. It just looked so meaty, I >>> figured it had to be doing something interesting :-) >>> Now, in terms of Uniform, I had to make UniformGPNodeStorage >>> implement Serializable to allow for checkpointing. I also ran into an >>> ArrayOutOfBoundsException on line 432 of Uniform.java which took me >>> ages to track down. Turns out that it was due to some GPTypes >>> specified in my params that I hadn't used yet in any of my >>> GPNodeConstraints. It might be nice to be able to catch this or warn >>> about it. >>> Apart from that, smooth sailing again. > ========================================================================= Date: Fri, 28 Nov 2008 12:08:47 +1100 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Michael Hart <[log in to unmask]> Subject: Re: ArrayOutOfBoundsExceptions in Uniform (was Re: NullPointerException in ec.gp.GPNode.parentType (possible RandTree problem?)) Comments: To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> In-Reply-To: <[log in to unmask]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Looks like I've managed to get Uniform into some sort of infinite loop now. Not exactly sure how, or where it's happening... might just proceed without it. Will let you know if I get the chance to look into it. Michael On 28/11/2008, at 8:44 AM, Sean Luke wrote: > Sending them to this list is fine, or you can send them directly to > me or to [log in to unmask] (either way) to avoid torturing > listgoers. > > Sean > > Michael Hart wrote: >> Indeed, bugs in Uniform... >> So far, they've been ArrayOutOfBoundsExceptions - I suspect mainly >> due to the fact that I'm using some GPNodes in more than one >> function set... or something like that. >> I've patched a few of the array exceptions - at least so that they >> don't appear, no idea if the code is doing what it's supposed to. >> I've also attached a patch for the InterPopulationExchange >> serialization, just in case it falls through the cracks (haven't >> noticed it in CVS yet). >> (if there's a better place to be bug reporting and sending patches, >> let me know) >> Cheers, >> Michael >> On 26/11/2008, at 2:33 AM, Sean Luke wrote: >>> Hmmm, I'll have to figure out what to do there with regard to >>> warnings in Uniform. >>> >>> And now a warning: you're using typed GP with Uniform. The type >>> extensions to Uniform are my own, not those of the original >>> authors of the paper. And they've not been well tested (or really >>> tested at all). Expect the possibility of some bugs. >>> >>> Sean >>> >>> Michael Hart wrote: >>> >>>> Thanks Sean - I'll steer clear for now. It just looked so meaty, >>>> I figured it had to be doing something interesting :-) >>>> Now, in terms of Uniform, I had to make UniformGPNodeStorage >>>> implement Serializable to allow for checkpointing. I also ran >>>> into an ArrayOutOfBoundsException on line 432 of Uniform.java >>>> which took me ages to track down. Turns out that it was due to >>>> some GPTypes specified in my params that I hadn't used yet in any >>>> of my GPNodeConstraints. It might be nice to be able to catch >>>> this or warn about it. >>>> Apart from that, smooth sailing again. ========================================================================= Date: Fri, 28 Nov 2008 08:43:10 -0500 Reply-To: ECJ Evolutionary Computation Toolkit <[log in to unmask]> Sender: ECJ Evolutionary Computation Toolkit <[log in to unmask]> From: Eric B <[log in to unmask]> Subject: Re: Special constraints on nodes (STGP) Comments: To: [log in to unmask] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="OfT-GeJoLt8iTPO+?y/GGb5YAs/2?52:?VrQukEnqXvJy5FzdP?Uhqj0u)flY0hQ+.QfPs" --OfT-GeJoLt8iTPO+?y/GGb5YAs/2?52:?VrQukEnqXvJy5FzdP?Uhqj0u)flY0hQ+.QfPs Content-Transfer-Encoding: 7bit Content-Type: text/plain Thank you for your quick reply! I added this to my params file and it seems to work: # without this no "If" function is used (never)!!!!!! gp.tc.0.returns = void-sort-of # To make sure that 'Or' and 'And' do not accept 'If' as an argument: gp.type.a.0.name = void-sort-of gp.type.a.1.name = nil gp.type.a.size = 2 gp.type.s.0.name = boolean-and-void gp.type.s.0.size = 2 gp.type.s.0.member.0 = void-sort-of gp.type.s.0.member.1 = nil gp.type.s.size = 1 gp.nc.0 = ec.gp.GPNodeConstraints gp.nc.0.name = if-constraint gp.nc.0.returns = void-sort-of gp.nc.0.size = 3 gp.nc.0.child.0 = nil gp.nc.0.child.1 = boolean-and-void gp.nc.0.child.2 = boolean-and-void gp.nc.1 = ec.gp.GPNodeConstraints gp.nc.1.name = boolean-constraint gp.nc.1.returns = nil gp.nc.1.size = 2 gp.nc.1.child.0 = nil gp.nc.1.child.1 = nil gp.nc.2 = ec.gp.GPNodeConstraints gp.nc.2.name = nc0 gp.nc.2.returns = nil gp.nc.2.size = 0 gp.nc.size = 3 I used 'nil' instead of 'boolean' but it doesn't matter. I also made sure that the first argument of the 'if' does not accept another 'if'. But that's not very important. I do get a warning when running the code: WARNING: In function set f0 for the GPTreeConstraints tc0, no terminals are given with the return type void-sort-of which is required by other functions in the function set or by the tree's return type. Nearly all tree-builders in ECJ require the ability to add a terminal of any type for which there is a nonterminal, and at any time. Without terminals, your code may not work. One common indication that a tree-builder has failed due to this problem is if you get the MersenneTwister error 'n must be positive'. PARAMETER: gp.tc.0 However, it works fine so there's no problem for me now ;-) It does seem however that the second and third parameter of 'if' is most of the time 'or' or 'and'. Another 'if' would be much better but that doesn't happen often. Is it possible to give a bias towards 'if', to create more ifs and less 'and' or 'or' ? --OfT-GeJoLt8iTPO+?y/GGb5YAs/2?52:?VrQukEnqXvJy5FzdP?Uhqj0u)flY0hQ+.QfPs Content-Transfer-Encoding: 7bit Content-Type: text/html Thank you for your quick reply! I added this to my params file and it seems to work: # without this no "If" function is used (never)!!!!!! gp.tc.0.returns = void-sort-of # To make sure that 'Or' and 'And' do not accept 'If' as an argument: gp.type.a.0.name = void-sort-of gp.type.a.1.name = nil gp.type.a.size = 2 gp.type.s.0.name = boolean-and-void gp.type.s.0.size = 2 gp.type.s.0.member.0 = void-sort-of gp.type.s.0.member.1 = nil gp.type.s.size = 1 gp.nc.0 = ec.gp.GPNodeConstraints gp.nc.0.name = if-constraint gp.nc.0.returns = void-sort-of gp.nc.0.size = 3 gp.nc.0.child.0 = nil gp.nc.0.child.1 = boolean-and-void gp.nc.0.child.2 = boolean-and-void gp.nc.1 = ec.gp.GPNodeConstraints gp.nc.1.name = boolean-constraint gp.nc.1.returns = nil gp.nc.1.size = 2 gp.nc.1.child.0 = nil gp.nc.1.child.1 = nil gp.nc.2 = ec.gp.GPNodeConstraints gp.nc.2.name = nc0 gp.nc.2.returns = nil gp.nc.2.size = 0 gp.nc.size = 3 I used 'nil' instead of 'boolean' but it doesn't matter. I also made sure that the first argument of the 'if' does not accept another 'if'. But that's not very important. I do get a warning when running the code: WARNING: In function set f0 for the GPTreeConstraints tc0, no terminals are given with the return type void-sort-of which is required by other functions in the function set or by the tree's return type. Nearly all tree-builders in ECJ require the ability to add a terminal of any type for which there is a nonterminal, and at any time. Without terminals, your code may not work. One common indication that a tree-builder has failed due to this problem is if you get the MersenneTwister error 'n must be positive'. PARAMETER: gp.tc.0 However, it works fine so there's no problem for me now ;-) It does seem however that the second and third parameter of 'if' is most of the time 'or' or 'and'. Another 'if' would be much better but that doesn't happen often. Is it possible to give a bias towards 'if', to create more ifs and less 'and' or 'or' ? --OfT-GeJoLt8iTPO+?y/GGb5YAs/2?52:?VrQukEnqXvJy5FzdP?Uhqj0u)flY0hQ+.QfPs--