GMUEClab / ecj

ECJ Evolutionary Computation Toolkit
http://cs.gmu.edu/~eclab/projects/ecj/
124 stars 44 forks source link

Mysterious introns in MultipleVectorCrossoverPipeline #60

Open SigmaX opened 4 years ago

SigmaX commented 4 years ago

Came across an unresolved comment by Ermo in MultipleVectorCrossoverPipeline. This needs to be reviewed/verified/fixed.

I don't believe we have any examples that use this class, so adding an example that exercises it would be a good place to start.

        // join them and add them to the population starting at the start location
        for(int i = 0, q = start; i < parents.size(); i++, q++)
            { 
            ((VectorIndividual) parents.get(i)).join(pieces[i]);
            parents.get(i).evaluated = false;
            //            if(q<inds.size()) // just in case
            //                {               
            //                inds.set(q, (VectorIndividual) parents.get(i));
            //                }
            // by Ermo. The comment code seems to be wrong. inds are empty, which means indes.size() returns 0.
            // I think it should be changed to following code
            // Sean -- right?
            inds.add(parents.get(i));
            }