Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/12 22:57:09 (12 years ago)
Author:
abeham
Message:

#1329:

  • Moved decoders and evaluators from encoding to problem
  • Removed unnecessary state variables in operators
  • Introduced parameters in interfaces and added wiring code
  • Removed ConcreteScheduleManipulator as it does not perform any manipulation
  • Made ErrorPolicy and ForcingStrategy configurable and added views for them
  • Renamed the SchedulingEvaluationAlgorithm and also converted the AlgorithmOperator to a SingleSuccessorOperator
  • Fixed Plugin- and AssemblyFileVersion
  • Added missing license headers
Location:
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVCrossover.cs

    r8603 r8887  
    2727  [Item("PRVCrossover", "An operator which crosses two PRV representations.")]
    2828  [StorableClass]
    29   public abstract class PRVCrossover : ScheduleCrossover<PRVEncoding>, IPRVOperator {
     29  public abstract class PRVCrossover : ScheduleCrossover, IPRVOperator {
     30
    3031    [StorableConstructor]
    3132    protected PRVCrossover(bool deserializing) : base(deserializing) { }
     
    3738    }
    3839
    39 
    4040    public abstract PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2);
    4141
    4242    public override IOperation Apply() {
    43       ItemArray<PRVEncoding> parents = ParentsParameter.ActualValue;
     43      var parents = ParentsParameter.ActualValue;
    4444      ChildParameter.ActualValue =
    4545        Cross(RandomParameter.ActualValue, parents[0] as PRVEncoding, parents[1] as PRVEncoding);
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVDiscreteCrossover.cs

    r8603 r8887  
    2929  [StorableClass]
    3030  public class PRVDiscreteCrossover : PRVCrossover {
     31
    3132    [StorableConstructor]
    3233    protected PRVDiscreteCrossover(bool deserializing) : base(deserializing) { }
    33     protected PRVDiscreteCrossover(PRVDiscreteCrossover original, Cloner cloner)
    34       : base(original, cloner) {
    35     }
     34    protected PRVDiscreteCrossover(PRVDiscreteCrossover original, Cloner cloner) : base(original, cloner) { }
     35    public PRVDiscreteCrossover() : base() { }
     36
    3637    public override IDeepCloneable Clone(Cloner cloner) {
    3738      return new PRVDiscreteCrossover(this, cloner);
    3839    }
    39     public PRVDiscreteCrossover() : base() { }
    40 
    4140
    4241    public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
    4342      return new PRVEncoding(DiscreteCrossover.Apply(random, new ItemArray<IntegerVector>(new IntegerVector[] { parent1.PriorityRulesVector, parent2.PriorityRulesVector })), parent1.NrOfRules);
    4443    }
     44
    4545    public override PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
    4646      return Apply(random, parent1, parent2);
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVSinglePointCrossover.cs

    r8603 r8887  
    2929  [StorableClass]
    3030  public class PRVSinglePointCrossover : PRVCrossover {
     31
    3132    [StorableConstructor]
    3233    protected PRVSinglePointCrossover(bool deserializing) : base(deserializing) { }
    33     protected PRVSinglePointCrossover(PRVSinglePointCrossover original, Cloner cloner)
    34       : base(original, cloner) {
    35     }
     34    protected PRVSinglePointCrossover(PRVSinglePointCrossover original, Cloner cloner) : base(original, cloner) { }
     35    public PRVSinglePointCrossover() : base() { }
     36
    3637    public override IDeepCloneable Clone(Cloner cloner) {
    3738      return new PRVSinglePointCrossover(this, cloner);
    3839    }
    39     public PRVSinglePointCrossover() : base() { }
    4040
    4141    public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVManipulator.cs

    r8603 r8887  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2728  [Item("PRVManipulator", "An operator which manipulates a PRV representation.")]
    2829  [StorableClass]
    29   public abstract class PRVManipulator : ScheduleManipulator<PRVEncoding>, IPRVOperator {
     30  public abstract class PRVManipulator : ScheduleManipulator, IPRVOperator {
    3031    [StorableConstructor]
    3132    protected PRVManipulator(bool deserializing) : base(deserializing) { }
     
    3637    }
    3738
     39    protected abstract void Manipulate(IRandom random, PRVEncoding individual);
    3840
    39     protected abstract void Manipulate(IRandom random, PRVEncoding individual);
    4041    public override IOperation Apply() {
    41       PRVEncoding solution = ScheduleEncodingParameter.ActualValue;
     42      var solution = ScheduleEncodingParameter.ActualValue as PRVEncoding;
     43      if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PRVEncoding.");
    4244      Manipulate(RandomParameter.ActualValue, solution);
    4345      return base.Apply();
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVUniformOnePositionManipulator.cs

    r8882 r8887  
    2727
    2828namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
    29 
    3029  [Item("PRVUniformOnePositionManipulator", "Represents a manipulation operation inserting parts of the individual at another position.")]
    3130  [StorableClass]
    3231  public class PRVUniformOnePositionManipulator : PRVManipulator {
     32
    3333    [StorableConstructor]
    3434    protected PRVUniformOnePositionManipulator(bool deserializing) : base(deserializing) { }
    35     protected PRVUniformOnePositionManipulator(PRVUniformOnePositionManipulator original, Cloner cloner)
    36       : base(original, cloner) {
    37     }
     35    protected PRVUniformOnePositionManipulator(PRVUniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { }
     36    public PRVUniformOnePositionManipulator() : base() { }
     37
    3838    public override IDeepCloneable Clone(Cloner cloner) {
    3939      return new PRVUniformOnePositionManipulator(this, cloner);
    4040    }
    41     public PRVUniformOnePositionManipulator() : base() { }
    42 
    4341
    4442    public static void Apply(IRandom random, PRVEncoding individual) {
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVEncoding.cs

    r8603 r8887  
    4242    }
    4343
    44 
    4544    [StorableConstructor]
    4645    protected PRVEncoding(bool deserializing) : base(deserializing) { }
     
    4948      this.nrOfRules = cloner.Clone(original.NrOfRules);
    5049      this.PriorityRulesVector = cloner.Clone(original.PriorityRulesVector);
    51     }
    52     public override IDeepCloneable Clone(Cloner cloner) {
    53       return new PRVEncoding(this, cloner);
    5450    }
    5551    public PRVEncoding(int nrOfRules)
     
    6965    }
    7066
     67    public override IDeepCloneable Clone(Cloner cloner) {
     68      return new PRVEncoding(this, cloner);
     69    }
    7170
    7271    public override string ToString() {
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs

    r8603 r8887  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 
    3029namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
    3130  [Item("PriorityRulesRandomCreator", "Creator class used to create PRV encoding objects for scheduling problems.")]
    3231  [StorableClass]
    33   public class PRVRandomCreator : ScheduleCreator<PRVEncoding>, IStochasticOperator {
     32  public class PRVRandomCreator : ScheduleCreator, IStochasticOperator {
     33
    3434    [Storable]
    3535    public IntValue NrOfRules { get; set; }
     
    4545    }
    4646
    47 
    4847    [StorableConstructor]
    4948    protected PRVRandomCreator(bool deserializing) : base(deserializing) { }
     
    5150      : base(original, cloner) {
    5251      this.NrOfRules = cloner.Clone(original.NrOfRules);
    53     }
    54     public override IDeepCloneable Clone(Cloner cloner) {
    55       return new PRVRandomCreator(this, cloner);
    5652    }
    5753    public PRVRandomCreator()
     
    6460    }
    6561
     62    public override IDeepCloneable Clone(Cloner cloner) {
     63      return new PRVRandomCreator(this, cloner);
     64    }
     65
    6666    public static PRVEncoding Apply(int jobs, int resources, IRandom random, IntValue nrOfRules) {
    6767      return new PRVEncoding(jobs * resources, random, 0, nrOfRules.Value, nrOfRules);
    6868    }
    6969
    70     protected override PRVEncoding CreateSolution() {
     70    protected override IScheduleEncoding CreateSolution() {
    7171      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules);
    7272    }
Note: See TracChangeset for help on using the changeset viewer.