1. When the evaluation of individual A with some individual B of the other population is finished, does this just effect the fitness of A?
-Yes
2. Can you select individuals B from the other population totally at random, or is there some structure which dictates which individuals would get selected with which individuals A?
-it is random

If what you want to do is evaluate an individual A by testing it against random individuals from the other population, and the results of these tests only affects fitness of individual A, then I wouldn't screw with the coevolution system at all.
-The result of these tests only affects fitness of individual A

And GroupedProblemForm's preprocessPopulation and postprocessPopulation stuff doesn't make much sense either.  Maybe you could hack things up, just override SteadyStateEvaluator.evaluateIndividual(...) as follows:

------
MultiSimpleProblemForm msp = ((MultiSimpleProblemForm)(problem));
int otherSubpop = // the other subpopulation
int[] others = // pick individuals from other subpopulation
msp.evaluate(state, ind, others, otherSubpop, 0);

// you'll need to make queue protected rather than package/private

- In the interaction, subpopulation 0 gets positive score and subpopulation 1 gets same negative score which is set as their fitness respectively. I get an weird problem here : subpopulation 1 prints "zero"  always as its Fitness in *.stat files. But if subpopulation 1 receives positive score  then *.stat provides the exact positive value as their fitness.
Here is evaluatee method

public void evaluatee ( final EvolutionState state,
final Individual ind,
final int subpop,
final int otherSubpop,
) {
if (state.generation > 0) {
double myFitness = 0;
double [] fitness = new double[2];
SimpleFitness fit = (SimpleFitness)(ind.fitness);
if (subpop == 1) {
for (int i = 0; i <numInteractions; i++) {
int randIndex =  mtf.nextInt(state.population.subpops[otherSubpop].individuals.length);
fitness = payOff(ind, state.population.subpops[otherSubpop].individuals[randIndex];
myFitness += fitness[0];
}

fit.setFitness(state, myFitness/numInteractions, false);
}

else {
for (int i = 0; i <numInteractions; i++) {
int randIndex =  mtf.nextInt(state.population.subpops[otherSubpop].individuals.length);

fitness = payOff(ind, state.population.subpops[otherSubpop].individuals[randIndex];
myFitness += fitness[1];
}
fit.setFitness(state, myFitness/numInteractions, false);
}
ind.evaluated = true;
}

Any suggestion is highly appreciated.

- Do we need GroupedProblem for coeovlution? if
a. the evaluator sends a single individual to the problem.
b. pre-process and post- process of GroupedProblem has no effect.

On Thu, Jun 2, 2016 at 10:58 AM, Sean Luke wrote:

> ​- My idea was like this : send one individual to the problem, play the interaction game with other individuals from different population inside problem class.​

​​
1. When the evaluation of individual A with some individual B of the other population is finished, does this just effect the fitness of A?

​​
2. Can you select individuals B from the other population totally at random, or is there some structure which dictates which individuals would get selected with which individuals A?

> I think you need to first think about what SSEA means in a coevolutionary context.  Steady State is basically this:
> ​
> Loop forever:
>         I <- breed new individual
>         F <- evaluate individual
>         G <- add individual into population, perhaps displacing an existing individual
>
> How would you modify this loop to do SSEA in the way you're hoping?  What kind of coevolution are you trying to do?
>
> ​- I need "Parallel 2-Population Competitive Coevolution"​
> ​- I don't want to modify this loop.

If what you want to do is evaluate an individual A by testing it against random individuals from the other population, and the results of these tests only affects fitness of individual A, then I wouldn't screw with the coevolution system at all.  And GroupedProblemForm's preprocessPopulation and postprocessPopulation stuff doesn't make much sense either.  Maybe you could hack things up, just override SteadyStateEvaluator.evaluateIndividual(...) as follows:

------
MultiSimpleProblemForm msp = ((MultiSimpleProblemForm)(problem));
int otherSubpop = // the other subpopulation
int[] others = // pick individuals from other subpopulation
msp.evaluate(state, ind, others, otherSubpop, 0);

// you'll need to make queue protected rather than package/private
-----

Now it is possible that what you REALLY want to do is something different:

Given Populations P1, P2, ..., Pn
Loop forever:
I1, I2, ..., In <- breed new individual from each pop
F1, F2, ..., Fn <- evaluate(I1, I2, ..., In) together
Add I1, I2, ..., In into P1, P2, ..., Pn respectively,
perhaps displacing existing individuals

In this case, you'll need to rewrite the Steady State system to do evaluation and breeding of each subpopulation in parallel, and also to use GroupedProblemForm. You might called it Steady State CCEA or something, I dunno. Anyway, ECJ doesn't have that built in.

Sean