I am also an ECJ newbie, but it can't hurt to comment on your
email. It always makes me feel better when people respond to me, even
when they are wrong :).
I think that item 1/ is sensible. main() is not that difficult to
re-implement, especialy if you are willing to do basically cut and paste
from main() into the new webMain or whatever you call it. I do not
understand very well what you mean in item 2/. By end-users input do you
mean parameters such as those that appear in the various params files?
If you want to post those from a form you could have your webapp compose
the http params containing the ECJ app params into a Params object
manually in webMain(), then you will have to make sure that that Params
object goes into EvolutionState.parameters. But then the client side of
the app will be responsible for supplying ALL params, unless you try to
dynamically make your dynamically create params database inherit from
some params file on the server. Maybe this would not be too bad, but I
think it is ill-advised in general in a web-app context for clients to
know about paths on the server.
As for finding the fitest individual, is you look at
SimpleStatistics.finalStatistics(), for example, you will see that the
best_of_run array is where the best individuals are contained. It should
be fairly straightforward to access that member variable at the end of
the run, since it is public. I have not looked at other implementations
of Statistics, but I am pretty sure you will find it similarly easy to
locate the best individuals such as each Statistics subclass considers
them to be.
I hope this is of some help.
Eric Pascual wrote:
>I'm presently working on a EU research project, involving among other topics
>application of GAs to automatic configuration of industrial solutions.
>I'm completly newbie to ECJ, so please apologizes in advance if my question
>is completly trivial.
>I've played a bit with tutorials, and would need now to use ECJ in the
>context of an online Web application. So the user requirements will come via
>the Web request (after being captured from some input form as usually) and
>the ECJ work will be "called" by the doPost/doGet handlers.
>I've some ideas about how to implement this, but I'm not sure they are
>"compliants" with ECJ philosophy and architecture. Here they are :
>1/ sub-class Evolve and implement a method doing more or less what main
>does, buth replacing the command line args mechanism with something using
>webapp properties for instance. This method will be called by the
>2/ have the end-users inputs be transmitted as an object stored into the
>statics vector of EvolutionState before firing ECJ search
>3/ when iterations are over, scan population to get the fittest individual.
>I have a problem with this, because since ECJ is quite a powerfull and
>flexible software, I would have imagined that there was some qhicker way to
>retreive the best individual of a population. I'm pretty sure I'm overlooked
>something and that there is a built-in way to do this
>Any remark, suggestion, pointer... would be more than welcome.