|
26 | 26 | of the authors and should not be interpreted as representing official policies,
|
27 | 27 | either expressed or implied, of the FreeBSD Project.
|
28 | 28 | */
|
29 |
| -package algorithms.specialOptions.BIAS.ISBDE; |
| 29 | +package algorithms.specialOptions.BIAS; |
30 | 30 |
|
31 | 31 | import utils.random.RandUtilsISB;
|
32 | 32 |
|
|
42 | 42 | import static utils.algorithms.operators.ISBOp.crossOverExp;
|
43 | 43 | import static utils.algorithms.operators.ISBOp.crossOverBin;
|
44 | 44 |
|
45 |
| - |
46 |
| - |
47 |
| - |
48 | 45 | import interfaces.AlgorithmBias;
|
49 | 46 | import interfaces.Problem;
|
50 | 47 | import utils.MatLab;
|
@@ -93,15 +90,15 @@ public FTrend execute(Problem problem, int maxEvaluations) throws Exception
|
93 | 90 | int i = 0;
|
94 | 91 |
|
95 | 92 |
|
96 |
| - String FullName = getFullName("DE"+this.mutationStrategy+this.crossoverStrategy+this.correction,problem); |
| 93 | + String FullName = getFullName("DE"+this.mutationStrategy+this.crossoverStrategy+this.correction+"p"+populationSize,problem); |
97 | 94 | Counter PRNGCounter = new Counter(0);
|
98 | 95 | createFile(FullName);
|
99 | 96 |
|
100 | 97 | int[] ids = new int[populationSize]; //int prevID = -1;
|
101 | 98 | int newID = 0;
|
102 | 99 | int bestID = -1;
|
103 | 100 |
|
104 |
| - writeHeader(" pop "+populationSize+" F "+F+" CR "+CR, problem); |
| 101 | + writeHeader(" pop "+populationSize+" F "+F+" CR "+CR+" alpha "+alpha, problem); |
105 | 102 |
|
106 | 103 | String line = new String();
|
107 | 104 |
|
@@ -218,37 +215,37 @@ else if(this.mutationStrategy.equals("bo") || this.mutationStrategy.equals("bt")
|
218 | 215 | {
|
219 | 216 | case "ro":
|
220 | 217 | // DE/rand/1
|
221 |
| -// newPt = rand1(population, F, PRNGCounter); |
222 | 218 | newPt = rand1(population[r1], population[r2], population[r3], F, PRNGCounter);
|
223 | 219 | s += ids[r2]+" "+ids[r3]+" "+ids[r1];
|
224 | 220 | break;
|
225 | 221 | case "ctbo":
|
226 | 222 | // DE/cur-to-best/1
|
227 |
| -// newPt = currentToBest1(population, best, j, F, PRNGCounter); |
228 | 223 | newPt = currentToBest1(currPt, population[indexBest], population[r1], population[r2], F, PRNGCounter);
|
229 | 224 | s += ids[j]+" "+ids[indexBest]+" "+ids[r1]+" "+ids[r2];
|
230 | 225 | break;
|
231 | 226 | case "rt":
|
232 | 227 | // DE/rand/2
|
233 |
| - newPt = rand2(population, F, PRNGCounter); |
| 228 | + newPt = rand2(population[r1], population[r2], population[r3], population[r4], population[r5], F, PRNGCounter); |
| 229 | + s+= ids[r1]+" "+ids[r2]+" "+ids[r3]+" "+ids[r4]+" "+ids[r5]; |
234 | 230 | break;
|
235 | 231 | case "ctro":
|
236 | 232 | // DE/current-to-rand/1
|
237 |
| - crossPt = currentToRand1(population, j, F,PRNGCounter); |
| 233 | + crossPt = currentToRand1(population[r1], population[r2], population[r3], currPt, F, PRNGCounter); |
| 234 | + s += ids[j]+" "+ids[r1]+" "+ids[r2]+" "+ids[r3]; |
238 | 235 | break;
|
239 | 236 | case "rtbt":
|
240 | 237 | // DE/rand-to-best/2
|
241 | 238 | newPt = randToBest2(population, best, F, PRNGCounter);
|
242 | 239 | break;
|
243 | 240 | case "bo":
|
244 | 241 | // DE/best/1
|
245 |
| -// newPt = best1(population, best, F, PRNGCounter); |
246 | 242 | newPt = best1(population[indexBest], population[r1], population[r2], F, PRNGCounter);
|
247 | 243 | s+= ids[indexBest]+" "+ids[r1]+" "+ids[r2];
|
248 | 244 | break;
|
249 | 245 | case "bt":
|
250 | 246 | // DE/best/2
|
251 |
| - newPt = best2(population, best, F, PRNGCounter); |
| 247 | + newPt = best2(population[indexBest], population[r1], population[r2], population[r3], population[r4], F, PRNGCounter); |
| 248 | + s+= ids[indexBest]+" "+ids[r1]+" "+ids[r2]+" "+ids[r3]+" "+ids[r4]; |
252 | 249 | break;
|
253 | 250 | default:
|
254 | 251 | break;
|
@@ -277,13 +274,12 @@ else if (crossoverStrategy == 'x')
|
277 | 274 | {
|
278 | 275 | for (int n = 0; n < problemDimension; n++)
|
279 | 276 | temp[j][n] = crossPt[n];
|
280 |
| -// newPop[j][n] = crossPt[n]; |
| 277 | + |
281 | 278 | fitnesses[j] = crossFit;
|
282 | 279 |
|
283 | 280 | temp2[j] = crossFit;
|
284 | 281 | idsTemp[j] = newID;
|
285 | 282 |
|
286 |
| - //line =""+newID+" "+ids[r2]+" "+ids[r3]+" "+ids[indexBest]+" "+formatter(fitnesses[j])+" "+i+" "+ids[j]; |
287 | 283 | line =""+newID+" "+s+" "+formatter(fitnesses[j])+" "+i+" "+ids[j];
|
288 | 284 | for(int n = 0; n < problemDimension; n++)
|
289 | 285 | line+=" "+formatter(population[j][n]);
|
@@ -324,7 +320,6 @@ else if (crossoverStrategy == 'x')
|
324 | 320 | idsTemp=null;
|
325 | 321 |
|
326 | 322 | }
|
327 |
| - |
328 | 323 |
|
329 | 324 | closeAll();
|
330 | 325 | writeStats(FullName, (double) this.numberOfCorrections/maxEvaluations, PRNGCounter.getCounter(), "correctionsDE");
|
|
0 commit comments