Changeset 15989 for branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Instances
- Timestamp:
- 07/09/18 12:59:38 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Instances/RandomInstanceProvider.cs
r15617 r15989 198 198 protected virtual void SampleItemParameters(IRandom rand, out int w, out int h, out int d) { 199 199 Contract.Assert(@class >= 1 && @class <= 5); 200 /*var weights = new double[] { 0.1, 0.1, 0.1, 0.1, 0.1 };200 var weights = new double[] { 0.1, 0.1, 0.1, 0.1, 0.1 }; 201 201 weights[@class - 1] = 0.6; 202 202 var type = Enumerable.Range(1, 5).SampleProportional(rand, 1, weights).First(); 203 */204 205 // as by Martello and Vigo206 int type = @class;207 if (type <= 5) {208 var t = rand.Next(1, 10);209 if (t <= 5) {210 type = t;211 }212 }213 203 214 204 switch (type) {
Note: See TracChangeset
for help on using the changeset viewer.