Free cookie consent management tool by TermsFeed Policy Generator

Changeset 297


Ignore:
Timestamp:
06/05/08 12:09:22 (16 years ago)
Author:
gkronber
Message:
  • fixed "off by one" bug when determining the number of badChildren needed from the successRatioLimit.
  • fixed a bug in the calculation of the current successRatio. (used number of good Children in the last generation instead of the total number of good children

(ticket #142)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringSelector.cs

    r296 r297  
    106106          // only keep the child if we have not filled up the pool or if we reached the
    107107          // selection pressure limit in which case we have to keep more lucky losers than usual
    108           if ((1 - successRatioLimit) * parents.SubScopes.Count >= badChildren.Count ||
     108          if ((1 - successRatioLimit) * parents.SubScopes.Count > badChildren.Count ||
    109109            selectionPressure.Data >= selectionPressureLimit) {
    110110            badChildren.Add(child);
     
    116116      // calculate actual selection pressure and success ratio
    117117      selectionPressure.Data += (goodCount + badCount) / ((double)parents.SubScopes.Count);
    118       successRatio.Data = goodCount / ((double)parents.SubScopes.Count);
     118      successRatio.Data = goodChildren.Count / ((double)parents.SubScopes.Count);
    119119
    120120      // check if enough children have been generated
Note: See TracChangeset for help on using the changeset viewer.