Changeset 13613
- Timestamp:
- 02/08/16 21:54:26 (9 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorEncoding.cs
r13032 r13613 33 33 [Item("Grouping Vector Encoding", "Represents an encoding for a bin packing problem using an array of group-assignments for every packing-item.")] 34 34 [StorableClass] 35 public class GroupingVectorEncoding : Item, IPackingSolutionEncoding {35 public class GroupingVectorEncoding : Item, IPackingSolutionEncoding { 36 36 37 37 [Storable] -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceEncoding.cs
r13032 r13613 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 using HeuristicLab.Problems.BinPacking.Interfaces; … … 31 32 [Item("Packing Sequence Encoding", "Represents an encoding for a bin packing problem using permutation of item-indexes to define the packing sequence.")] 32 33 [StorableClass] 33 public class PackingSequenceEncoding : Item, IPackingSolutionEncoding{34 public class PackingSequenceEncoding : Encoding<PackingSequenceRandomCreator> { 34 35 35 36 [Storable] -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceRandomCreator.cs
r13032 r13613 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Encodings.PermutationEncoding; 27 using HeuristicLab.Operators; 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; … … 30 31 31 32 namespace HeuristicLab.Encodings.PackingEncoding.PackingSequence { 32 33 34 public class PackingSequenceRandomCreator : PackingSolutionCreator, IStochasticOperator {33 [Item("PackingSequenceCreator", "Creator class used to create PackingSequence solutions for bin packing problems.")] 34 [StorableClass] 35 public class PackingSequenceRandomCreator : SingleSuccessorOperator, IPackingSequenceCreator, IStochasticOperator { 35 36 36 37 38 39 40 41 37 public ILookupParameter<IRandom> RandomParameter { 38 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 39 } 40 public IValueLookupParameter<IntValue> PackingItemsParameter { 41 get { return (IValueLookupParameter<IntValue>)Parameters["PackingItems"]; } 42 } 42 43 43 [StorableConstructor] 44 protected PackingSequenceRandomCreator(bool deserializing) : base(deserializing) { } 45 protected PackingSequenceRandomCreator(PackingSequenceRandomCreator original, Cloner cloner) : base(original, cloner) { 46 } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new PackingSequenceRandomCreator(this, cloner); 49 } 44 public ILookupParameter<Problems.BinPacking.Encodings.PackingSequence.PackingSequence> SolutionParameter { 45 get { return (ILookupParameter<Problems.BinPacking.Encodings.PackingSequence.PackingSequence>)Parameters["PackingItems"]; } 46 } 47 48 [StorableConstructor] 49 protected PackingSequenceRandomCreator(bool deserializing) : base(deserializing) { } 50 protected PackingSequenceRandomCreator(PackingSequenceRandomCreator original, Cloner cloner) 51 : base(original, cloner) { 52 } 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new PackingSequenceRandomCreator(this, cloner); 55 } 50 56 51 57 public PackingSequenceRandomCreator() 52 : base() { 53 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 54 Parameters.Add(new ValueLookupParameter<IntValue>("PackingItems", "The number of packing-items handled in this problem instance.")); 58 : base() { 59 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 60 Parameters.Add(new ValueLookupParameter<IntValue>("PackingItems", "The number of packing-items handled in this problem instance.")); 61 Parameters.Add(new LookupParameter<Problems.BinPacking.Encodings.PackingSequence.PackingSequence>("PackingSequence")); 55 62 56 EncodedSolutionParameter.ActualName = "PackingSequence";57 63 SolutionParameter.ActualName = "PackingSequence"; 64 } 58 65 66 public override IOperation Apply() { 67 Apply(PackingItemsParameter.ActualValue.Value, RandomParameter.ActualValue); 68 return base.Apply(); 69 } 59 70 60 71 public static PackingSequenceEncoding Apply(int items, IRandom random) { … … 64 75 } 65 76 66 protected override IItem CreateSolution() { 67 return Apply(PackingItemsParameter.ActualValue.Value, RandomParameter.ActualValue); 68 } 69 } 77 } 70 78 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
r13611 r13613 217 217 <Compile Include="Encodings\PackingPlans\BinPacking.cs" /> 218 218 <Compile Include="Encodings\PackingPlans\PackingPlan.cs" /> 219 <Compile Include="Encodings\PackingSequence\IPackingSequenceCreator.cs" /> 219 220 <Compile Include="Encodings\PackingSequence\Moves\Insertion\ExhaustiveInsertionMoveGenerator.cs" /> 220 221 <Compile Include="Encodings\PackingSequence\Moves\Insertion\StochasticInsertionMoveGenerator.cs" /> … … 222 223 <Compile Include="Encodings\PackingSequence\Moves\Insertion\InsertionMoveAttribute.cs" /> 223 224 <Compile Include="Encodings\PackingSequence\Moves\Insertion\InsertionMoveGenerator.cs" /> 225 <Compile Include="Encodings\PackingSequence\PackingSequence.cs" /> 224 226 <Compile Include="Encodings\PackingSequence\PackingSequenceInversionManipulator.cs" /> 225 227 <Compile Include="Encodings\PackingSequence\PackingSequencePartiallyMatchedCrossover.cs" /> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingSolutionDecoder.cs
r13608 r13613 66 66 Parameters.Add(new LookupParameter<ItemList<I>>("PackingItemMeasures", "Packing-item data taken from the bin-packing problem-instance.")); 67 67 Parameters.Add(new LookupParameter<B>("PackingBinMeasures", "Packing-bin data taken from the bin-packing problem-instance.")); 68 Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stacking constraints should be enforced or not.", new BoolValue(true)));68 Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stacking constraints should be enforced or not.", new BoolValue(true))); 69 69 } 70 70
Note: See TracChangeset
for help on using the changeset viewer.