- Timestamp:
- 02/28/18 15:33:30 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Sorting/PermutationPackingItemSorter.cs
r15731 r15822 136 136 return new Permutation(PermutationTypes.Absolute, 137 137 items.Select((v, i) => new { Index = i, Item = v }) 138 .OrderBy(x => x.Item. Layer)138 .OrderBy(x => x.Item.SequenceGroup) 139 139 .ThenByDescending(x => x.Item.Depth * x.Item.Width * x.Item.Height) 140 140 .ThenByDescending(x => x.Item.Height) … … 150 150 return new Permutation(PermutationTypes.Absolute, 151 151 items.Select((v, i) => new { Index = i, Item = v }) 152 .OrderBy(x => x.Item. Layer)152 .OrderBy(x => x.Item.SequenceGroup) 153 153 .ThenByDescending(x => x.Item.Height) 154 154 .ThenByDescending(x => x.Item.Depth * x.Item.Width * x.Item.Height) … … 164 164 return new Permutation(PermutationTypes.Absolute, 165 165 items.Select((v, i) => new { Index = i, Item = v }) 166 .OrderBy(x => x.Item. Layer)166 .OrderBy(x => x.Item.SequenceGroup) 167 167 .ThenByDescending(x => x.Item.Depth * x.Item.Width) 168 168 .ThenByDescending(x => x.Item.Height) … … 178 178 return new Permutation(PermutationTypes.Absolute, 179 179 items.Select((v, i) => new { Index = i, Item = v }) 180 .OrderBy(x => x.Item. Layer)180 .OrderBy(x => x.Item.SequenceGroup) 181 181 .ThenByDescending(x => x.Item.Height) 182 182 .ThenByDescending(x => x.Item.Depth * x.Item.Width) … … 198 198 items.Select((v, i) => new { Index = i, Item = v, ClusterId = (int)(Math.Ceiling(v.Width * v.Depth / clusterRange)) }) 199 199 .GroupBy(x => x.ClusterId) 200 .Select(x => new { Cluster = x.Key, Items = x.OrderBy(z => z.Item. Layer).ThenByDescending(y => y.Item.Height).ToList() })200 .Select(x => new { Cluster = x.Key, Items = x.OrderBy(z => z.Item.SequenceGroup).ThenByDescending(y => y.Item.Height).ToList() }) 201 201 .OrderByDescending(x => x.Cluster) 202 202 .SelectMany(x => x.Items) … … 218 218 items.Select((v, i) => new { Index = i, Item = v, ClusterId = (int)(Math.Ceiling(v.Height / clusterRange2)) }) 219 219 .GroupBy(x => x.ClusterId) 220 .Select(x => new { Cluster = x.Key, Items = x.OrderBy(z => z.Item. Layer).ThenByDescending(y => y.Item.Depth * y.Item.Width).ToList() })220 .Select(x => new { Cluster = x.Key, Items = x.OrderBy(z => z.Item.SequenceGroup).ThenByDescending(y => y.Item.Depth * y.Item.Width).ToList() }) 221 221 .OrderByDescending(x => x.Cluster) 222 222 .SelectMany(x => x.Items)
Note: See TracChangeset
for help on using the changeset viewer.