Sender: |
|
Date: |
Tue, 30 Dec 2008 15:02:02 -0500 |
MIME-version: |
1.0 |
Reply-To: |
|
Content-type: |
text/plain; charset=ISO-8859-1; format=flowed |
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-transfer-encoding: |
7bit |
Comments: |
|
Parts/Attachments: |
|
|
You'll need some function that's called at the appropriate time. One
easy way to do this is to override
SimpleEvaluator.evaluatePopulation(...) to first call
super.evaluatePopulation(...), then check to see if it's the right
generation to change the genome size. If it is, you go through the
population and modify all the individuals' arrays as you see fit. It's
fine to replace the arrays with new arrays and copy in the old data as
you like.
Remember to replace SimpleEvaluator with your new subclass in your
parameter file:
eval = foo.bar.baz.MyNewEvaluator
Sean
Safak wrote:
> Hi,
>
> I want to change genome-size while GA is running. For example, in the
> parameter file, genome-size will be 100. After a certain number of
> generations, I want to change it to 56. How can I do it?
>
> Happy new year
>
> Safak
|
|
|