Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/02/13 04:26:26 (12 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/PackingSequence
Files:
23 added
4 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.