Print

Print


Sure.  But instead of doing that, why not just subclass the problem in
question and substitute an eval which does:

        Eval:
                modify the individual
                call super.eval

>>I subclass the problem and call its evaluate(..) method inside the
evalPopChunk(..) of my customized evaluator. Is it not the same as you
suggested above?

>>Another query: In this case, the problem.evaluate(..) does nothing but
some checking   and sets ind.evaluated = false because I am waiting for
the evaluation data (ie. fitness) in my custom evaluator. It takes time to
get the fitness. So, what I do is to wait and as soon as I get any fitness
data, I counter check the hash of sending genotype vs receiving genotype
that is already evaluated. If they match, then I set the fitness in
evaluator using setFitness(...) method. Then do ind.evaluated = true.

So, my question is : If I perform some  work ( eg. fitness sharing ) on the
fitness before calling setFitness(), then I set the updated fitness using
setFitness() do I need to do some extra work on breeding/selection or post
statistics? More specifically, is the updated fitness contribute in the
selection process of breeding pipeline?   Currently, I do fitness sharing
before calling setFitness() but the data are not convincing even the ECJ
stdout outputs for best fitness does not matches the per generational
output.

Thanks for you time
-Bari

On Fri, Nov 13, 2015 at 8:10 PM, BARI, ATM GOLAM <[log in to unmask]> wrote:

> Thanks a lot for your reply. Yes, it is working now.
>
>
> On Fri, Nov 13, 2015 at 5:05 PM, Sean Luke <[log in to unmask]> wrote:
>
>> On Nov 13, 2015, at 4:45 PM, Bari <[log in to unmask]> wrote:
>>
>> > I need to modify the first cell of an individual's genome and then send
>> that individual to problem's evaluate(). As for example, if the genome is
>> [10, 5, 3, 11, 12], I want to keep the first number (here it is 10) between
>> 1 to 5. I can do that using IntegerVectorIndividual's genome field. But I
>> can't modify the Individual in that way. As a result, I am not able to send
>> a modified individual to problem's evaluate().
>>
>> Why not?  Why can't you just say
>>         ((IntegerVectorIndividual)ind).genome[0] = 4?
>>
>>
>> > I read about Individual and the documentation says that Individual is
>> immuatable but modification can be done and it is safe in a single threaded
>> environment. But I am not finding any way (eg. any method like SetGenome()
>> in IntegerVectorIndividual) to do that. Any suggestion is appreciated.
>>
>> Individual is not immutable per se.  If you're doing this during
>> evaluate, it's probably safe to do so.
>>
>> > NB: I am not subclassing EvolutionState directly, I am using state =
>> ec.simple.simpleEvolutionState in param file but eval is replaced by my own
>> evaluator which is extending ec.simple.SimpleEvaluator.
>>
>> Sure.  But instead of doing that, why not just subclass the problem in
>> question and substitute an eval which does:
>>
>>         Eval:
>>                 modify the individual
>>                 call super.eval
>>
>> Sean
>>
>
>