Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/12/16 13:53:16 (7 years ago)
Author:
sraggl
Message:

#2666
Updated LinearLinkageEncoding by:

  • Speeding up GroupCrossover and SetGroups and GetGroups
  • making Constructor private adding static initializer Methods
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Creators/MaxGroupsLinearLinkageCreator.cs

    r14185 r14475  
    5555
    5656    public static LinearLinkage Apply(IRandom random, int length, int maxGroups) {
    57       var solution = new LinearLinkage(length);
    5857      var groups = Enumerable.Range(0, length).Select(x => Tuple.Create(x, random.Next(maxGroups)))
    5958                                              .GroupBy(x => x.Item2)
    6059                                              .Select(x => x.Select(y => y.Item1).ToList());
    61       solution.SetGroups(groups);
    62       return solution;
     60      return LinearLinkage.FromGroups(length, groups);
    6361    }
    6462
Note: See TracChangeset for help on using the changeset viewer.