Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/12/16 13:53:16 (8 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/RandomLinearLinkageCreator.cs

    r14185 r14475  
    4141
    4242    public static LinearLinkage Apply(IRandom random, int length) {
    43       var solution = new LinearLinkage(length);
    4443      var groups = Enumerable.Range(0, length).Select(x => Tuple.Create(x, random.Next(length)))
    4544                                              .GroupBy(x => x.Item2)
    4645                                              .Select(x => x.Select(y => y.Item1).ToList());
    47       solution.SetGroups(groups);
    48       return solution;
     46      return LinearLinkage.FromGroups(length, groups);
    4947    }
    5048
Note: See TracChangeset for help on using the changeset viewer.