Changeset 14167 for trunk/sources
- Timestamp:
- 07/21/16 21:07:27 (8 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj
r13567 r14167 149 149 <EmbeddedResource Include="Documents\ALPSGP_SymReg.hl" /> 150 150 <EmbeddedResource Include="Documents\ALPSGA_TSP.hl" /> 151 <EmbeddedResource Include="Documents\TS_BPP.hl" /> 151 152 <None Include="Plugin.cs.frame" /> 152 153 <Compile Include="OptimizerSingleDocumentMainForm.cs"> -
trunk/sources/HeuristicLab.Optimizer/3.3/StartPage.cs
r13228 r14167 135 135 var standardProblems = new List<string> { "ALPSGA_TSP", "ES_Griewank", "GA_Grouping", "GA_TSP", "GA_VRP", "GE_ArtificialAnt", 136 136 "IslandGA_TSP", "LS_Knapsack", "PSO_Schwefel", "RAPGA_JSSP", 137 "SA_Rastrigin", "SGP_SantaFe","GP_Multiplexer", "SS_VRP", "TS_TSP", "TS_VRP", "VNS_OP", "VNS_TSP" 137 "SA_Rastrigin", "SGP_SantaFe","GP_Multiplexer", "SS_VRP", "TS_TSP", "TS_VRP", "VNS_OP", "VNS_TSP", "TS_BPP" 138 138 }; 139 139 groupLookup[standardProblemsGroup] = standardProblems; -
trunk/sources/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlan2DView.cs
r14162 r14167 57 57 private void UpdateState(PackingPlan<BinPacking2D.PackingPosition, PackingShape, PackingItem> plan) { 58 58 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 59 container2DView.Packing = plan.Bin Packings[currentBin];59 container2DView.Packing = plan.Bins[currentBin]; 60 60 } 61 61 -
trunk/sources/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlan3DView.cs
r14162 r14167 47 47 } else { 48 48 int i = 0; 49 foreach (var bp in Content.Bin Packings)49 foreach (var bp in Content.Bins) 50 50 binSelection.Items.Add(i++ + " (" + Math.Round(bp.PackingDensity * 100, 2) + "%)"); 51 51 … … 57 57 private void ShowSelectedPacking() { 58 58 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 59 packingPlan3D.Packing = Content.Bin Packings[currentBin];59 packingPlan3D.Packing = Content.Bins[currentBin]; 60 60 } 61 61 … … 66 66 // add items of this container 67 67 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 68 var packing = Content.Bin Packings[currentBin];68 var packing = Content.Bins[currentBin]; 69 69 foreach (var item in packing.Items) { 70 70 itemSelection.Items.Add(item.Key); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/Evaluators/BinUtilizationEvaluator.cs
r14162 r14167 53 53 54 54 for (int i = 0; i < nrOfBins; i++) { 55 totalUsableSpace += solution.Bin Packings[i].BinShape.Volume;56 totalUsedSpace += solution.Bin Packings[i].Items.Sum(kvp => kvp.Value.Volume);55 totalUsableSpace += solution.Bins[i].BinShape.Volume; 56 totalUsedSpace += solution.Bins[i].Items.Sum(kvp => kvp.Value.Volume); 57 57 } 58 58 -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/Evaluators/PackingRatioEvaluator.cs
r14162 r14167 60 60 const double k = 2; 61 61 for (int i = 0; i < nrOfBins; i++) { 62 double f = solution.Bin Packings[i].Items.Sum(kvp => kvp.Value.Volume);63 double c = solution.Bin Packings[i].BinShape.Volume;62 double f = solution.Bins[i].Items.Sum(kvp => kvp.Value.Volume); 63 double c = solution.Bins[i].BinShape.Volume; 64 64 result += Math.Pow(f / c, k); 65 65 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/IntegerVectorEncoding/BottomLeftIntegerVectorDecoder.cs
r14162 r14167 53 53 Solution partialSolution, 54 54 ref IList<int> remainingIDs, IList<PackingItem> items) { 55 var bp = new BinPacking2D(partialSolution.Bin Measures);55 var bp = new BinPacking2D(partialSolution.BinShape); 56 56 bp.SlidingBasedPacking(ref remainingIDs, items); 57 57 return bp; -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/IntegerVectorEncoding/ExtremePointIntegerVectorDecoder.cs
r14162 r14167 53 53 Solution partialSolution, 54 54 ref IList<int> remainingIDs, IList<PackingItem> items) { 55 var bp = new BinPacking2D(partialSolution.Bin Measures);55 var bp = new BinPacking2D(partialSolution.BinShape); 56 56 bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false); 57 57 return bp; -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/IntegerVectorEncoding/IntegerVectorDecoderBase.cs
r14162 r14167 47 47 foreach (var sequence in sequenceMatrix) { 48 48 remainingIDs = remainingIDs.Concat(sequence).ToList(); 49 result.Bin Packings.Add(CreatePacking(result, ref remainingIDs, items));49 result.Bins.Add(CreatePacking(result, ref remainingIDs, items)); 50 50 } 51 51 result.UpdateBinPackings(); … … 54 54 var temp = new List<int>(remainingIDs); 55 55 foreach (int id in temp) { 56 foreach (BinPacking2D bp in result.Bin Packings) {56 foreach (BinPacking2D bp in result.Bins) { 57 57 var position = FindPositionForItem(bp, items[id]); 58 58 if (position != null) { … … 66 66 //Put still remaining items in new bins 67 67 while (remainingIDs.Count > 0) { 68 result.Bin Packings.Add(CreatePacking(result, ref remainingIDs, items));68 result.Bins.Add(CreatePacking(result, ref remainingIDs, items)); 69 69 } 70 70 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/PermutationEncoding/BottomLeftPermutationDecoder.cs
r14162 r14167 47 47 var bp = new BinPacking2D(binShape); 48 48 bp.SlidingBasedPacking(ref remainingIDs, items); 49 result.Bin Packings.Add(bp);49 result.Bins.Add(bp); 50 50 } 51 51 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/PermutationEncoding/ExtremePointPermutationDecoder.cs
r14162 r14167 47 47 var bp = new BinPacking2D(binShape); 48 48 bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false); 49 result.Bin Packings.Add(bp);49 result.Bins.Add(bp); 50 50 } 51 51 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/Solution.cs
r14162 r14167 29 29 [StorableClass] 30 30 public class Solution : PackingPlan<PackingPosition, PackingShape, PackingItem> { 31 public Solution(PackingShape bin Measures) : this(binMeasures, false, false) { }32 public Solution(PackingShape bin Measures, bool useExtremePoints, bool stackingConstraints) : base(binMeasures, useExtremePoints, stackingConstraints) { }31 public Solution(PackingShape binShape) : this(binShape, false, false) { } 32 public Solution(PackingShape binShape, bool useExtremePoints, bool stackingConstraints) : base(binShape, useExtremePoints, stackingConstraints) { } 33 33 [StorableConstructor] 34 34 protected Solution(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/Evaluators/BinUtilizationEvaluator.cs
r14162 r14167 54 54 55 55 for (int i = 0; i < nrOfBins; i++) { 56 totalUsableSpace += solution.Bin Packings[i].BinShape.Volume;57 totalUsedSpace += solution.Bin Packings[i].Items.Sum(kvp => kvp.Value.Volume);56 totalUsableSpace += solution.Bins[i].BinShape.Volume; 57 totalUsedSpace += solution.Bins[i].Items.Sum(kvp => kvp.Value.Volume); 58 58 } 59 59 -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/Evaluators/PackingRatioEvaluator.cs
r14162 r14167 61 61 const double k = 2; 62 62 for (int i = 0; i < nrOfBins; i++) { 63 double f = solution.Bin Packings[i].Items.Sum(kvp => kvp.Value.Volume);64 double c = solution.Bin Packings[i].BinShape.Volume;63 double f = solution.Bins[i].Items.Sum(kvp => kvp.Value.Volume); 64 double c = solution.Bins[i].BinShape.Volume; 65 65 result += Math.Pow(f / c, k); 66 66 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/IntegerVectorEncoding/BottomLeftIntegerVectorDecoder.cs
r14162 r14167 60 60 Solution partialSolution, 61 61 ref IList<int> remainingIDs, IList<PackingItem> items, bool useStackingConstraints) { 62 var bp = new BinPacking3D(partialSolution.Bin Measures);62 var bp = new BinPacking3D(partialSolution.BinShape); 63 63 bp.SlidingBasedPacking(ref remainingIDs, items); 64 64 return bp; -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/IntegerVectorEncoding/ExtremePointIntegerVectorDecoder.cs
r14162 r14167 53 53 Solution partialSolution, 54 54 ref IList<int> remainingIDs, IList<PackingItem> items, bool useStackingConstraints) { 55 var bp = new BinPacking3D(partialSolution.Bin Measures);55 var bp = new BinPacking3D(partialSolution.BinShape); 56 56 bp.ExtremePointBasedPacking(ref remainingIDs, items, useStackingConstraints); 57 57 return bp; -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/IntegerVectorEncoding/IntegerVectorDecoderBase.cs
r14162 r14167 47 47 foreach (var sequence in sequenceMatrix) { 48 48 remainingIDs = remainingIDs.Concat(sequence).ToList(); 49 result.Bin Packings.Add(CreatePacking(result, ref remainingIDs, items, useStackingConstraints));49 result.Bins.Add(CreatePacking(result, ref remainingIDs, items, useStackingConstraints)); 50 50 } 51 51 result.UpdateBinPackings(); … … 54 54 var temp = new List<int>(remainingIDs); 55 55 foreach (int id in temp) { 56 foreach (BinPacking3D bp in result.Bin Packings) {56 foreach (BinPacking3D bp in result.Bins) { 57 57 var position = FindPositionForItem(bp, items[id], useStackingConstraints); 58 58 if (position != null) { … … 66 66 //Put still remaining items in new bins 67 67 while (remainingIDs.Count > 0) { 68 result.Bin Packings.Add(CreatePacking(result, ref remainingIDs, items, useStackingConstraints));68 result.Bins.Add(CreatePacking(result, ref remainingIDs, items, useStackingConstraints)); 69 69 } 70 70 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/IntegerVectorEncoding/IntegerVectorProblem.cs
r14162 r14167 35 35 [Creatable(Category = CreatableAttribute.Categories.CombinatorialProblems, Priority = 330)] 36 36 public sealed class IntegerVectorProblem : ProblemBase<IntegerVectorEncoding, IntegerVector> { 37 // persistence38 37 [StorableConstructor] 39 38 private IntegerVectorProblem(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/PermutationEncoding/BottomLeftPermutationDecoder.cs
r14162 r14167 47 47 var bp = new BinPacking3D(binShape); 48 48 bp.SlidingBasedPacking(ref remainingIDs, items); 49 result.Bin Packings.Add(bp);49 result.Bins.Add(bp); 50 50 } 51 51 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/PermutationEncoding/ExtremePointPermutationDecoder.cs
r14162 r14167 47 47 var bp = new BinPacking3D(binShape); 48 48 bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: useStackingConstraints); 49 result.Bin Packings.Add(bp);49 result.Bins.Add(bp); 50 50 } 51 51 result.UpdateBinPackings(); -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/PermutationEncoding/PermutationProblem.cs
r14162 r14167 34 34 [Creatable(Category = CreatableAttribute.Categories.CombinatorialProblems, Priority = 320)] 35 35 public sealed class PermutationProblem : ProblemBase<PermutationEncoding, Permutation> { 36 // persistence37 36 [StorableConstructor] 38 37 private PermutationProblem(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/Solution.cs
r14162 r14167 8 8 [StorableClass] 9 9 public class Solution : PackingPlan<PackingPosition, PackingShape, PackingItem> { 10 public Solution(PackingShape bin Measures) : this(binMeasures, false, false) { }11 public Solution(PackingShape bin Measures, bool useExtremePoints, bool stackingConstraints) : base(binMeasures, useExtremePoints, stackingConstraints) { }10 public Solution(PackingShape binShape) : this(binShape, false, false) { } 11 public Solution(PackingShape binShape, bool useExtremePoints, bool stackingConstraints) : base(binShape, useExtremePoints, stackingConstraints) { } 12 12 [StorableConstructor] 13 13 protected Solution(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/PackingPlan.cs
r14162 r14167 38 38 public int NrOfBins { 39 39 get { 40 if (Bin Packings != null)41 return Bin Packings.Count;40 if (Bins != null) 41 return Bins.Count; 42 42 else return 0; 43 43 } … … 49 49 50 50 [Storable] 51 public B Bin Measures{ get; private set; }51 public B BinShape { get; private set; } 52 52 53 53 [Storable] 54 public ObservableList<BinPacking<D, B, I>> Bin Packings { get; set; }54 public ObservableList<BinPacking<D, B, I>> Bins { get; set; } 55 55 56 56 [Storable] … … 69 69 #endregion 70 70 71 protected PackingPlan(B bin Measures, bool useExtremePoints, bool stackingConstraints)71 protected PackingPlan(B binShape, bool useExtremePoints, bool stackingConstraints) 72 72 : base() { 73 Bin Measures = (B)binMeasures.Clone();73 BinShape = (B)binShape.Clone(); 74 74 StackingConstraints = stackingConstraints; 75 75 UseExtremePoints = useExtremePoints; 76 Bin Packings = new ObservableList<BinPacking<D, B, I>>();76 Bins = new ObservableList<BinPacking<D, B, I>>(); 77 77 } 78 78 … … 81 81 protected PackingPlan(PackingPlan<D, B, I> original, Cloner cloner) 82 82 : base(original, cloner) { 83 this.Bin Packings = new ObservableList<BinPacking<D, B, I>>(original.BinPackings.Select(p => cloner.Clone(p)));83 this.Bins = new ObservableList<BinPacking<D, B, I>>(original.Bins.Select(p => cloner.Clone(p))); 84 84 UseExtremePoints = original.UseExtremePoints; 85 85 StackingConstraints = original.StackingConstraints; 86 Bin Measures = cloner.Clone(original.BinMeasures);86 BinShape = cloner.Clone(original.BinShape); 87 87 Quality = cloner.Clone(original.Quality); 88 88 } … … 90 90 91 91 public void UpdateBinPackings() { 92 Bin Packings.RemoveAll(x => x.Positions.Count == 0);93 Bin Packings = new ObservableList<BinPacking<D, B, I>>(BinPackings.OrderByDescending(bp => bp.PackingDensity));92 Bins.RemoveAll(x => x.Positions.Count == 0); 93 Bins = new ObservableList<BinPacking<D, B, I>>(Bins.OrderByDescending(bp => bp.PackingDensity)); 94 94 } 95 95 … … 110 110 OnQualityChanged(); 111 111 } 112 113 public event EventHandler BinPackingsChanged;114 112 #endregion 115 113 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/PackingShape.cs
r14162 r14167 78 78 public abstract int CompareTo(object obj); 79 79 80 [Storable] 80 81 public IKeyedItemCollection<string, IParameter> Parameters { get; private set; } 81 82 } -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r14121 r14167 270 270 <SpecificVersion>False</SpecificVersion> 271 271 <HintPath>..\bin\HeuristicLab.Problems.Binary-3.3.dll</HintPath> 272 <Private>False</Private> 273 </Reference> 274 <Reference Include="HeuristicLab.Problems.BinPacking-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 275 <SpecificVersion>False</SpecificVersion> 276 <HintPath>..\bin\HeuristicLab.Problems.BinPacking-3.3.dll</HintPath> 272 277 <Private>False</Private> 273 278 </Reference> … … 451 456 <Compile Include="HeuristicLab-3.3\PluginLoader.cs" /> 452 457 <Compile Include="HeuristicLab-3.3\Samples\AlpsSampleTest.cs" /> 458 <Compile Include="HeuristicLab-3.3\Samples\TabuSearch3dBinPackingSampleTest.cs" /> 453 459 <Compile Include="HeuristicLab-3.3\Samples\GPRobocodeSampleTest.cs" /> 454 460 <Compile Include="HeuristicLab-3.3\Samples\OSESGriewankSampleTest.cs" />
Note: See TracChangeset
for help on using the changeset viewer.