ECJ-INTEREST-L Archives

October 2008

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Wed, 1 Oct 2008 08:56:46 -0400
MIME-version:
1.0 (Apple Message framework v753.1)
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=US-ASCII; delsp=yes; format=flowed
Subject:
From:
Keith Sullivan <[log in to unmask]>
In-Reply-To:
Content-transfer-encoding:
7bit
Comments:
To: ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (58 lines)
Hi Peter,

Look at ERC.java.  It implements ephemeral random constants, which  
are almost what you are looking for.  Some minor modificiations  
should do the trick.

Keith


On Oct 1, 2008, at 5:55 AM, Peter Thieu wrote:

> Hi there
>
> i want leaves with a constant, i.e:
>
> public class Const extends GPNode
>   {
>     private int cValue;
>   public String toString() { return Integer.toString(this.cValue);}
>
>   public void checkConstraints(final EvolutionState state,
>                                final int tree,
>                                final GPIndividual typicalIndividual,
>                                final Parameter individualBase)
>       {
>       super.checkConstraints 
> (state,tree,typicalIndividual,individualBase);
>       if (children.length!=0)
>           state.output.error("Incorrect number of children for node  
> " +
>                              toStringForError() + " at " +
>                              individualBase);
>       }
>
>   public void eval(final EvolutionState state,
>                    final int thread,
>                    final GPData input,
>                    final ADFStack stack,
>                    final GPIndividual individual,
>                    final Problem problem)
>       {
>       DoubleData rd = ((DoubleData)(input));
>       this.cValue = ((int)(state.random[thread].nextDouble()*10));
>       rd.x = this.cValue;
>       }
>   }
>
> assuming it creates a tree like (x+2) * 3, where 2 and 3 leaves  
> were produced by the class Const
>
> assuming this tree is passed to the next generation, will it be the  
> same tree with the same constants (x+2) * 3, or will there be new  
> constants values i.e. (x+4) * 5?
>
> kind regards
>
> Peter

ATOM RSS1 RSS2