File tree 1 file changed +2
-7
lines changed
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -338,33 +338,28 @@ namespace libcmaes
338
338
}
339
339
_solutions._candidates = ncandidates;
340
340
}
341
-
341
+
342
342
template <class TParameters ,class TSolutions ,class TStopCriteria >
343
343
void ESOStrategy<TParameters,TSolutions,TStopCriteria>::tpa_update()
344
344
{
345
345
int r1 = -1 ;
346
346
int r2 = -1 ;
347
- double fval1;
348
- double fval2;
349
347
for (size_t i=0 ;i<_solutions._candidates .size ();i++)
350
348
{
351
349
if (r1 == -1 && (_solutions._candidates .at (i).get_x_dvec ()-_solutions._tpa_x1 ).isMuchSmallerThan (1e-15 ))
352
350
{
353
351
r1 = i;
354
- fval1 = _solutions._candidates .at (i).get_fvalue ();
355
352
}
356
353
if (r2 == -1 && (_solutions._candidates .at (i).get_x_dvec ()-_solutions._tpa_x2 ).isMuchSmallerThan (1e-15 ))
357
354
{
358
355
r2 = i;
359
- fval2 = _solutions._candidates .at (i).get_fvalue ();
360
356
}
361
357
if (r1 != -1 && r2 != -1 )
362
358
{
363
- // std::cout << "r1=" << r1 << " / r2=" << r2 << " / fval1=" << fval1 << " / fval2=" << fval2 << std::endl;
364
359
break ;
365
360
}
366
361
}
367
- int rank_diff = r2-r1;// std::floor((r2 - r1)/4.0);
362
+ int rank_diff = r2-r1;
368
363
_solutions._tpa_s = (1.0 - _parameters._tpa_csigma ) * _solutions._tpa_s
369
364
+ _parameters._tpa_csigma * rank_diff / (_parameters._lambda - 1.0 );
370
365
}
You can’t perform that action at this time.
0 commit comments