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/IslandGeneticAlgorithm.cs

    r17180 r17198  
    211211        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 });
    212212      }
     213
    213214      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
    214       if (optionalMutatorParameter != null) {
     215      var mutatorParameter = MutatorParameter as ConstrainedValueParameter<IManipulator>;
     216      if (mutatorParameter == null && optionalMutatorParameter != null) {
    215217        Parameters.Remove(optionalMutatorParameter);
    216218        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
Note: See TracChangeset for help on using the changeset viewer.