- Timestamp:
- 02/01/18 12:21:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Sorting/PermutationPackingItemSorter.cs
r15646 r15705 136 136 return new Permutation(PermutationTypes.Absolute, 137 137 items.Select((v, i) => new { Index = i, Item = v }) 138 ./*OrderByDescending(x => x.Item.IsStackabel ? 1 : 0) 139 .*/OrderByDescending(x => x.Item.Material) 138 .OrderByDescending(x => x.Item.Layer) 140 139 .ThenByDescending(x => x.Item.Depth * x.Item.Width * x.Item.Height) 141 140 .ThenByDescending(x => x.Item.Height) … … 151 150 return new Permutation(PermutationTypes.Absolute, 152 151 items.Select((v, i) => new { Index = i, Item = v }) 153 ./*OrderByDescending(x => x.Item.IsStackabel ? 1 : 0) 154 .*/OrderByDescending(x => x.Item.Material) 152 .OrderByDescending(x => x.Item.Layer) 155 153 .ThenByDescending(x => x.Item.Height) 156 154 .ThenByDescending(x => x.Item.Depth * x.Item.Width * x.Item.Height) … … 166 164 return new Permutation(PermutationTypes.Absolute, 167 165 items.Select((v, i) => new { Index = i, Item = v }) 168 ./*OrderByDescending(x => x.Item.IsStackabel ? 1 : 0) 169 .*/OrderByDescending(x => x.Item.Material) 166 .OrderByDescending(x => x.Item.Layer) 170 167 .ThenByDescending(x => x.Item.Depth * x.Item.Width) 171 168 .ThenByDescending(x => x.Item.Height) … … 181 178 return new Permutation(PermutationTypes.Absolute, 182 179 items.Select((v, i) => new { Index = i, Item = v }) 183 ./*OrderByDescending(x => x.Item.IsStackabel ? 1 : 0) 184 .*/OrderByDescending(x => x.Item.Material) 180 .OrderByDescending(x => x.Item.Layer) 185 181 .ThenByDescending(x => x.Item.Height) 186 182 .ThenByDescending(x => x.Item.Depth * x.Item.Width) … … 202 198 items.Select((v, i) => new { Index = i, Item = v, ClusterId = (int)(Math.Ceiling(v.Width * v.Depth / clusterRange)) }) 203 199 .GroupBy(x => x.ClusterId) 204 .Select(x => new { Cluster = x.Key, Items = x.OrderByDescending(z => z.Item. Material).ThenByDescending(y => y.Item.Height).ToList() })200 .Select(x => new { Cluster = x.Key, Items = x.OrderByDescending(z => z.Item.Layer).ThenByDescending(y => y.Item.Height).ToList() }) 205 201 .OrderByDescending(x => x.Cluster) 206 202 .SelectMany(x => x.Items) … … 222 218 items.Select((v, i) => new { Index = i, Item = v, ClusterId = (int)(Math.Ceiling(v.Height / clusterRange2)) }) 223 219 .GroupBy(x => x.ClusterId) 224 .Select(x => new { Cluster = x.Key, Items = x.OrderByDescending(z => z.Item. Material).ThenByDescending(y => y.Item.Depth * y.Item.Width).ToList() })220 .Select(x => new { Cluster = x.Key, Items = x.OrderByDescending(z => z.Item.Layer).ThenByDescending(y => y.Item.Depth * y.Item.Width).ToList() }) 225 221 .OrderByDescending(x => x.Cluster) 226 222 .SelectMany(x => x.Items)
Note: See TracChangeset
for help on using the changeset viewer.