Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/26/14 13:24:20 (10 years ago)
Author:
mkommend
Message:

#2174: Implemented multi-encoding operators and adapated wiring of operators in the programmable problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs

    r11582 r11587  
    6262
    6363    public override IEnumerable<IValueParameter> Parameters {
    64       get { return base.Parameters.Concat(new IValueParameter[] { LengthParameter, BoundsParameter }); }
     64      get { return new IValueParameter[] { LengthParameter, BoundsParameter }; }
    6565    }
    6666    #endregion
     
    101101      lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length));
    102102      boundsParameter = new ValueParameter<DoubleMatrix>(Name + "Bounds", bounds);
     103
     104      SolutionCreator = new UniformRandomRealVectorCreator();
    103105      RegisterParameterEvents();
    104106      DiscoverOperators();
    105       SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();
    106107    }
    107108
     
    119120      lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length));
    120121      boundsParameter = new ValueParameter<DoubleMatrix>(Name + "Bounds", bounds);
     122
     123      SolutionCreator = new UniformRandomRealVectorCreator();
    121124      RegisterParameterEvents();
    122125      DiscoverOperators();
    123       SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();
    124126    }
    125127
     
    167169      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, true, false, false);
    168170      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
    169       var newOperators = operators.Except(encodingOperators, new TypeEqualityComparer<IOperator>()).ToList();
     171      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
    170172
    171173      ConfigureOperators(newOperators);
    172       encodingOperators.AddRange(newOperators);
     174      foreach (var @operator in newOperators)
     175        encodingOperators.Add(@operator);
    173176
    174177      foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>())
Note: See TracChangeset for help on using the changeset viewer.