Changeset 14498 for branches/symbreg-factors-2650/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Creators/MaxGroupsLinearLinkageCreator.cs
- Timestamp:
- 12/17/16 15:42:19 (8 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14457-14458,14463-14465,14468-14469,14475-14476,14478-14479,14481-14483,14486,14493-14494
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Creators/MaxGroupsLinearLinkageCreator.cs
r14185 r14498 55 55 56 56 public static LinearLinkage Apply(IRandom random, int length, int maxGroups) { 57 var solution = new LinearLinkage(length);58 57 var groups = Enumerable.Range(0, length).Select(x => Tuple.Create(x, random.Next(maxGroups))) 59 58 .GroupBy(x => x.Item2) 60 59 .Select(x => x.Select(y => y.Item1).ToList()); 61 solution.SetGroups(groups); 62 return solution; 60 return LinearLinkage.FromGroups(length, groups); 63 61 } 64 62
Note: See TracChangeset
for help on using the changeset viewer.