Ignore:
Timestamp:
07/12/16 20:35:19 (5 years ago)
Author:
gkronber
Message:

#1966: renamed evaluators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs

    r14048 r14050  
    3737  [Item("PackingPlan", "Represents a concrete solution for a bin-packing problem.")]
    3838  [StorableClass]
    39   public abstract class PackingPlan<D, B, I> :Item, IPackingPlan
     39  public abstract class PackingPlan<D, B, I> : Item, IPackingPlan
    4040    where D : class, IPackingPosition
    4141    where B : PackingShape<D>
     
    7777
    7878    protected PackingPlan(B binMeasures, bool useExtremePoints, bool stackingConstraints)
    79       : base(){
    80         BinMeasures = (B)binMeasures.Clone();
    81         StackingConstraints = stackingConstraints;
    82         UseExtremePoints = useExtremePoints;
    83         BinPackings = new ObservableList<BinPacking<D, B, I>>();
     79      : base() {
     80      BinMeasures = (B)binMeasures.Clone();
     81      StackingConstraints = stackingConstraints;
     82      UseExtremePoints = useExtremePoints;
     83      BinPackings = new ObservableList<BinPacking<D, B, I>>();
    8484    }
    8585
    8686    [StorableConstructor]
    8787    protected PackingPlan(bool deserializing) : base(deserializing) { }
    88     protected PackingPlan(PackingPlan<D,B,I> original, Cloner cloner)
     88    protected PackingPlan(PackingPlan<D, B, I> original, Cloner cloner)
    8989      : base(original, cloner) {
    90         this.BinPackings = new ObservableList<BinPacking<D, B, I>>(original.BinPackings);
    91     }
    92    
     90      this.BinPackings = new ObservableList<BinPacking<D, B, I>>(original.BinPackings);
     91    }
     92
    9393
    9494    public abstract BinPacking<D, B, I> NewBinPacking();
    9595    public void UpdateBinPackings() {
    9696      BinPackings.RemoveAll(x => x.ItemPositions.Count == 0);
    97       BinPackings = new ObservableList<BinPacking<D, B, I>>(BinPackings.OrderByDescending (bp => bp.PackingDensity));
     97      BinPackings = new ObservableList<BinPacking<D, B, I>>(BinPackings.OrderByDescending(bp => bp.PackingDensity));
    9898    }
    9999
     
    139139      UpdateBinPackings();
    140140
    141       var newSolution = new ObservableDictionary<int,ItemList<PackingInformation>> ();
     141      var newSolution = new ObservableDictionary<int, ItemList<PackingInformation>>();
    142142      foreach (var bp in BinPackings) {
    143143        int binIndex = newSolution.Count;
    144144        newSolution[binIndex] = new ItemList<PackingInformation>();
    145145        foreach (var entry in bp.ItemPositions)
    146           newSolution[binIndex].Add(new PackingInformation (entry.Key, entry.Value.Rotated));
     146          newSolution[binIndex].Add(new PackingInformation(entry.Key, entry.Value.Rotated));
    147147      }
    148148      solution.PackingInformations = newSolution;
     
    167167      var temp = new List<int>(remainingIDs);
    168168      foreach (int id in temp) {
    169         foreach (var bp in BinPackings) { 
    170           var position = UseExtremePoints ? bp.FindExtremePointForItem (itemMeasures[id], false, StackingConstraints) : bp.FindPositionBySliding(itemMeasures[id], false);
     169        foreach (var bp in BinPackings) {
     170          var position = UseExtremePoints ? bp.FindExtremePointForItem(itemMeasures[id], false, StackingConstraints) : bp.FindPositionBySliding(itemMeasures[id], false);
    171171          if (position != null) {
    172172            bp.PackItem(id, itemMeasures[id], position);
     
    195195        binIndex++;
    196196      }
    197       solution.GroupingVector = new IntegerVector (newSolution);
     197      solution.GroupingVector = new IntegerVector(newSolution);
    198198    }
    199199    public void Pack(PackingSequenceEncoding solution, ItemList<I> itemMeasures) {
Note: See TracChangeset for help on using the changeset viewer.