ECJ-INTEREST-L Archives

January 2011

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Nikola N." <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Mon, 31 Jan 2011 06:46:58 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
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

ATOM RSS1 RSS2