ECJ-INTEREST-L Archives

July 2005

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text 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:
Tue, 26 Jul 2005 19:17:44 -0400
MIME-version:
1.0 (Apple Message framework v622)
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=US-ASCII; format=flowed
Subject:
From:
Sean Luke <[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 (42 lines)
It's quite straightforward.  Most Evaluators, such as SimpleEvaluator,
implement their runComplete(...) method by returning true if any
individual is ideal, else false.  So just subclass the Evaluator you're
using (likely SimpleEvaluator) and override the runComplete function to
use your preferred metric:

public class MyEvaluator extends SimpleEvaluator // or whatever one
        {
        public void evaluatePopulation(EvolutionState state)
                {
                super.evaluatePopulation(state);
                // here would be a good place to gather statistics
                // to use in runComplete below...
                }

        public boolean runComplete(EvolutionState state)
                {
                // called AFTER evaluatePopulation.
                return .... ;  // use your statistics
                }
        }

This will get called once per generation.  Then you just use the
parameters:

quit-on-run-complete =          true
# you need to use the full classname here, like ec.foo.MyEvaluator if
necessary
eval =                                  MyEvaluator

Sean

On Jul 26, 2005, at 3:15 PM, Sandeep Mulgund wrote:

> Is there any way to encode in ECJ some stopping criteria other than the
> maximum number of generations?  For example, what if I wanted to give
> up if
> I don't get more than x% improvement in the best solution over y
> generations?
>
> Sandeep

ATOM RSS1 RSS2