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.

File:
1 edited

Legend:

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

    r17180 r17198  
    221221        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    222222      }
     223
    223224      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
    224       if (optionalMutatorParameter != null) {
     225      var mutatorParameter = MutatorParameter as ConstrainedValueParameter<IManipulator>;
     226      if (mutatorParameter == null && optionalMutatorParameter != null) {
    225227        Parameters.Remove(optionalMutatorParameter);
    226228        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
Note: See TracChangeset for help on using the changeset viewer.