Population-based incremental learning: Difference between revisions

Content deleted Content added
Edaeda2 (talk | contribs)
No edit summary
Edaeda2 (talk | contribs)
Line 47:
for (int i = 0; i < ITER_COUNT; i++) {
// Creates N genotypes
final boolean[][] genoTypes = new boolean[N][totalBits];
for (boolean[] genoType : genoTypes) {
for (int k = 0; k < genoType.length; k++) {
Line 54:
}
}
 
// Calculate costs
final double[] costs = new double[N];
for (int j = 0; j < N; j++) {
costs[j] = costFunc.cost(toRealVec(genoTypes[j], domains));
}
 
// Find min and max cost genotypes
boolean[] minGenoType = null, maxGenoType = null;
Line 75:
}
}
 
// Compare with the best cost genotypes
if (bestCost > minCost) {
Line 81:
bestGenoType = minGenoType;
}
 
// Update the probability vector with max and min cost genotypes
for (int j = 0; j < totalBits; j++) {
Line 93:
}
}
 
// Mutation
for (int j = 0; j < totalBits; j++) {