Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/20 16:23:01 (5 years ago)
Author:
abeham
Message:

#2521: worked on scheduling problem

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3
Files:
4 added
4 deleted
41 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/HeuristicLab.Encodings.ScheduleEncoding-3.3.csproj

    r16723 r17461  
    128128    <Compile Include="Interfaces\IScheduleCreator.cs" />
    129129    <Compile Include="Interfaces\IScheduleCrossover.cs" />
    130     <Compile Include="Interfaces\ISchedule.cs" />
     130    <Compile Include="Interfaces\IScheduleSolution.cs" />
    131131    <Compile Include="Interfaces\IScheduleDecoder.cs" />
    132132    <Compile Include="Interfaces\IScheduleEncoding.cs" />
     
    138138    <Compile Include="JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" />
    139139    <Compile Include="JobSequenceMatrix\JobSequenceMatrixEncoding.cs" />
    140     <Compile Include="JobSequenceMatrix\JSMEncoding.cs" />
     140    <Compile Include="JobSequenceMatrix\JSM.cs" />
    141141    <Compile Include="JobSequenceMatrix\JSMRandomCreator.cs" />
    142142    <Compile Include="JobSequenceMatrix\Manipulators\JSMManipulator.cs" />
     
    149149    <Compile Include="PermutationWithRepetition\Manipulators\PWRInsertionManipulator.cs" />
    150150    <Compile Include="PermutationWithRepetition\PermutationWithRepetitionEncoding.cs" />
    151     <Compile Include="PermutationWithRepetition\PWREncoding.cs" />
     151    <Compile Include="PermutationWithRepetition\PWR.cs" />
    152152    <Compile Include="PermutationWithRepetition\PWRRandomCreator.cs" />
    153153    <Compile Include="Plugin.cs" />
     
    158158    <Compile Include="PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" />
    159159    <Compile Include="PriorityRulesVector\PriorityRulesVectorEncoding.cs" />
    160     <Compile Include="PriorityRulesVector\PRVEncoding.cs" />
     160    <Compile Include="PriorityRulesVector\PRV.cs" />
    161161    <Compile Include="PriorityRulesVector\PRVRandomCreator.cs" />
    162162    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleCreator.cs

    r17226 r17461  
    2828  [StorableType("d6738639-c5fc-46af-8997-7527ea718759")]
    2929  public interface IScheduleCreator<TSchedule> : ISolutionCreator<TSchedule>, IScheduleOperator
    30   where TSchedule : class,ISchedule {
     30  where TSchedule : class, IScheduleSolution {
    3131    ILookupParameter<TSchedule> ScheduleParameter { get; }
    3232    IValueLookupParameter<IntValue> JobsParameter { get; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleCrossover.cs

    r17226 r17461  
    2727  [StorableType("809a6136-3a7a-4389-9119-2bb48f6d650a")]
    2828  public interface IScheduleCrossover : ICrossover, IScheduleOperator {
    29     ILookupParameter<ISchedule> ChildParameter { get; }
    30     IScopeTreeLookupParameter<ISchedule> ParentsParameter { get; }
     29    ILookupParameter<IScheduleSolution> ChildParameter { get; }
     30    IScopeTreeLookupParameter<IScheduleSolution> ParentsParameter { get; }
    3131  }
    3232}
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleDecoder.cs

    r16723 r17461  
    2626  [StorableType("010C752F-0F5E-4B93-8695-8DD74903DBE7")]
    2727  public interface IScheduleDecoder : IScheduleOperator {
    28     ILookupParameter<ISchedule> ScheduleEncodingParameter { get; }
     28    ILookupParameter<IScheduleSolution> ScheduleEncodingParameter { get; }
    2929    ILookupParameter<Schedule> ScheduleParameter { get; }
    3030    ILookupParameter<ItemList<Job>> JobDataParameter { get; }
    3131
    32     Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData);
     32    Schedule DecodeSchedule(IScheduleSolution solution, ItemList<Job> jobData);
    3333  }
    3434
    3535  public interface IScheduleDecoder<TSchedule> : IScheduleDecoder
    36     where TSchedule : class, ISchedule {
     36    where TSchedule : class, IScheduleSolution {
    3737    Schedule DecodeSchedule(TSchedule solution, ItemList<Job> jobData);
    3838  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleEncoding.cs

    r17226 r17461  
    2222#endregion
    2323
     24using HEAL.Attic;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
    2627using HeuristicLab.Optimization;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Encodings.ScheduleEncoding {
    3030  [StorableType("09b9d24c-2576-495a-b06c-338d095cba0d")]
    31   public interface IScheduleEncoding : IEncoding<ISchedule> {
    32     IFixedValueParameter<ItemList<Job>> JobDataParameter { get; set; }
     31  public interface IScheduleEncoding : IEncoding<IScheduleSolution> {
     32    IValueParameter<ItemList<Job>> JobDataParameter { get; set; }
    3333    IFixedValueParameter<IntValue> JobsParameter { get; set; }
    3434    IFixedValueParameter<IntValue> ResourcesParameter { get; set; }
     
    3939
    4040
    41     Schedule Decode(ISchedule schedule, ItemList<Job> jobData);
     41    Schedule Decode(IScheduleSolution schedule, ItemList<Job> jobData);
    4242  }
    4343
    4444  public interface IScheduleEncoding<TSchedule> : IEncoding<TSchedule>
    45     where TSchedule : class, ISchedule {
     45    where TSchedule : class, IScheduleSolution {
    4646
    4747  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleManipulator.cs

    r17226 r17461  
    2727  [StorableType("aa89fd6f-db49-457d-abc9-5600aa8f24e5")]
    2828  public interface IScheduleManipulator : IManipulator, IScheduleOperator {
    29     ILookupParameter<ISchedule> ScheduleParameter { get; }
     29    ILookupParameter<IScheduleSolution> ScheduleParameter { get; }
    3030  }
    3131}
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMCrossover.cs

    r17226 r17461  
    3535    public JSMCrossover() : base() { }
    3636
    37     public abstract JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2);
     37    public abstract JSM Cross(IRandom random, JSM parent1, JSM parent2);
    3838
    3939    public override IOperation InstrumentedApply() {
     
    4141
    4242      ChildParameter.ActualValue =
    43         Cross(RandomParameter.ActualValue, parents[0] as JSMEncoding, parents[1] as JSMEncoding);
     43        Cross(RandomParameter.ActualValue, parents[0] as JSM, parents[1] as JSM);
    4444
    4545      return base.InstrumentedApply();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMJOXCrossover.cs

    r17226 r17461  
    4040    }
    4141
    42     public static JSMEncoding Apply(IRandom random, JSMEncoding p1, JSMEncoding p2) {
    43       var result = new JSMEncoding(random.Next());
     42    public static JSM Apply(IRandom random, JSM p1, JSM p2) {
     43      var result = new JSM(random.Next());
    4444
    4545      int nrOfResources = p1.JobSequenceMatrix.Count;
     
    5353
    5454      bool dominantParent = random.Next(2) == 1;
    55       JSMEncoding parent1 = dominantParent ? p1 : p2;
    56       JSMEncoding parent2 = dominantParent ? p2 : p1;
     55      JSM parent1 = dominantParent ? p1 : p2;
     56      JSM parent2 = dominantParent ? p2 : p1;
    5757
    5858      //Fill childmatrix with values
     
    7575    }
    7676
    77     public override JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2) {
     77    public override JSM Cross(IRandom random, JSM parent1, JSM parent2) {
    7878      return Apply(random, parent1, parent2);
    7979    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMOXCrossover.cs

    r17226 r17461  
    3838    }
    3939
    40     public static JSMEncoding Apply(IRandom random, JSMEncoding parent1, JSMEncoding parent2) {
    41       var result = new JSMEncoding(random.Next());
     40    public static JSM Apply(IRandom random, JSM parent1, JSM parent2) {
     41      var result = new JSM(random.Next());
    4242
    4343      for (int i = 0; i < parent1.JobSequenceMatrix.Count; i++) {
     
    5050    }
    5151
    52     public override JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2) {
     52    public override JSM Cross(IRandom random, JSM parent1, JSM parent2) {
    5353      return Apply(random, parent1, parent2);
    5454    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMSXXCrossover.cs

    r17226 r17461  
    3939    }
    4040
    41     public static JSMEncoding Apply(IRandom random, JSMEncoding parent1, JSMEncoding parent2) {
    42       var result = new JSMEncoding(random.Next());
     41    public static JSM Apply(IRandom random, JSM parent1, JSM parent2) {
     42      var result = new JSM(random.Next());
    4343      int subSequenceLength = random.Next(parent1.JobSequenceMatrix[0].Length);
    4444      for (int i = 0; i < parent1.JobSequenceMatrix.Count; i++) {
     
    9191    }
    9292
    93     public override JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2) {
     93    public override JSM Cross(IRandom random, JSM parent1, JSM parent2) {
    9494      return Apply(random, parent1, parent2);
    9595    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMDecoder.cs

    r16725 r17461  
    3434  [Item("JobSequenceMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequence Matrix.")]
    3535  [StorableType("BBE354C2-7599-43CC-ACDC-F8F0F65BE3F5")]
    36   public class JSMDecoder : ScheduleDecoder<JSMEncoding> {
     36  public class JSMDecoder : ScheduleDecoder<JSM>, IJSMOperator {
    3737
    3838    public IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>> DecodingErrorPolicyParameter {
     
    6464    }
    6565
    66     private static Task SelectTaskFromConflictSet(JSMEncoding solution, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy, int conflictedResourceNr, int progressOnConflictedResource, ItemList<Task> conflictSet, IRandom random) {
     66    private static Task SelectTaskFromConflictSet(JSM solution, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy, int conflictedResourceNr, int progressOnConflictedResource, ItemList<Task> conflictSet, IRandom random) {
    6767      if (conflictSet.Count == 1)
    6868        return conflictSet[0];
     
    108108    }
    109109
    110     private static void ApplyForcingStrategy(JSMForcingStrategy forcingStrategy, JSMEncoding solution, int conflictedResource, int newResolutionIndex, int progressOnResource, int newResolution) {
     110    private static void ApplyForcingStrategy(JSMForcingStrategy forcingStrategy, JSM solution, int conflictedResource, int newResolutionIndex, int progressOnResource, int newResolution) {
    111111      var jsm = solution.JobSequenceMatrix;
    112112      if (forcingStrategy == JSMForcingStrategy.SwapForcing) {
     
    130130    }
    131131
    132     public override Schedule DecodeSchedule(JSMEncoding encoding, ItemList<Job> jobData) {
     132    public override Schedule DecodeSchedule(JSM encoding, ItemList<Job> jobData) {
    133133      return Decode(encoding, jobData, DecodingErrorPolicy, ForcingStrategy);
    134134    }
    135135
    136     public static Schedule Decode(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
     136    public static Schedule Decode(JSM solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
    137137      var random = new FastRandom(solution.RandomSeed);
    138138      var jobs = (ItemList<Job>)jobData.Clone();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs

    r17226 r17461  
    3030  [Item("JobSequenceMatrixCreator", "Creator class used to create Job Sequence Matrix solutions for standard JobShop scheduling problems.")]
    3131  [StorableType("F8053C69-31C2-4E05-8FA0-5AED15FAF804")]
    32   public class JSMRandomCreator : ScheduleCreator<JSMEncoding>, IStochasticOperator {
     32  public class JSMRandomCreator : ScheduleCreator<JSM>, IStochasticOperator {
    3333
    3434    public ILookupParameter<IRandom> RandomParameter {
     
    4848    }
    4949
    50     public static JSMEncoding Apply(int jobs, int resources, IRandom random) {
    51       var solution = new JSMEncoding(random.Next());
     50    public static JSM Apply(int jobs, int resources, IRandom random) {
     51      var solution = new JSM(random.Next());
    5252      for (int i = 0; i < resources; i++) {
    5353        solution.JobSequenceMatrix.Add(new Permutation(PermutationTypes.Absolute, jobs, random));
     
    5656    }
    5757
    58     protected override JSMEncoding CreateSolution() {
     58    protected override JSM CreateSolution() {
    5959      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    6060    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JobSequenceMatrixEncoding.cs

    r16725 r17461  
    3131
    3232namespace HeuristicLab.Encodings.ScheduleEncoding {
     33  [Item("Job Sequence Matrix Encoding", "Represents an encoding of schedules in form of a job sequence per resource.")]
    3334  [StorableType("9C090369-0214-42E6-8C3E-369751F5A9E1")]
    34   public sealed class JobSequenceMatrixEncoding : ScheduleEncoding<JSMEncoding> {
     35  public sealed class JobSequenceMatrixEncoding : ScheduleEncoding<JSM> {
    3536    [StorableConstructor]
    3637    private JobSequenceMatrixEncoding(StorableConstructorFlag _) : base(_) { }
     
    4142
    4243    public JobSequenceMatrixEncoding()
    43       : base() {
     44      : base("JSM") {
    4445      SolutionCreator = new JSMRandomCreator();
    4546      Decoder = new JSMDecoder();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMManipulator.cs

    r17226 r17461  
    3434    public JSMManipulator() : base() { }
    3535
    36     protected abstract void Manipulate(IRandom random, ISchedule individual);
     36    protected abstract void Manipulate(IRandom random, IScheduleSolution individual);
    3737
    3838    public override IOperation InstrumentedApply() {
    39       var solution = ScheduleParameter.ActualValue as JSMEncoding;
     39      var solution = ScheduleParameter.ActualValue as JSM;
    4040      if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type JSMEncoding.");
    4141      Manipulate(RandomParameter.ActualValue, solution);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMShiftChangeManipulator.cs

    r17226 r17461  
    4242    }
    4343
    44     public static void Apply(IRandom random, JSMEncoding individual) {
     44    public static void Apply(IRandom random, JSM individual) {
    4545      int nrOfJobs = individual.JobSequenceMatrix[0].Length;
    4646      int jobIndex = random.Next(nrOfJobs);
     
    6363    }
    6464
    65     protected override void Manipulate(IRandom random, ISchedule encoding) {
    66       var solution = encoding as JSMEncoding;
     65    protected override void Manipulate(IRandom random, IScheduleSolution encoding) {
     66      var solution = encoding as JSM;
    6767      if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding");
    6868      Apply(random, solution);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMSwapManipulator.cs

    r17226 r17461  
    4040    }
    4141
    42     public static void Apply(IRandom random, JSMEncoding individual) {
     42    public static void Apply(IRandom random, JSM individual) {
    4343      int resourceIndex = random.Next(individual.JobSequenceMatrix.Count);
    4444      Permutation p = individual.JobSequenceMatrix[resourceIndex];
     
    5050    }
    5151
    52     protected override void Manipulate(IRandom random, ISchedule individual) {
    53       var solution = individual as JSMEncoding;
     52    protected override void Manipulate(IRandom random, IScheduleSolution individual) {
     53      var solution = individual as JSM;
    5454      if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding");
    5555      Apply(random, solution);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRCrossover.cs

    r17226 r17461  
    3838    }
    3939
    40     public abstract PWREncoding Cross(IRandom random, PWREncoding parent1, PWREncoding parent2);
     40    public abstract PWR Cross(IRandom random, PWR parent1, PWR parent2);
    4141
    4242    public override IOperation InstrumentedApply() {
     
    4444
    4545      ChildParameter.ActualValue =
    46         Cross(RandomParameter.ActualValue, parents[0] as PWREncoding, parents[1] as PWREncoding);
     46        Cross(RandomParameter.ActualValue, parents[0] as PWR, parents[1] as PWR);
    4747
    4848      return base.InstrumentedApply();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRGOXCrossover.cs

    r17226 r17461  
    5555    }
    5656
    57     public static PWREncoding Apply(IRandom random, PWREncoding parent1, PWREncoding parent2) {
    58       var result = new PWREncoding();
     57    public static PWR Apply(IRandom random, PWR parent1, PWR parent2) {
     58      var result = new PWR();
    5959
    6060      var p1 = ((IntegerVector)(parent1.PermutationWithRepetition.Clone())).ToList();
     
    8787    }
    8888
    89     public override PWREncoding Cross(IRandom random, PWREncoding parent1, PWREncoding parent2) {
     89    public override PWR Cross(IRandom random, PWR parent1, PWR parent2) {
    9090      return Apply(random, parent1, parent2);
    9191    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRPPXCrossover.cs

    r17226 r17461  
    4141    }
    4242
    43     public static PWREncoding Apply(IRandom random, PWREncoding parent1, PWREncoding parent2) {
    44       var result = new PWREncoding();
     43    public static PWR Apply(IRandom random, PWR parent1, PWR parent2) {
     44      var result = new PWR();
    4545      var p1 = ((IntegerVector)(parent1.PermutationWithRepetition.Clone())).ToList();
    4646      var p2 = ((IntegerVector)(parent2.PermutationWithRepetition.Clone())).ToList();
     
    6969    }
    7070
    71     public override PWREncoding Cross(IRandom random, PWREncoding parent1, PWREncoding parent2) {
     71    public override PWR Cross(IRandom random, PWR parent1, PWR parent2) {
    7272      return Apply(random, parent1, parent2);
    7373    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Decoder/PWRDecoder.cs

    r16725 r17461  
    2727  [Item("PWRDecoder", "An item used to convert a PWR-individual into a generalized schedule.")]
    2828  [StorableType("60D171BE-9704-40E1-9C63-0E56D95403CD")]
    29   public class PWRDecoder : ScheduleDecoder<PWREncoding> {
     29  public class PWRDecoder : ScheduleDecoder<PWR>, IPWROperator {
    3030    [StorableConstructor]
    3131    protected PWRDecoder(StorableConstructorFlag _) : base(_) { }
     
    3737    }
    3838
    39     public override Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     39    public override Schedule DecodeSchedule(PWR solution, ItemList<Job> jobData) {
    4040      return Decode(solution, jobData);
    4141    }
    4242
    43     public static Schedule Decode(PWREncoding solution, ItemList<Job> jobData) {
     43    public static Schedule Decode(PWR solution, ItemList<Job> jobData) {
    4444      var jobs = (ItemList<Job>)jobData.Clone();
    4545      var resultingSchedule = new Schedule(jobs[0].Tasks.Count);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Manipulators/PWRInsertionManipulator.cs

    r17226 r17461  
    4040    }
    4141
    42     public static void Apply(IRandom random, PWREncoding individual) {
     42    public static void Apply(IRandom random, PWR individual) {
    4343      int cutIndex = random.Next(individual.PermutationWithRepetition.Length);
    4444      int insertIndex = random.Next(individual.PermutationWithRepetition.Length);
     
    5555    }
    5656
    57     protected override void Manipulate(IRandom random, PWREncoding individual) {
     57    protected override void Manipulate(IRandom random, PWR individual) {
    5858      Apply(random, individual);
    5959    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Manipulators/PWRManipulator.cs

    r17226 r17461  
    3535    public PWRManipulator() : base() { }
    3636
    37     protected abstract void Manipulate(IRandom random, PWREncoding individual);
     37    protected abstract void Manipulate(IRandom random, PWR individual);
    3838
    3939    public override IOperation InstrumentedApply() {
    40       var solution = ScheduleParameter.ActualValue as PWREncoding;
     40      var solution = ScheduleParameter.ActualValue as PWR;
    4141      if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PWREncoding.");
    4242      Manipulate(RandomParameter.ActualValue, solution);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs

    r17226 r17461  
    2929  [Item("PermutationWithRepetitionRandomCreator", "Creates PWR-individuals at random.")]
    3030  [StorableType("6E753916-C0FD-4585-B6A6-47FD66ED098F")]
    31   public class PWRRandomCreator : ScheduleCreator<PWREncoding>, IStochasticOperator {
     31  public class PWRRandomCreator : ScheduleCreator<PWR>, IStochasticOperator {
    3232
    3333    public ILookupParameter<IRandom> RandomParameter {
     
    4747    }
    4848
    49     public static PWREncoding Apply(int jobs, int resources, IRandom random) {
    50       return new PWREncoding(jobs, resources, random);
     49    public static PWR Apply(int jobs, int resources, IRandom random) {
     50      return new PWR(jobs, resources, random);
    5151    }
    5252
    53     protected override PWREncoding CreateSolution() {
     53    protected override PWR CreateSolution() {
    5454      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    5555    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PermutationWithRepetitionEncoding.cs

    r16725 r17461  
    3232namespace HeuristicLab.Encodings.ScheduleEncoding {
    3333  [StorableType("468EF506-0749-469B-B9B9-36655AA0178D")]
    34   public sealed class PermutationWithRepetitionEncoding : ScheduleEncoding<PWREncoding> {
     34  public sealed class PermutationWithRepetitionEncoding : ScheduleEncoding<PWR> {
    3535    [StorableConstructor]
    3636    private PermutationWithRepetitionEncoding(StorableConstructorFlag _) : base(_) { }
     
    4141
    4242    public PermutationWithRepetitionEncoding()
    43       : base() {
     43      : base("PWR") {
    4444      SolutionCreator = new PWRRandomCreator();
    4545      Decoder = new PWRDecoder();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVCrossover.cs

    r17226 r17461  
    3434    public PRVCrossover() : base() { }
    3535
    36     public abstract PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2);
     36    public abstract PRV Cross(IRandom random, PRV parent1, PRV parent2);
    3737
    3838    public override IOperation InstrumentedApply() {
    3939      var parents = ParentsParameter.ActualValue;
    4040      ChildParameter.ActualValue =
    41         Cross(RandomParameter.ActualValue, parents[0] as PRVEncoding, parents[1] as PRVEncoding);
     41        Cross(RandomParameter.ActualValue, parents[0] as PRV, parents[1] as PRV);
    4242      return base.InstrumentedApply();
    4343    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVDiscreteCrossover.cs

    r17226 r17461  
    3939    }
    4040
    41     public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
     41    public static PRV Apply(IRandom random, PRV parent1, PRV parent2) {
    4242      var randomSeed = random.Next();
    4343      var integerVector = DiscreteCrossover.Apply(random, new ItemArray<IntegerVector>(new[] { parent1.PriorityRulesVector, parent2.PriorityRulesVector }));
    44       return new PRVEncoding(integerVector, randomSeed);
     44      return new PRV(integerVector, randomSeed);
    4545    }
    4646
    47     public override PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
     47    public override PRV Cross(IRandom random, PRV parent1, PRV parent2) {
    4848      return Apply(random, parent1, parent2);
    4949    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVSinglePointCrossover.cs

    r17226 r17461  
    3939    }
    4040
    41     public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
     41    public static PRV Apply(IRandom random, PRV parent1, PRV parent2) {
    4242      var randomSeed = random.Next();
    4343      var integerVector = SinglePointCrossover.Apply(random, parent1.PriorityRulesVector, parent2.PriorityRulesVector);
    44       return new PRVEncoding(integerVector, randomSeed);
     44      return new PRV(integerVector, randomSeed);
    4545    }
    4646
    47     public override PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
     47    public override PRV Cross(IRandom random, PRV parent1, PRV parent2) {
    4848      return Apply(random, parent1, parent2);
    4949    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Decoder/PRVDecoder.cs

    r16725 r17461  
    2929  [Item("JobSequencingMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequencing Matrix.")]
    3030  [StorableType("2D059957-AC7C-4B33-BADE-96706AEBAF29")]
    31   public class PRVDecoder : ScheduleDecoder<PRVEncoding> {
     31  public class PRVDecoder : ScheduleDecoder<PRV>, IPRVOperator {
    3232    #region Priority Rules
    3333    //smallest number of remaining tasks
     
    187187    }
    188188
    189     public override Schedule DecodeSchedule(PRVEncoding encoding, ItemList<Job> jobData) {
     189    public override Schedule DecodeSchedule(PRV encoding, ItemList<Job> jobData) {
    190190      return Decode(encoding, jobData);
    191191    }
    192192
    193     public static Schedule Decode(PRVEncoding solution, ItemList<Job> jobData) {
     193    public static Schedule Decode(PRV solution, ItemList<Job> jobData) {
    194194      var random = new FastRandom(solution.RandomSeed);
    195195      var jobs = (ItemList<Job>)jobData.Clone();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVManipulator.cs

    r17226 r17461  
    4646    }
    4747
    48     protected abstract void Manipulate(IRandom random, PRVEncoding individual, int numberOfRules);
     48    protected abstract void Manipulate(IRandom random, PRV individual, int numberOfRules);
    4949
    5050    public override IOperation InstrumentedApply() {
    51       var solution = ScheduleParameter.ActualValue as PRVEncoding;
     51      var solution = ScheduleParameter.ActualValue as PRV;
    5252      if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PRVEncoding.");
    5353      Manipulate(RandomParameter.ActualValue, solution, NumberOfRulesParameter.ActualValue.Value);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVUniformOnePositionManipulator.cs

    r17226 r17461  
    4040    }
    4141
    42     public static void Apply(IRandom random, PRVEncoding individual, int numberOfRules) {
     42    public static void Apply(IRandom random, PRV individual, int numberOfRules) {
    4343      UniformOnePositionManipulator.Apply(random, individual.PriorityRulesVector, new IntMatrix(new int[,] { { 0, numberOfRules } }));
    4444    }
    4545
    46     protected override void Manipulate(IRandom random, PRVEncoding individual, int numberOfRules) {
     46    protected override void Manipulate(IRandom random, PRV individual, int numberOfRules) {
    4747      Apply(random, individual, numberOfRules);
    4848    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs

    r17226 r17461  
    2929  [Item("PriorityRulesRandomCreator", "Creator class used to create PRV encoding objects for scheduling problems.")]
    3030  [StorableType("5FF2A11E-86F9-4A8B-8E1C-713D6801506C")]
    31   public class PRVRandomCreator : ScheduleCreator<PRVEncoding>, IStochasticOperator {
     31  public class PRVRandomCreator : ScheduleCreator<PRV>, IStochasticOperator {
    3232
    3333    [Storable]
     
    5454    }
    5555
    56     public static PRVEncoding Apply(int jobs, int resources, IRandom random, int nrOfRules) {
    57       return new PRVEncoding(jobs * resources, random, 0, nrOfRules);
     56    public static PRV Apply(int jobs, int resources, IRandom random, int nrOfRules) {
     57      return new PRV(jobs * resources, random, 0, nrOfRules);
    5858    }
    5959
    60     protected override PRVEncoding CreateSolution() {
     60    protected override PRV CreateSolution() {
    6161      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules);
    6262    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PriorityRulesVectorEncoding.cs

    r16725 r17461  
    3434namespace HeuristicLab.Encodings.ScheduleEncoding {
    3535  [StorableType("9C419EE5-F3A8-4F06-8263-7D37D3AE1C72")]
    36   public sealed class PriorityRulesVectorEncoding : ScheduleEncoding<PRVEncoding> {
     36  public sealed class PriorityRulesVectorEncoding : ScheduleEncoding<PRV> {
    3737
    3838    private IFixedValueParameter<IntValue> numberOfRulesParameter;
     
    6060
    6161    public PriorityRulesVectorEncoding()
    62       : base() {
     62      : base("PRV") {
    6363      //TODO change to meaningful value
    6464      numberOfRulesParameter = new FixedValueParameter<IntValue>(Name + ".NumberOfRules", new IntValue(10));
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCreator.cs

    r17226 r17461  
    3131  [StorableType("3DDA1485-4518-4F1D-A475-795FFE63C98E")]
    3232  public abstract class ScheduleCreator<TSchedule> : InstrumentedOperator, IScheduleCreator<TSchedule>
    33   where TSchedule : class,ISchedule {
     33  where TSchedule : class,IScheduleSolution {
    3434
    3535    public ILookupParameter<TSchedule> ScheduleParameter {
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCrossover.cs

    r17226 r17461  
    3232  public abstract class ScheduleCrossover : InstrumentedOperator, IScheduleCrossover, IStochasticOperator {
    3333
    34     public ILookupParameter<ISchedule> ChildParameter {
    35       get { return (ILookupParameter<ISchedule>)Parameters["Child"]; }
     34    public ILookupParameter<IScheduleSolution> ChildParameter {
     35      get { return (ILookupParameter<IScheduleSolution>)Parameters["Child"]; }
    3636    }
    37     public IScopeTreeLookupParameter<ISchedule> ParentsParameter {
    38       get { return (IScopeTreeLookupParameter<ISchedule>)Parameters["Parents"]; }
     37    public IScopeTreeLookupParameter<IScheduleSolution> ParentsParameter {
     38      get { return (IScopeTreeLookupParameter<IScheduleSolution>)Parameters["Parents"]; }
    3939    }
    4040    public ILookupParameter<IRandom> RandomParameter {
     
    4848      : base() {
    4949      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    50       Parameters.Add(new LookupParameter<ISchedule>("Child", "The child solution resulting from the crossover."));
     50      Parameters.Add(new LookupParameter<IScheduleSolution>("Child", "The child solution resulting from the crossover."));
    5151      ChildParameter.ActualName = "Schedule";
    52       Parameters.Add(new ScopeTreeLookupParameter<ISchedule>("Parents", "The parent solution which should be crossed."));
     52      Parameters.Add(new ScopeTreeLookupParameter<IScheduleSolution>("Parents", "The parent solution which should be crossed."));
    5353      ParentsParameter.ActualName = "Schedule";
    5454    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleDecoder.cs

    r17226 r17461  
    3131  [StorableType("57A68F4B-4B35-4DB4-9B5E-D5154DD46E45")]
    3232  public abstract class ScheduleDecoder<TSchedule> : SingleSuccessorOperator, IScheduleDecoder<TSchedule>
    33   where TSchedule : class, ISchedule {
     33  where TSchedule : class, IScheduleSolution {
    3434
    35     public ILookupParameter<ISchedule> ScheduleEncodingParameter {
    36       get { return (ILookupParameter<ISchedule>)Parameters["EncodedSchedule"]; }
     35    public ILookupParameter<IScheduleSolution> ScheduleEncodingParameter {
     36      get { return (ILookupParameter<IScheduleSolution>)Parameters["EncodedSchedule"]; }
    3737    }
    3838    public ILookupParameter<Schedule> ScheduleParameter {
     
    4848    public ScheduleDecoder()
    4949      : base() {
    50       Parameters.Add(new LookupParameter<ISchedule>("EncodedSchedule", "The new scheduling solution represented as encoding."));
     50      Parameters.Add(new LookupParameter<IScheduleSolution>("EncodedSchedule", "The new scheduling solution represented as encoding."));
    5151      Parameters.Add(new LookupParameter<Schedule>("Schedule", "The decoded scheduling solution represented as generalized schedule."));
    5252      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Job data taken from the JSSP - Instance."));
    5353    }
    5454
    55     public Schedule DecodeSchedule(ISchedule schedule, ItemList<Job> jobData) {
     55    public Schedule DecodeSchedule(IScheduleSolution schedule, ItemList<Job> jobData) {
    5656      TSchedule solution = schedule as TSchedule;
    5757      if (solution == null) throw new InvalidOperationException("Encoding is not of type " + typeof(TSchedule).GetPrettyName());
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding.cs

    r17226 r17461  
    3333  [StorableType("D2FB1AF9-EF13-4ED2-B3E9-D5BE4E5772EA")]
    3434  public abstract class ScheduleEncoding<TSchedule> : Encoding<TSchedule>, IScheduleEncoding
    35   where TSchedule : class, ISchedule {
     35  where TSchedule : class, IScheduleSolution {
    3636    #region Encoding Parameters
    3737    [Storable]
    38     private IFixedValueParameter<ItemList<Job>> jobDataParameter;
    39     public IFixedValueParameter<ItemList<Job>> JobDataParameter {
     38    private IValueParameter<ItemList<Job>> jobDataParameter;
     39    public IValueParameter<ItemList<Job>> JobDataParameter {
    4040      get { return jobDataParameter; }
    4141      set {
     
    126126    }
    127127
    128     protected ScheduleEncoding() : this("Schedule") { }
    129128    protected ScheduleEncoding(string name) : this(name, Enumerable.Empty<Job>()) { }
    130129    protected ScheduleEncoding(string name, IEnumerable<Job> jobData)
     
    133132      int resources = jobData.SelectMany(j => j.Tasks).Select(t => t.ResourceNr).Distinct().Count();
    134133
    135       jobDataParameter = new FixedValueParameter<ItemList<Job>>(Name + ".JobData", new ItemList<Job>(jobData));
     134      jobDataParameter = new ValueParameter<ItemList<Job>>(Name + ".JobData", new ItemList<Job>(jobData));
    136135      jobsParameter = new FixedValueParameter<IntValue>(Name + ".Jobs", new IntValue(jobs));
    137136      resourcesParameter = new FixedValueParameter<IntValue>(Name + ".Resources", new IntValue(resources));
     
    144143    }
    145144
    146     public Schedule Decode(ISchedule schedule, ItemList<Job> jobData) {
     145    public Schedule Decode(IScheduleSolution schedule, ItemList<Job> jobData) {
    147146      return Decoder.DecodeSchedule(schedule, jobData);
    148147    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Decoder/DirectScheduleDecoder.cs

    r16725 r17461  
    2727  [Item("DirectScheduleDecoder", "An item used to convert a direct schedule into a generalized schedule.")]
    2828  [StorableType("151C772B-6E6C-40D9-B171-F5626C676A5F")]
    29   public class DirectScheduleDecoder : ScheduleDecoder<Schedule> {
     29  public class DirectScheduleDecoder : ScheduleDecoder<Schedule>, IDirectScheduleOperator {
    3030    [StorableConstructor]
    3131    protected DirectScheduleDecoder(StorableConstructorFlag _) : base(_) { }
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleEncoding.cs

    r16725 r17461  
    3131
    3232namespace HeuristicLab.Encodings.ScheduleEncoding {
     33  [Item("Direct Schedule Encoding", "Encodes a solution by directly assigning start and end types to the tasks.")]
    3334  [StorableType("BB1BD851-3E77-4357-942C-EAF5BE6760B4")]
    3435  public sealed class DirectScheduleEncoding : ScheduleEncoding<Schedule> {
     
    4142
    4243    public DirectScheduleEncoding()
    43       : base() {
     44      : base("Schedule") {
    4445      SolutionCreator = new DirectScheduleRandomCreator();
    4546      Decoder = new DirectScheduleDecoder();
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs

    r17226 r17461  
    5454
    5555
    56     public static Schedule Apply(PWREncoding pwr, ItemList<Job> jobData) {
     56    public static Schedule Apply(PWR pwr, ItemList<Job> jobData) {
    5757      var resultingSchedule = new Schedule(jobData[0].Tasks.Count);
    5858      foreach (int jobNr in pwr.PermutationWithRepetition) {
     
    7070    protected override Schedule CreateSolution() {
    7171      var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
    72       var pwrEncoding = new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
     72      var pwrEncoding = new PWR(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
    7373        RandomParameter.ActualValue);
    7474      return Apply(pwrEncoding, jobData);
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Schedule.cs

    r17360 r17461  
    3131  [Item("Schedule", "Represents the general solution for scheduling problems.")]
    3232  [StorableType("EA6D14A3-7FA6-4B4B-B7F6-40B42657D398")]
    33   public class Schedule : NamedItem, ISchedule {
     33  public class Schedule : NamedItem, IScheduleSolution {
    3434
    3535    #region Properties
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleManipulator.cs

    r17226 r17461  
    3232  public abstract class ScheduleManipulator : InstrumentedOperator, IScheduleManipulator, IStochasticOperator {
    3333
    34     public ILookupParameter<ISchedule> ScheduleParameter {
    35       get { return (ILookupParameter<ISchedule>)Parameters["Schedule"]; }
     34    public ILookupParameter<IScheduleSolution> ScheduleParameter {
     35      get { return (ILookupParameter<IScheduleSolution>)Parameters["Schedule"]; }
    3636    }
    3737
     
    4545    public ScheduleManipulator()
    4646      : base() {
    47       Parameters.Add(new LookupParameter<ISchedule>("Schedule", "The scheduling solution to be manipulated."));
     47      Parameters.Add(new LookupParameter<IScheduleSolution>("Schedule", "The scheduling solution to be manipulated."));
    4848      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    4949    }
Note: See TracChangeset for help on using the changeset viewer.