Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/15 13:28:37 (10 years ago)
Author:
abeham
Message:

#2174:

  • Some refactorings and bug fixes
  • Renamed (Binary|Integer|Real)Encoding to (Binary|Integer|Real)VectorEncoding
  • Improved error messages when compiling programmable problems
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/BasicProblem.cs

    r11880 r11885  
    126126        foreach (var multi in nestedEncodings)
    127127          AdaptEncodingOperators(multi.oldEnc, multi.newEnc);
    128 
    129         foreach (var op in oldMultiEncoding.Operators.OfType<IMultiEncodingOperator>())
    130           foreach (var multi in nestedEncodings)
    131             op.ReplaceEncoding(multi.oldEnc, multi.newEnc);
    132128      }
    133129
     
    137133      var newOperators = newEncoding.Operators;
    138134
    139 
    140       var operators = oldOperators.Intersect(newOperators, comparer).Select(op => cloner.Clone(op));
    141       operators = operators.Union(newOperators, comparer).ToList();
     135      cloner.RegisterClonedObject(oldEncoding, newEncoding);
     136      var operators = oldOperators.Intersect(newOperators, comparer)
     137                                  .Select(cloner.Clone)
     138                                  .Union(newOperators, comparer).ToList();
    142139
    143140      newEncoding.ConfigureOperators(operators);
Note: See TracChangeset for help on using the changeset viewer.