## ECJ-INTEREST-L@LISTSERV.GMU.EDU

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font

Subject:

Re: GE question - problem with number of children

From:

Rodrigo Barros <[log in to unmask]>

Reply-To:

ECJ Evolutionary Computation Toolkit <[log in to unmask]>

Date:

Sat, 26 Jan 2013 19:06:27 +0000

Content-Type:

text/plain

Parts/Attachments:

 text/plain (112 lines)
 ```Sorry about that! =D On 26 January 2013 19:03, Sean Luke <[log in to unmask]> wrote: > Well that was easy! :-) > > Sean > > On Jan 26, 2013, at 12:07 PM, Rodrigo Barros wrote: > >> I figured it out by myself. Thanks anyway! =) >> >> On 26 January 2013 16:18, Rodrigo Barros <[log in to unmask]> wrote: >>> Hi, >>> I'm implementing a GE system to evolve functions for regression. >>> One of my non-terminals is an if-then-else function. My grammar looks like this: >>> >>> ::= >>> ::= (* ) | (/ ) | (+ ) | (- >>> ) | >>> ::= (+ ) | (- ) | (* ) | (/ >>> ) | (^ ) >>> ::= (log ) | (cos ) | (sin ) >>> ::= (if ) >>> ::= (gt ) | (gteq ) | (sm ) | >>> (smeq ) | (eq ) | (neq ) >>> ::= (RealNumber) | >>> ::= (IntegerNumber) >>> ::= (Att) >>> >>> And my GPData has two attributes: a boolean value and a double value. >>> My implementation of the if-then-else rule is: >>> >>> public void eval(final EvolutionState state,final int thread,final >>> GPData input,final ADFStack stack,final GPIndividual individual,final >>> Problem problem) >>> { >>> boolean result; >>> GEData data = ((GEData)(input)); >>> children[0].eval(state,thread,input,stack,individual,problem); >>> result = data.bool; >>> if(result){ >>> children[1].eval(state,thread,input,stack,individual,problem); >>> } >>> else{ >>> children[2].eval(state,thread,input,stack,individual,problem); >>> } >>> } >>> >>> For some reason, I'm getting the following error: >>> "Incorrect number of children for node if at >>> pop.subpop.0.species.gp-species.ind" >>> >>> Though I'm pretty sure I configured correctly the rule in the parameters file: >>> gp.fs.0.func.17 = seege.If >>> gp.fs.0.func.17.nc = nc3 >>> >>> Do you have any idea why the If-then-else rule is supposedly receiving >>> the wrong number of children (different from 3)? I don't know what >>> else to try. >>> >>> Thank you in advance, >>> >>> Rodrigo >>> >>> >>> >>> -- >>> Rodrigo Coelho Barros, MSc. >>> PhD Candidate >>> Bioinspired Computation Laboratory (BioCom) >>> Department of Computer Science >>> University of São Paulo at São Carlos (ICMC-USP) >>> >>> www.icmc.usp.br/~rcbarros >>> e-mail (1): [log in to unmask] >>> e-mail (2): [log in to unmask] >>> e-mail (3): [log in to unmask] >>> >>> mobile: +44 75 7227 4565 >> >> >> >> -- >> Rodrigo Coelho Barros, MSc. >> PhD Candidate >> Bioinspired Computation Laboratory (BioCom) >> Department of Computer Science >> University of São Paulo at São Carlos (ICMC-USP) >> >> www.icmc.usp.br/~rcbarros >> e-mail (1): [log in to unmask] >> e-mail (2): [log in to unmask] >> e-mail (3): [log in to unmask] >> >> mobile: +44 75 7227 4565 -- Rodrigo Coelho Barros, MSc. PhD Candidate Bioinspired Computation Laboratory (BioCom) Department of Computer Science University of São Paulo at São Carlos (ICMC-USP) www.icmc.usp.br/~rcbarros e-mail (1): [log in to unmask] e-mail (2): [log in to unmask] e-mail (3): [log in to unmask] mobile: +44 75 7227 4565 ```

Advanced Options

#### Options

 Log In Get Password Search Archives Subscribe or Unsubscribe