Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/02/13 04:26:26 (11 years ago)
Author:
jhelm
Message:

#1966: Implemented additional Operator-Wrappers for PackingSequence and GroupingVector; Implemented additional problem-class for Rosenbauer-Problemstatement; Added marker-interfaces for decoder-types;

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings
Files:
75 added
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorCrossover.cs

    r9348 r9563  
    3030  [Item("Grouping Vector Crossover", "An operator which crosses two GroupingVector representations.")]
    3131  [StorableClass]
    32   public class GroupingVectorCrossover : PackingSolutionCrossover, IGroupingVectorOperator {
     32  public abstract class GroupingVectorCrossover : PackingSolutionCrossover, IGroupingVectorOperator {
    3333
    3434    [StorableConstructor]
     
    4040        ChildParameter.ActualName = "GroupingVector";
    4141    }
    42     public override IDeepCloneable Clone(Cloner cloner) {
    43       return new GroupingVectorCrossover(this, cloner);
    44     }
    4542
    46     public GroupingVectorEncoding Cross(IRandom random, GroupingVectorEncoding parent1, GroupingVectorEncoding parent2) {
    47       GroupingVectorEncoding result = new GroupingVectorEncoding();
    48       result.GroupingVector = SinglePointCrossover.Apply(random, parent1.GroupingVector, parent2.GroupingVector);
    49       return result;
    50     }
     43    public abstract GroupingVectorEncoding Cross(IRandom random, GroupingVectorEncoding parent1, GroupingVectorEncoding parent2);
    5144
    5245    public override IOperation Apply() {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/GroupingVector/GroupingVectorRandomCreator.cs

    r9440 r9563  
    6868    }
    6969
    70     protected override IPackingSolutionEncoding CreateSolution() {
     70    protected override IItem CreateSolution() {
    7171      return Apply(PackingItemsParameter.ActualValue.Value, LowerBoundParameter.ActualValue.Value, RandomParameter.ActualValue);
    7272    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorEncoding.cs

    r9495 r9563  
    4646        return nrOfItems;
    4747      }
    48     }
     48    } 
    4949
    5050    [StorableConstructor]
     
    6464      : base() {
    6565        PackingInformations = new ObservableDictionary<int, ItemList<PackingInformation>>();
    66     }
     66    }       
    6767
    6868    public override string ToString() {
     
    9595      return PackingInformations.GetHashCode();
    9696    }
     97
    9798  }
    9899
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/MultiComponentVector/MultiComponentVectorRandomCreator.cs

    r9495 r9563  
    7676    }
    7777
    78     protected override IPackingSolutionEncoding CreateSolution() {
     78    protected override IItem CreateSolution() {
    7979      return Apply(PackingItemsParameter.ActualValue.Value, LowerBoundParameter.ActualValue.Value, RandomParameter.ActualValue, SortedSequenceParameter.Value.Value);
    8080    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/PackingPlan.cs

    r9495 r9563  
    3535
    3636namespace HeuristicLab.Encodings.PackingEncoding.PackingPlan {
    37   //RegularPackingPlan defines that the packingItems have to be parallel to the packingBin in every moment
    38   //SimpleRotation defines that the items may be rotated
    39   //  only in one dimension,
    40   //  only once and
    41   //  only by 90degree
    42   //    so that parallelism to the correlating bin is ensured
    43   //This definition implies that the floor of the (3D) objects never changes (what may be a wanted constraint in most cases..)
    4437  [Item("PackingPlan", "Represents a concrete solution for a bin-packing problem.")]
    4538  [StorableClass]
     
    8578    public PackingPlan(B binMeasures, ItemList<I> itemMeasures)
    8679      : base() {
    87       this.PackingItemMeasures = itemMeasures;
     80      this.PackingItemMeasures = new ItemList<I> (itemMeasures);
    8881      this.PackingBinMeasures = new ObservableDictionary<int, B>();
    8982      this.PackingBinMeasures[0] = binMeasures;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceCrossover.cs

    r9348 r9563  
    2929  [Item("PackingSequenceCrossover", "An operator which crosses two PackingSequence representations.")]
    3030  [StorableClass]
    31   public class PackingSequenceCrossover : PackingSolutionCrossover, IPackingSequenceOperator {
     31  public abstract class PackingSequenceCrossover : PackingSolutionCrossover, IPackingSequenceOperator {
    3232
    3333    [StorableConstructor]
     
    3939        ChildParameter.ActualName = "PackingSequence";
    4040    }
    41     public override IDeepCloneable Clone(Cloner cloner) {
    42       return new PackingSequenceCrossover(this, cloner);
    43     }
    4441
    45     public PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2) {
    46       PackingSequenceEncoding result = new PackingSequenceEncoding();
    47       result.PackingSequence = CosaCrossover.Apply(random, parent1.PackingSequence, parent2.PackingSequence);
    48       return result;
    49     }
     42    public abstract PackingSequenceEncoding Cross(IRandom random, PackingSequenceEncoding parent1, PackingSequenceEncoding parent2);
    5043
    5144    public override IOperation Apply() {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceEncoding.cs

    r9348 r9563  
    3030  [Item("Packing Sequence Encoding", "Represents an encoding for a bin packing problem using permutation of item-indexes to define the packing sequence.")]
    3131  [StorableClass]
    32   public class PackingSequenceEncoding : Item, IPackingSolutionEncoding{
     32  public class PackingSequenceEncoding : Item, IPackingSolutionEncoding {
    3333
    3434    [Storable]
     
    3939    protected PackingSequenceEncoding(PackingSequenceEncoding original, Cloner cloner)
    4040      : base(original, cloner) {
    41         this.PackingSequence = cloner.Clone(original.PackingSequence);
     41      this.PackingSequence = cloner.Clone(original.PackingSequence);
    4242    }
    4343    public override IDeepCloneable Clone(Cloner cloner) {
     
    5353      StringBuilder sb = new StringBuilder();
    5454      sb.Append("[ ");
    55       sb.Append(PackingSequence.ToString() + " \n");         
     55      sb.Append(PackingSequence.ToString() + " \n");
    5656      sb.Append("]");
    5757      return sb.ToString();
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceManipulator.cs

    r9348 r9563  
    3030  [Item("PackingSequenceManipulator", "An operator which manipulates a PackingSequence representation.")]
    3131  [StorableClass]
    32   public class PackingSequenceManipulator : PackingSolutionManipulator, IPackingSequenceOperator {
     32  public abstract class PackingSequenceManipulator : PackingSolutionManipulator, IPackingSequenceOperator {
    3333    [StorableConstructor]
    3434    protected PackingSequenceManipulator(bool deserializing) : base(deserializing) { }
     
    3838        EncodedSolutionParameter.ActualName = "PackingSequence";
    3939    }
    40     public override IDeepCloneable Clone(Cloner cloner) {
    41       return new PackingSequenceManipulator(this, cloner);
    42     }
    4340
    44     protected void Manipulate(IRandom random, PackingSequenceEncoding individual) {
    45       Swap2Manipulator.Apply(random, individual.PackingSequence);
    46     }
     41    protected abstract void Manipulate(IRandom random, PackingSequenceEncoding individual);
    4742
    4843    public override IOperation Apply() {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSequence/PackingSequenceRandomCreator.cs

    r9348 r9563  
    6060    public static PackingSequenceEncoding Apply(int items, IRandom random) {
    6161      var solution = new PackingSequenceEncoding();
    62       solution.PackingSequence = new Permutation(PermutationTypes.Absolute, items, random);
    63       return solution;
    64     }
     62      solution.PackingSequence = new Permutation(PermutationTypes.Absolute, items, random);
     63      return solution;
     64    }
    6565
    66     protected override IPackingSolutionEncoding CreateSolution() {
     66    protected override IItem CreateSolution() {
    6767      return Apply(PackingItemsParameter.ActualValue.Value, RandomParameter.ActualValue);
    6868    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSolutionCreator.cs

    r9348 r9563  
    3232  public abstract class PackingSolutionCreator : SingleSuccessorOperator, IPackingSolutionCreator {
    3333
    34     public ILookupParameter<IPackingSolutionEncoding> EncodedSolutionParameter {
    35       get { return (ILookupParameter<IPackingSolutionEncoding>)Parameters["EncodedPackingSolution"]; }
     34    public ILookupParameter<IItem> EncodedSolutionParameter {
     35      get { return (ILookupParameter<IItem>)Parameters["EncodedPackingSolution"]; }
    3636    }
    3737
     
    4141    public PackingSolutionCreator()
    4242      : base() {
    43         Parameters.Add(new LookupParameter<IPackingSolutionEncoding>("EncodedPackingSolution", "The new bin packing solution candidate."));
     43        Parameters.Add(new LookupParameter<IItem>("EncodedPackingSolution", "The new bin packing solution candidate."));
    4444    }
    4545
     
    4949    }
    5050
    51     protected abstract IPackingSolutionEncoding CreateSolution();
     51    protected abstract IItem CreateSolution();
    5252  }
    5353}
Note: See TracChangeset for help on using the changeset viewer.