Changeset 7509


Ignore:
Timestamp:
02/24/12 08:23:08 (7 years ago)
Author:
mkommend
Message:

#1691: Corrected setting of default operators in the GeneticAlgorithm & OSGA.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r7493 r7509  
    361361        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
    362362        if (crossover != null) CrossoverParameter.Value = crossover;
    363       } else if (defaultCrossover != null)
     363        else oldCrossover = null;
     364      }
     365      if (oldCrossover == null && defaultCrossover != null)
    364366        CrossoverParameter.Value = defaultCrossover;
    365367    }
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r7493 r7509  
    455455        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
    456456        if (crossover != null) CrossoverParameter.Value = crossover;
    457       } else if (defaultCrossover != null)
     457        else oldCrossover = null;
     458      }
     459      if (oldCrossover == null && defaultCrossover != null)
    458460        CrossoverParameter.Value = defaultCrossover;
    459461    }
Note: See TracChangeset for help on using the changeset viewer.