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/JobSequenceMatrix/Manipulators
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMManipulator.cs

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

    r8603 r8887  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    2829
    2930namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
    30 
    3131  [Item("JSMShiftChangeManipulator", "Represents a manipulation operation where the operations of a randomly determined job are shifted in one direction for all resources.")]
    3232  [StorableClass]
    3333  public class JSMShiftChangeManipulator : JSMManipulator {
     34
    3435    [StorableConstructor]
    3536    protected JSMShiftChangeManipulator(bool deserializing) : base(deserializing) { }
    36     protected JSMShiftChangeManipulator(JSMShiftChangeManipulator original, Cloner cloner)
    37       : base(original, cloner) {
    38     }
     37    protected JSMShiftChangeManipulator(JSMShiftChangeManipulator original, Cloner cloner) : base(original, cloner) { }
     38    public JSMShiftChangeManipulator() : base() { }
     39
    3940    public override IDeepCloneable Clone(Cloner cloner) {
    4041      return new JSMShiftChangeManipulator(this, cloner);
    4142    }
    42 
    43     public JSMShiftChangeManipulator() : base() { }
    44 
    4543
    4644    public static void Apply(IRandom random, JSMEncoding individual) {
     
    6563    }
    6664
    67     protected override void Manipulate(IRandom random, JSMEncoding individual) {
    68       Apply(random, individual);
     65    protected override void Manipulate(IRandom random, IScheduleEncoding encoding) {
     66      var solution = encoding as JSMEncoding;
     67      if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding");
     68      Apply(random, solution);
    6969    }
    7070  }
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMSwapManipulator.cs

    r8603 r8887  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627
    2728namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
    28 
    2929  [Item("JSMSwapManipulator", "Represents a manipulation operation swapping parts of the individual.")]
    3030  [StorableClass]
    3131  public class JSMSwapManipulator : JSMManipulator {
     32
    3233    [StorableConstructor]
    3334    protected JSMSwapManipulator(bool deserializing) : base(deserializing) { }
    34     protected JSMSwapManipulator(JSMSwapManipulator original, Cloner cloner)
    35       : base(original, cloner) {
    36     }
     35    protected JSMSwapManipulator(JSMSwapManipulator original, Cloner cloner) : base(original, cloner) { }
     36    public JSMSwapManipulator() : base() { }
     37
    3738    public override IDeepCloneable Clone(Cloner cloner) {
    3839      return new JSMSwapManipulator(this, cloner);
    3940    }
    40 
    41     public JSMSwapManipulator() : base() { }
    42 
    4341
    4442    public static void Apply(IRandom random, JSMEncoding individual) {
     
    5250    }
    5351
    54     protected override void Manipulate(IRandom random, JSMEncoding individual) {
    55       Apply(random, individual);
     52    protected override void Manipulate(IRandom random, IScheduleEncoding individual) {
     53      var solution = individual as JSMEncoding;
     54      if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding");
     55      Apply(random, solution);
    5656    }
    5757  }
Note: See TracChangeset for help on using the changeset viewer.