Hello Dr. Sean,
First, you are right, the naming MyFitness class is bad, although it related
to the Problem (it calculates the fitness inside so probably that's why I
gave such misleading name).
Either, I have debugged and compared the ecj19 and ecj20 once again. The
problem somehow gets in ecj20 by "MultiPopCoevolutionaryEvaluator.java" in
the following position.
"
...
// Test against random individuals of currrent population
for(int k = 0; k < numCurrent; k++)
{
for(int ind = 0; ind < inds.length; ind++)
{
if (ind == j) { inds[ind] =
state.population.subpops[j].individuals[i]; updates[ind] = true; }
* else { inds[ind] =
produce(selectionMethodCurrent[j], j, i, state, 0); updates[ind] = false; }
}
** prob.evaluate(state,inds,updates, false, subpops, 0);
}
...
"
So I have 2 sub-populations - one is made of FloatVectorIndividuals -
ind[0], one made of BitVectorIndividuals - ind[1].
After initializing, first iteration of .evaluate(...) goes ok, in the next
step however, problem gets at the point "* " after produce(...) is executed,
and therefore at point **, the prob.evaluate(...) gets inds made of ind[0],
ind[1] ->both FloatVectorIndividuals !!!, instead of one
FloatVectorIndividual and one of BitVectorIndividuals.
That's how I get the error "java.lang.ClassCastException:
ec.vector.FloatVectorIndividual cannot be cast to
ec.vector.BitVectorIndividual" at the end.
As I mentioned previously the same code with almost same .params functioned
in ecj19, but there the "MultiPopCoevolutionaryEvaluator.java" looks
different than in ecj20.
Can it be that the problem is still in produce(...) as mentioned above ?
Nikola
|