Changeset 14128 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators
- Timestamp:
- 07/20/16 14:02:36 (8 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/BinUtilizationEvaluator.cs
r14051 r14128 42 42 public BinUtilizationEvaluator() : base() { } 43 43 44 protected override DoubleValue Evaluate() {44 protected override double Evaluate() { 45 45 DoubleValue quality = new DoubleValue(0); 46 46 … … 67 67 } 68 68 69 public static DoubleValue CalculateBinUtilization(PackingPlan<D, B, I> plan) {69 public static double CalculateBinUtilization(PackingPlan<D, B, I> plan) { 70 70 int nrOfBins = plan.NrOfBins; 71 71 double result = 0; … … 97 97 98 98 result = totalUsedSpace / totalUsableSpace; 99 return new DoubleValue(result);99 return result; 100 100 } 101 101 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/EvaluatorBase.cs
r14052 r14128 75 75 } 76 76 77 protected abstract DoubleValue Evaluate();77 protected abstract double Evaluate(); 78 78 public override IOperation Apply() { 79 QualityParameter.ActualValue = Evaluate();79 QualityParameter.ActualValue = new DoubleValue(Evaluate()); 80 80 return base.Apply(); 81 81 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/PackingRatioEvaluator.cs
r14050 r14128 41 41 public PackingRatioEvaluator() : base() { } 42 42 43 protected override DoubleValue Evaluate() {43 protected override double Evaluate() { 44 44 DoubleValue quality = new DoubleValue(0); 45 45 … … 74 74 k.......a constant, k>1. 75 75 */ 76 public static DoubleValue CalculatePackingRatio(PackingPlan<D, B, I> plan) {76 public static double CalculatePackingRatio(PackingPlan<D, B, I> plan) { 77 77 int nrOfBins = plan.NrOfBins; 78 78 double result = 0; … … 90 90 //k = 2 --> (Fi/C)*(Fi/C) 91 91 //result += (((usedSpaceInThisBin) / (usableSpace)) * ((usedSpaceInThisBin) / (usableSpace))) / (i*i + 1); 92 var PD= plan.BinPackings[i].PackingDensity;93 result += ( PD * PD) / (i + 1);92 var pd = plan.BinPackings[i].PackingDensity; 93 result += (pd * pd) / (i + 1); 94 94 } 95 95 96 96 result = result / nrOfBins; 97 return new DoubleValue(result);97 return result; 98 98 } 99 99 }
Note: See TracChangeset
for help on using the changeset viewer.