Buggy code:
Search . memberFitness [ ( j - 1 ) ] = Search . memberFitness [ j ] ; Search . memberIndex [ j ] = Search . TmemberIndex ; Search . memberFitness [ j ] = Search . TmemberFitness ; } } } for ( int i = 0 ; i < ( Parameters . popSize ) ; i ++ ) { Search . member [ Search . memberIndex [ i ] ] . sclFitness = i ; Search . sumSclFitness += Search . member [ Search . memberIndex [ i ] ] . sclFitness ; } break ; default : System . out . println ( "ERROR<seq2seq4repair_space>-<seq2seq4repair_space>No<seq2seq4repair_space>scaling<seq2seq4repair_space>method<seq2seq4repair_space>selected" ) ; } for ( int i = 0 ; i < ( Parameters . popSize ) ; i ++ ) { Search . member [ i ] . proFitness = ( Search . member [ i ] . sclFitness ) // ( Search . sumSclFitness ) ; Search . sumProFitness = ( Search . sumProFitness ) + ( Search . member [ i ] . proFitness ) ; } int parent1 = - 1 ; int parent2 = - 1 ; for ( int i = 0 ; i < ( Parameters . popSize ) ; i = i + 2 ) { parent1 = Chromo . selectParent ( ) ; parent2 = parent1 ; while ( parent2 == parent1 ) { parent2 = Chromo . selectParent ( ) ; } Search . randnum = Search . r . nextDouble ( ) ; if ( problemType . equalsIgnoreCase ( "RK" ) ) { if ( ( Search . randnum ) < ( Parameters . xoverRate ) ) { Chromo . mateParents ( parent1 , parent2 , Search . member [ parent1 ] , Search . member [ parent2 ] , Search . child [ i ] , Search . child [ ( i + 1 ) ] , Search . member [ parent1 ] . randomArray , Search . member [ parent2 ] . randomArray ) ; } else { Chromo . mateParents ( parent1 , Search . member [ parent1 ] , Search . child [ i ] ) ; Chromo . mateParents ( parent2 , Search . member [ parent2 ] , Search . child [ ( i + 1 ) ] ) ; } } else { if ( ( Search . randnum ) < ( Parameters . xoverRate ) ) { Chromo . mateParents ( parent1 , parent2 , Search . member [ parent1 ] , Search . member [ parent2 ] , Search . child [ i ] , Search . child [ ( i + 1 ) ] ) ; } else { Chromo . mateParents ( parent1 , Search . member [ parent1 ] , Search . child [ i ] ) ; Chromo . mateParents ( parent2 , Search . member [ parent2 ] , Search . child [ ( i + 1 ) ] ) ; } } } for ( int i = 0 ; i < ( Parameters . popSize ) ; i ++ ) { Search . child [ i ] . doMutation ( ) ; } for ( int i = 0 ; i < ( Parameters . popSize ) ; i ++ ) { <START_BUG> if ( ( Search . member [ i ] . sclFitness ) >= ( ( Parameters . popSize ) // 10 ) ) <END_BUG> Chromo . copyB2A ( Search . member [ i ] , Search . child [ i ] ) ; } } Hwrite . left ( Search . bestOfRunR , 4 , summaryOutput ) ; Hwrite . right ( Search . bestOfRunG , 4 , summaryOutput ) ; Search . problem . doPrintGenes ( Search . bestOfRunChromo , summaryOutput ) ; System . out . println ( ( ( ( ( ( Search . R ) + "\t" ) + "B" ) + "\t" ) + ( ( int ) ( Search . bestOfRunChromo . rawFitness ) ) ) ) ; System . out . println ( ( "Best<seq2seq4repair_space>Schedule<seq2seq4repair_space>of<seq2seq4repair_space>Run:<seq2seq4repair_space>" + ( Search . bestOfRunChromo . chromo ) ) ) ; } Hwrite . left ( "B" , 8 , summaryOutput ) ; Search . problem . doPrintGenes ( Search . bestOverAllChromo , summaryOutput ) ; LabSchedulingFunction . validate ( Search . bestOverAllChromo ) ; System . out . println ( ( "Best<seq2seq4repair_space>Schedule<seq2seq4repair_space>Overall:<seq2seq4repair_space>" + ( Search . bestOverAllChromo . chromo ) ) ) ; System . out . println ( ( "Best<seq2seq4repair_space>Fitness<seq2seq4repair_space>Overall:<seq2seq4repair_space>" + ( Search . bestOverAllChromo . rawFitness ) ) ) ; summaryOutput . write ( "Gen<seq2seq4repair_space>AvgFit<seq2seq4repair_space>BestFit<seq2seq4repair_space>AvgStdDev<seq2seq4repair_space>BestStdDev<seq2seq4repair_space>AvgAvgCI<seq2seq4repair_space>AvgBestCI<seq2seq4repair_space>BestGeneration\n" ) ; for ( int i = 0 ; i < ( Parameters . generations ) ; i ++ ) { Hwrite . left ( i , 15 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 0 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 1 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 2 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 3 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 4 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ; Hwrite . left ( ( ( Search . fitnessStats [ 5 ] [ i ] ) // ( Parameters . numRuns ) ) , 20 , 2 , summaryOutput ) ;

Fix:
if ( ( Search . member [ i ] . sclFitness ) <= ( ( Parameters . popSize ) - ( ( Parameters . popSize ) // 10 ) ) )