Print

Print


Elena, starting, stopping, pausing, and unpausing ECJ can be done
fairly easily if you're willing to have a granularity of one generation
(when you press pause, if it's mid-generation you can't get it to pause
until it's completed).  SimpleEvolutionState, for example, provides a
"go" method that can be pulsed once for each initialization, breeding,
and evaluation step.  So you can do something like this:

        SimpleEvolutionState state = (SimpleEvolutionState)(Evolve.make(new
String[] {"-file", "params"}));
        state.go();
        state.go();
        state.go();
        ...

What's hard is *restarting* ECJ.  The difficulty here is that the
setup() method of various Cliques (GPType, GPNodeConstraints,
GPFunctionSet, GPTreeConstraints, RuleConstraints) loads static data
which you need to figure out how to manually delete before ECJ is run
again from the parameter file.  If you're not using any of these
classes (if you're not using the rule package or the GP package) then
you don't have to worry about this issue.

Beyond that, the GUI buttons basically fire up a state and start an
underlying thread to repeatedly call go() until go() returns false or a
user has stopped or paused the system.

Sean

On May 3, 2004, at 5:05 PM, Elena Popovici wrote:

>     Hi,
>
>     I need to put a small GUI on top of an ECJ application. The GUI
> would
> give the user control over a couple of ECJ parameters, like population
> size,
> number of generations, mutation rate, etc. I would still like to store
> the
> rest of my parameters in a parameter file. The GUI should also provide
> 4
> buttons: Start, Stop, Pause & Resume.
>     For the first part, concerning parameters, what's the easiest way
> to
> achieve it other than generating a parameter file from the code and
> then
> calling Evolve.main?
>     For the second part, can I use checkpoints to implement it, given
> the
> fact that I do not know when the user will press Pause? Or is there
> another
> way to do it?
>
>     Thanks in advance,
>     Elena