Ignore:
Timestamp:
07/20/16 14:02:36 (5 years ago)
Author:
gkronber
Message:

#1966: refactoring of bin packing implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/PackingRatioEvaluator.cs

    r14050 r14128  
    4141    public PackingRatioEvaluator() : base() { }
    4242
    43     protected override DoubleValue Evaluate() {
     43    protected override double Evaluate() {
    4444      DoubleValue quality = new DoubleValue(0);
    4545
     
    7474        k.......a constant, k>1.
    7575     */
    76     public static DoubleValue CalculatePackingRatio(PackingPlan<D, B, I> plan) {
     76    public static double CalculatePackingRatio(PackingPlan<D, B, I> plan) {
    7777      int nrOfBins = plan.NrOfBins;
    7878      double result = 0;
     
    9090        //k = 2 --> (Fi/C)*(Fi/C)
    9191        //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);
    9494      }
    9595
    9696      result = result / nrOfBins;
    97       return new DoubleValue(result);
     97      return result;
    9898    }
    9999  }
Note: See TracChangeset for help on using the changeset viewer.