Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/10/19 12:16:18 (5 years ago)
Author:
mkommend
Message:

#3020: Adapated AfterDeserializationHook of genetic algorithms to check if the mutator parameter already has the correct type.
In detail the following algorithms have been adapted: ALPS-GA, ALPS-OSGA, GA, Island-GA, NSGA-2, Island-OSGA, OSGA, SASEGASA.

Location:
trunk/HeuristicLab.Algorithms.ALPS/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs

    r17180 r17198  
    253253      #region Backwards compatible code, remove with 3.4
    254254      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
    255       if (optionalMutatorParameter != null) {
     255      var mutatorParameter = MutatorParameter as ConstrainedValueParameter<IManipulator>;
     256      if (mutatorParameter == null && optionalMutatorParameter != null) {
    256257        Parameters.Remove(optionalMutatorParameter);
    257258        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
  • trunk/HeuristicLab.Algorithms.ALPS/3.3/AlpsOffspringSelectionGeneticAlgorithm.cs

    r17180 r17198  
    300300      #region Backwards compatible code, remove with 3.4
    301301      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
    302       if (optionalMutatorParameter != null) {
     302      var mutatorParameter = MutatorParameter as ConstrainedValueParameter<IManipulator>;
     303      if (mutatorParameter == null && optionalMutatorParameter != null) {
    303304        Parameters.Remove(optionalMutatorParameter);
    304305        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
Note: See TracChangeset for help on using the changeset viewer.