Changeset 14046 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence
- Timestamp:
- 07/12/16 19:34:31 (8 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/GroupingMoveHardTabuCriterion.cs
r13032 r14046 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.BinPacking .Interfaces;30 using HeuristicLab.Problems.BinPacking; 31 31 32 32 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 83 83 int length = PackingSequence.PackingSequence.Length; 84 84 double moveQuality = MoveQualityParameter.ActualValue.Value; 85 bool maximization = MaximizationParameter.ActualValue.Value; 85 bool maximization = MaximizationParameter.ActualValue.Value; 86 86 bool useAspiration = UseAspirationCriterionParameter.Value.Value; 87 87 bool isTabu = IsMoveTabu(tabuList, move, PackingSequence, moveQuality, maximization, useAspiration); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/GroupingMoveMaker.cs
r13032 r14046 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.BinPacking .Interfaces;30 using HeuristicLab.Problems.BinPacking; 31 31 32 32 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/GroupingMoveSoftTabuCriterion.cs
r13032 r14046 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.BinPacking.Interfaces; 30 using HeuristicLab.Problems.BinPacking; 31 31 32 32 33 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/Insertion/InsertionMove.cs
r13032 r14046 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.BinPacking.Interfaces; 28 using HeuristicLab.Problems.BinPacking; 29 29 30 30 31 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 102 103 } else 103 104 if (Index1 == attr.Index1 && Index2 == attr.Index2) 104 105 return true; 105 106 } 106 107 return false; … … 108 109 109 110 public override string ToString() { 110 return "IM(i1=" +Index1 + ", i2=" + Index2 +")";111 return "IM(i1=" + Index1 + ", i2=" + Index2 + ")"; 111 112 } 112 113 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/Insertion/InsertionMoveGenerator.cs
r13032 r14046 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Problems.BinPacking.Interfaces; 29 using HeuristicLab.Problems.BinPacking; 30 30 31 31 32 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/SequenceMove.cs
r13032 r14046 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.BinPacking .Interfaces;27 using HeuristicLab.Problems.BinPacking; 28 28 29 29 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/SequenceTabuMaker.cs
r13032 r14046 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.BinPacking .Interfaces;28 using HeuristicLab.Problems.BinPacking; 29 29 30 30 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { 31 31 [Item("Sequence tabu maker", "Declares a given Sequence move as tabu, by adding its attributes to the tabu list and also store the solution quality or the move quality (whichever is better).")] 32 32 [StorableClass] 33 public class SequenceTabuMaker : TabuMaker, IPackingSequenceMoveOperator {33 public class SequenceTabuMaker : TabuMaker, IPackingSequenceMoveOperator { 34 34 public ILookupParameter<IPackingMove> PackingMoveParameter { 35 35 get { return (ILookupParameter<IPackingMove>)Parameters["PackingMove"]; } … … 44 44 public SequenceTabuMaker() 45 45 : base() { 46 46 Parameters.Add(new LookupParameter<IPackingMove>("PackingMove", "The move to evaluate.")); 47 47 Parameters.Add(new LookupParameter<PackingSequenceEncoding>("PackingSequence", "The solution to evaluate.")); 48 48 } … … 54 54 protected override IItem GetTabuAttribute(bool maximization, double quality, double moveQuality) { 55 55 IPackingMove move = PackingMoveParameter.ActualValue; 56 PackingSequenceEncoding PackingSequence = PackingSequenceParameter.ActualValue; 56 PackingSequenceEncoding PackingSequence = PackingSequenceParameter.ActualValue; 57 57 double baseQuality = moveQuality; 58 if (maximization && quality > moveQuality || !maximization && quality < moveQuality) 58 if (maximization && quality > moveQuality || !maximization && quality < moveQuality) 59 59 baseQuality = quality; // we make an uphill move, the lower bound is the solution quality 60 60 -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/Swap2/Swap2Move.cs
r13032 r14046 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.BinPacking.Interfaces; 28 using HeuristicLab.Problems.BinPacking; 29 29 30 30 31 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/Moves/Swap2/Swap2MoveGenerator.cs
r13032 r14046 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Problems.BinPacking .Interfaces;29 using HeuristicLab.Problems.BinPacking; 30 30 31 31 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceCrossover.cs
r13032 r14046 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Problems.BinPacking .Interfaces;26 using HeuristicLab.Problems.BinPacking; 27 27 28 28 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceEncoding.cs
r14038 r14046 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 using HeuristicLab.Optimization;28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Problems.BinPacking.Interfaces; 28 using HeuristicLab.Problems.BinPacking; 29 30 30 31 31 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceInversionManipulator.cs
r13461 r14046 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.BinPacking.Interfaces; 27 using HeuristicLab.Problems.BinPacking; 28 28 29 29 30 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceManipulator.cs
r13032 r14046 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.BinPacking .Interfaces;27 using HeuristicLab.Problems.BinPacking; 28 28 29 29 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 36 36 public PackingSequenceManipulator() 37 37 : base() { 38 38 EncodedSolutionParameter.ActualName = "PackingSequence"; 39 39 } 40 40 -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceOrderCrossover.cs
r13032 r14046 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.BinPacking .Interfaces;27 using HeuristicLab.Problems.BinPacking; 28 28 29 29 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 42 42 } 43 43 44 public override PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2) 44 public override PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2) { 45 45 PackingSequenceEncoding result = new PackingSequenceEncoding(); 46 46 result.PackingSequence = OrderCrossover.Apply(random, parent1.PackingSequence, parent2.PackingSequence); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequencePartiallyMatchedCrossover.cs
r13032 r14046 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.BinPacking.Interfaces; 27 using HeuristicLab.Problems.BinPacking; 28 28 29 29 30 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 42 43 } 43 44 44 public override PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2) 45 public override PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2) { 45 46 PackingSequenceEncoding result = new PackingSequenceEncoding(); 46 47 result.PackingSequence = PartiallyMatchedCrossover.Apply(random, parent1.PackingSequence, parent2.PackingSequence); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceScrambleManipulator.cs
r13461 r14046 24 24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Problems.BinPacking .Interfaces;26 using HeuristicLab.Problems.BinPacking; 27 27 28 28 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { … … 35 35 public PackingSequenceScrambleManipulator() 36 36 : base() { 37 37 EncodedSolutionParameter.ActualName = "PackingSequence"; 38 38 } 39 39 public override IDeepCloneable Clone(Cloner cloner) { … … 43 43 protected override void Manipulate(IRandom random, PackingSequenceEncoding individual) { 44 44 ScrambleManipulator.Apply(random, individual.PackingSequence); 45 } 45 } 46 46 } 47 47 }
Note: See TracChangeset
for help on using the changeset viewer.