Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/06/15 15:33:25 (9 years ago)
Author:
mkommend
Message:

#2521: Added encodings for schedules.

Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3
Files:
6 added
32 edited
3 moved

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/GTAlgorithmUtils.cs

    r13436 r13437  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using HeuristicLab.Core;
    2425
     
    2627  public static class GTAlgorithmUtils {
    2728
    28     public static ItemList<Task> GetEarliestNotScheduledTasks(ItemList<Job> jobData) {
     29    public static ItemList<Task> GetEarliestNotScheduledTasks(IEnumerable<Job> jobData) {
    2930      ItemList<Task> result = new ItemList<Task>();
    3031      foreach (Job j in jobData) {
     
    3839      return result;
    3940    }
    40     public static Task GetTaskWithMinimalEC(ItemList<Task> earliestTasksList, Schedule schedule) {
     41    public static Task GetTaskWithMinimalEC(IEnumerable<Task> earliestTasksList, Schedule schedule) {
    4142      double minEct = double.MaxValue;
    4243      Task result = null;
     
    5051      return result;
    5152    }
    52     public static ItemList<Task> GetConflictSetForTask(Task conflictedTask, ItemList<Task> earliestTasksList, ItemList<Job> jobData, Schedule schedule) {
     53    public static ItemList<Task> GetConflictSetForTask(Task conflictedTask, IEnumerable<Task> earliestTasksList, Schedule schedule) {
    5354      ItemList<Task> result = new ItemList<Task>();
    5455      double conflictedCompletionTime = ComputeEarliestCompletionTime(conflictedTask, schedule);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/HeuristicLab.Encodings.ScheduleEncoding-3.3.csproj

    r13435 r13437  
    123123    <Compile Include="Interfaces\IScheduleCrossover.cs" />
    124124    <Compile Include="Interfaces\ISchedule.cs" />
     125    <Compile Include="Interfaces\IScheduleEncoding.cs" />
    125126    <Compile Include="Interfaces\IScheduleManipulator.cs" />
    126127    <Compile Include="Interfaces\IScheduleOperator.cs" />
     
    129130    <Compile Include="JobSequenceMatrix\Crossovers\JSMOXCrossover.cs" />
    130131    <Compile Include="JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" />
     132    <Compile Include="JobSequenceMatrix\JobSequenceMatrixEncoding.cs" />
    131133    <Compile Include="JobSequenceMatrix\JSMEncoding.cs" />
    132134    <Compile Include="JobSequenceMatrix\JSMRandomCreator.cs" />
     
    139141    <Compile Include="PermutationWithRepetition\Manipulators\PWRManipulator.cs" />
    140142    <Compile Include="PermutationWithRepetition\Manipulators\PWRInsertionManipulator.cs" />
     143    <Compile Include="PermutationWithRepetition\PermutationWithRepetitionEncoding.cs" />
    141144    <Compile Include="PermutationWithRepetition\PWREncoding.cs" />
    142145    <Compile Include="PermutationWithRepetition\PWRRandomCreator.cs" />
     
    147150    <Compile Include="PriorityRulesVector\Manipulators\PRVManipulator.cs" />
    148151    <Compile Include="PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" />
     152    <Compile Include="PriorityRulesVector\PriorityRulesVectorEncoding.cs" />
    149153    <Compile Include="PriorityRulesVector\PRVEncoding.cs" />
    150154    <Compile Include="PriorityRulesVector\PRVRandomCreator.cs" />
    151155    <Compile Include="Properties\AssemblyInfo.cs" />
     156    <Compile Include="ScheduleEncoding.cs" />
    152157    <Compile Include="ScheduleEncoding\Crossovers\DirectScheduleCrossover.cs" />
    153158    <Compile Include="ScheduleEncoding\Crossovers\DirectScheduleGTCrossover.cs" />
    154     <Compile Include="ScheduleEncoding\GTAlgorithmUtils.cs" />
    155     <Compile Include="ScheduleEncoding\Job.cs" />
     159    <Compile Include="GTAlgorithmUtils.cs" />
     160    <Compile Include="Job.cs" />
     161    <Compile Include="ScheduleEncoding\DirectScheduleEncoding.cs" />
    156162    <Compile Include="ScheduleEncoding\Manipulators\DirectScheduleManipulator.cs" />
    157163    <Compile Include="ScheduleEncoding\DirectScheduleRandomCreator.cs" />
     
    161167    <Compile Include="ScheduleCreator.cs" />
    162168    <Compile Include="ScheduleCrossover.cs" />
    163     <Compile Include="ScheduleEncoding\Task.cs" />
     169    <Compile Include="Task.cs" />
    164170    <Compile Include="ScheduleManipulator.cs" />
    165171  </ItemGroup>
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IDirectScheduleOperator.cs

    r12012 r13437  
    2424namespace HeuristicLab.Encodings.ScheduleEncoding {
    2525  public interface IDirectScheduleOperator : IOperator {
     26    ILookupParameter<ItemList<Job>> JobDataParameter { get; }
    2627  }
    2728}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/ISchedule.cs

    r13435 r13437  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
     22using HeuristicLab.Optimization;
    2323
    2424namespace HeuristicLab.Encodings.ScheduleEncoding {
    25   public interface ISchedule : IItem {
     25  public interface ISchedule : ISolution {
    2626  }
    2727}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleCreator.cs

    r13435 r13437  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2324using HeuristicLab.Optimization;
    2425
    2526namespace HeuristicLab.Encodings.ScheduleEncoding {
    26   public interface IScheduleCreator : ISolutionCreator, IScheduleOperator {
     27  public interface IScheduleCreator : ISolutionCreator<ISchedule>, IScheduleOperator {
    2728    ILookupParameter<ISchedule> ScheduleParameter { get; }
     29    IValueLookupParameter<IntValue> JobsParameter { get; }
     30    IValueLookupParameter<IntValue> ResourcesParameter { get; }
    2831  }
    2932}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMCrossover.cs

    r12012 r13437  
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2525
    26 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     26namespace HeuristicLab.Encodings.ScheduleEncoding {
    2727  [Item("JSMCrossover", "An operator which crosses two JSM representations.")]
    2828  [StorableClass]
     
    3232    protected JSMCrossover(bool deserializing) : base(deserializing) { }
    3333    protected JSMCrossover(JSMCrossover original, Cloner cloner) : base(original, cloner) { }
    34     public JSMCrossover()
    35       : base() {
    36       ParentsParameter.ActualName = "JobSequenceMatrix";
    37       ChildParameter.ActualName = "JobSequenceMatrix";
    38     }
     34
     35    public JSMCrossover() : base() { }
    3936
    4037    public abstract JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMJOXCrossover.cs

    r12012 r13437  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("JSMJobbasedOrderCrossover", "Represents a crossover operation swapping subsequences of the parents to generate offspring.")]
    3030  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMOXCrossover.cs

    r12012 r13437  
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2525
    26 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     26namespace HeuristicLab.Encodings.ScheduleEncoding {
    2727  [Item("JSMOrderCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    2828  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMSXXCrossover.cs

    r12012 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("JSMSubsequenceExchangeCrossover", "Represents a crossover operation identifiying and exchanging equal subsequences of the parents to generate offspring.")]
    2929  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMEncoding.cs

    r13435 r13437  
    2020#endregion
    2121
    22 using System;
    2322using System.Text;
    2423using HeuristicLab.Common;
     
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    3029  [Item("JobSequenceMatrixEncoding", "Represents an encoding for a scheduling Problem using a list of job sequences to deliver scheduleinformation.")]
    3130  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs

    r13435 r13437  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Encodings.PermutationEncoding;
    2625using HeuristicLab.Optimization;
     
    2827using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2928
    30 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     29namespace HeuristicLab.Encodings.ScheduleEncoding {
    3130  [Item("JobSequenceMatrixCreator", "Creator class used to create Job Sequence Matrix solutions for standard JobShop scheduling problems.")]
    3231  [StorableClass]
     
    3534    public ILookupParameter<IRandom> RandomParameter {
    3635      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    37     }
    38     public IValueLookupParameter<IntValue> JobsParameter {
    39       get { return (IValueLookupParameter<IntValue>)Parameters["Jobs"]; }
    40     }
    41     public IValueLookupParameter<IntValue> ResourcesParameter {
    42       get { return (IValueLookupParameter<IntValue>)Parameters["Resources"]; }
    4336    }
    4437
     
    4942      : base() {
    5043      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    51       Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
    52       Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
    53 
    54       ScheduleParameter.ActualName = "JobSequenceMatrix";
    5544    }
    5645
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMManipulator.cs

    r13435 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("JSMManipulator", "An operator which manipulates a JSM representation.")]
    2929  [StorableClass]
     
    3232    protected JSMManipulator(bool deserializing) : base(deserializing) { }
    3333    protected JSMManipulator(JSMManipulator original, Cloner cloner) : base(original, cloner) { }
    34     public JSMManipulator()
    35       : base() {
    36       ScheduleParameter.ActualName = "JobSequenceMatrix";
    37     }
     34    public JSMManipulator() : base() { }
    3835
    3936    protected abstract void Manipulate(IRandom random, ISchedule individual);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMShiftChangeManipulator.cs

    r13435 r13437  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929
    30 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     30namespace HeuristicLab.Encodings.ScheduleEncoding {
    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]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMSwapManipulator.cs

    r13435 r13437  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("JSMSwapManipulator", "Represents a manipulation operation swapping parts of the individual.")]
    3030  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRCrossover.cs

    r12012 r13437  
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2525
    26 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     26namespace HeuristicLab.Encodings.ScheduleEncoding {
    2727  [Item("PWRCrossover", "An operator which crosses two JSM representations.")]
    2828  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRGOXCrossover.cs

    r12012 r13437  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     29namespace HeuristicLab.Encodings.ScheduleEncoding {
    3030  [Item("PWRGeneralizationOrderCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    3131  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRPPXCrossover.cs

    r12012 r13437  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     29namespace HeuristicLab.Encodings.ScheduleEncoding {
    3030  [Item("PWRPPXCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    3131  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Manipulators/PWRInsertionManipulator.cs

    r12012 r13437  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     29namespace HeuristicLab.Encodings.ScheduleEncoding {
    3030  [Item("PWRInsertionManipulator", "Represents a manipulation operation inserting parts of the individual at another position.")]
    3131  [StorableClass]
     
    4343      int cutIndex = random.Next(individual.PermutationWithRepetition.Length);
    4444      int insertIndex = random.Next(individual.PermutationWithRepetition.Length);
    45       List<int> perm = ((IntegerVector)(individual.PermutationWithRepetition.Clone())).ToList<int>();
     45      List<int> perm = ((IntegerVector)(individual.PermutationWithRepetition.Clone())).ToList();
    4646      int aux = perm[cutIndex];
    4747      if (cutIndex > insertIndex) {
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Manipulators/PWRManipulator.cs

    r13435 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("PWRManipulator", "An operator which manipulates a PWR representation.")]
    2929  [StorableClass]
     
    3333    protected PWRManipulator(bool deserializing) : base(deserializing) { }
    3434    protected PWRManipulator(PWRManipulator original, Cloner cloner) : base(original, cloner) { }
    35     public PWRManipulator()
    36       : base() {
    37       ScheduleParameter.ActualName = "PermutationWithRepetition";
    38     }
     35    public PWRManipulator() : base() { }
    3936
    4037    protected abstract void Manipulate(IRandom random, PWREncoding individual);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs

    r13435 r13437  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("PermutationWithRepetitionEncoding", "Represents a encoding for a standard JobShop Scheduling Problem.")]
    3030  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs

    r13435 r13437  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Optimization;
    2625using HeuristicLab.Parameters;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    3029  [Item("PermutationWithRepetitionRandomCreator", "Creates PWR-individuals at random.")]
    3130  [StorableClass]
     
    3433    public ILookupParameter<IRandom> RandomParameter {
    3534      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    36     }
    37     public IValueLookupParameter<IntValue> JobsParameter {
    38       get { return (IValueLookupParameter<IntValue>)Parameters["Jobs"]; }
    39     }
    40     public IValueLookupParameter<IntValue> ResourcesParameter {
    41       get { return (IValueLookupParameter<IntValue>)Parameters["Resources"]; }
    4235    }
    4336
     
    4841      : base() {
    4942      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    50       Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
    51       Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
    52 
    53       ScheduleParameter.ActualName = "PermutationWithRepetition";
    5443    }
    5544
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVCrossover.cs

    r12012 r13437  
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2525
    26 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     26namespace HeuristicLab.Encodings.ScheduleEncoding {
    2727  [Item("PRVCrossover", "An operator which crosses two PRV representations.")]
    2828  [StorableClass]
     
    3232    protected PRVCrossover(bool deserializing) : base(deserializing) { }
    3333    protected PRVCrossover(PRVCrossover original, Cloner cloner) : base(original, cloner) { }
    34     public PRVCrossover()
    35       : base() {
    36       ParentsParameter.ActualName = "PriorityRulesVector";
    37       ChildParameter.ActualName = "PriorityRulesVector";
    38     }
     34    public PRVCrossover() : base() { }
    3935
    4036    public abstract PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVDiscreteCrossover.cs

    r12012 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("PRVDiscreteCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    2929  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVSinglePointCrossover.cs

    r12012 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("PRVSinglePointCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    2929  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVManipulator.cs

    r13435 r13437  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("PRVManipulator", "An operator which manipulates a PRV representation.")]
    2929  [StorableClass]
     
    3232    protected PRVManipulator(bool deserializing) : base(deserializing) { }
    3333    protected PRVManipulator(PRVManipulator original, Cloner cloner) : base(original, cloner) { }
    34     public PRVManipulator()
    35       : base() {
    36       ScheduleParameter.ActualName = "PriorityRulesVector";
    37     }
     34    public PRVManipulator() : base() { }
    3835
    3936    protected abstract void Manipulate(IRandom random, PRVEncoding individual);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVUniformOnePositionManipulator.cs

    r12012 r13437  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("PRVUniformOnePositionManipulator", "Represents a manipulation operation inserting parts of the individual at another position.")]
    3030  [StorableClass]
     
    4141
    4242    public static void Apply(IRandom random, PRVEncoding individual) {
    43       UniformOnePositionManipulator.Apply(random, individual.PriorityRulesVector, new IntMatrix(new int[,] { { 0, individual.NrOfRules.Value } }));
     43      UniformOnePositionManipulator.Apply(random, individual.PriorityRulesVector, new IntMatrix(new int[,] { { 0, individual.NrOfRules } }));
    4444    }
    4545
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVEncoding.cs

    r13435 r13437  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    2625using HeuristicLab.Encodings.IntegerVectorEncoding;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    3029  [Item("PriorityRulesVectorEncoding", "Represents an encoding for a Scheduling Problem.")]
    3130  [StorableClass]
     
    3534
    3635    [Storable]
    37     private IntValue nrOfRules;
    38     public IntValue NrOfRules {
    39       get {
    40         return nrOfRules;
    41       }
    42     }
     36    public int NrOfRules { get; private set; }
    4337
    4438    [StorableConstructor]
     
    4640    protected PRVEncoding(PRVEncoding original, Cloner cloner)
    4741      : base(original, cloner) {
    48       this.nrOfRules = cloner.Clone(original.NrOfRules);
     42      this.NrOfRules = original.NrOfRules;
    4943      this.PriorityRulesVector = cloner.Clone(original.PriorityRulesVector);
    5044    }
    5145    public PRVEncoding(int nrOfRules)
    5246      : base() {
    53       this.nrOfRules = new IntValue(nrOfRules);
     47      this.NrOfRules = nrOfRules;
    5448      this.PriorityRulesVector = new IntegerVector();
    5549    }
    56     public PRVEncoding(IntegerVector iv, IntValue nrOfRules)
     50    public PRVEncoding(IntegerVector iv, int nrOfRules)
    5751      : base() {
    58       this.nrOfRules = (IntValue)nrOfRules.Clone();
     52      this.NrOfRules = nrOfRules;
    5953      this.PriorityRulesVector = (IntegerVector)iv.Clone();
    6054    }
    61     public PRVEncoding(int length, IRandom random, int min, int max, IntValue nrOfRules)
     55    public PRVEncoding(int length, IRandom random, int min, int max, int nrOfRules)
    6256      : base() {
    63       this.nrOfRules = (IntValue)nrOfRules.Clone();
     57      this.NrOfRules = nrOfRules;
    6458      this.PriorityRulesVector = new IntegerVector(length, random, min, max);
    6559    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs

    r13435 r13437  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Optimization;
    2625using HeuristicLab.Parameters;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
    29 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    3029  [Item("PriorityRulesRandomCreator", "Creator class used to create PRV encoding objects for scheduling problems.")]
    3130  [StorableClass]
     
    3332
    3433    [Storable]
    35     public IntValue NrOfRules { get; set; }
     34    public int NrOfRules { get; set; }
    3635
    3736    public ILookupParameter<IRandom> RandomParameter {
    3837      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    39     }
    40     public IValueLookupParameter<IntValue> JobsParameter {
    41       get { return (IValueLookupParameter<IntValue>)Parameters["Jobs"]; }
    42     }
    43     public IValueLookupParameter<IntValue> ResourcesParameter {
    44       get { return (IValueLookupParameter<IntValue>)Parameters["Resources"]; }
    4538    }
    4639
     
    4942    protected PRVRandomCreator(PRVRandomCreator original, Cloner cloner)
    5043      : base(original, cloner) {
    51       this.NrOfRules = cloner.Clone(original.NrOfRules);
     44      this.NrOfRules = original.NrOfRules;
    5245    }
    53     public PRVRandomCreator()
    54       : base() {
    55       NrOfRules = new IntValue(10);
    56       Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    57       Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
    58       Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
    59       ScheduleParameter.ActualName = "PriorityRulesVector";
    60     }
    61 
    6246    public override IDeepCloneable Clone(Cloner cloner) {
    6347      return new PRVRandomCreator(this, cloner);
    6448    }
    6549
    66     public static PRVEncoding Apply(int jobs, int resources, IRandom random, IntValue nrOfRules) {
    67       return new PRVEncoding(jobs * resources, random, 0, nrOfRules.Value, nrOfRules);
     50    public PRVRandomCreator()
     51      : base() {
     52      NrOfRules = 10;
     53      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
     54    }
     55
     56    public static PRVEncoding Apply(int jobs, int resources, IRandom random, int nrOfRules) {
     57      return new PRVEncoding(jobs * resources, random, 0, nrOfRules, nrOfRules);
    6858    }
    6959
     
    7161      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules);
    7262    }
    73 
    74 
    7563  }
    7664}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCreator.cs

    r13435 r13437  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
     24using HeuristicLab.Data;
    2425using HeuristicLab.Operators;
    2526using HeuristicLab.Parameters;
     
    3435      get { return (ILookupParameter<ISchedule>)Parameters["Schedule"]; }
    3536    }
     37    public IValueLookupParameter<IntValue> JobsParameter {
     38      get { return (IValueLookupParameter<IntValue>)Parameters["Jobs"]; }
     39    }
     40    public IValueLookupParameter<IntValue> ResourcesParameter {
     41      get { return (IValueLookupParameter<IntValue>)Parameters["Resources"]; }
     42    }
    3643
    3744    [StorableConstructor]
     
    4047    public ScheduleCreator()
    4148      : base() {
    42       Parameters.Add(new LookupParameter<ISchedule>("Schedule", "The new scheduling solutioncandidate."));
     49      Parameters.Add(new LookupParameter<ISchedule>("Schedule", "The new scheduling solution candidate."));
     50      Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
     51      Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
    4352    }
    4453
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleCrossover.cs

    r12012 r13437  
    2929  [StorableClass]
    3030  public abstract class DirectScheduleCrossover : ScheduleCrossover, IDirectScheduleOperator {
     31    public ILookupParameter<ItemList<Job>> JobDataParameter {
     32      get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
     33    }
     34
    3135    [StorableConstructor]
    3236    protected DirectScheduleCrossover(bool deserializing) : base(deserializing) { }
     
    3438    public DirectScheduleCrossover()
    3539      : base() {
    36       ParentsParameter.ActualName = "Schedule";
    37       ChildParameter.ActualName = "Schedule";
    3840      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Job data taken from the JSSP - Instance."));
    39     }
    40 
    41     public ILookupParameter<ItemList<Job>> JobDataParameter {
    42       get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
    4341    }
    4442
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleGTCrossover.cs

    r12012 r13437  
    6464        Task minimal = GTAlgorithmUtils.GetTaskWithMinimalEC(earliestTasksList, child);
    6565        int conflictedResourceNr = minimal.ResourceNr;
    66         Resource conflictedResource = child.Resources[conflictedResourceNr];
    6766
    6867        //STEP 2 - Compute a conflict set of all operations that can be scheduled on the conflicted resource
    69         ItemList<Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, jobData, child);
     68        ItemList<Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, child);
    7069
    7170        //STEP 3 - Select a task from the conflict set
    72         int progressOnResource = conflictedResource.Tasks.Count;
    7371        Task selectedTask = null;
    7472        if (random.NextDouble() < mutProp) {
     
    7775        } else {
    7876          //Crossover
    79           selectedTask = SelectTaskFromConflictSet(conflictSet, ((random.Next(2) == 0) ? parent1 : parent2), conflictedResourceNr, progressOnResource);
     77          selectedTask = SelectTaskFromConflictSet(conflictSet, ((random.Next(2) == 0) ? parent1 : parent2), conflictedResourceNr);
    8078        }
    8179
     
    9290    }
    9391
    94     private static Task SelectTaskFromConflictSet(ItemList<Task> conflictSet, Schedule usedParent, int conflictedResourceNr, int progressOnResource) {
     92    private static Task SelectTaskFromConflictSet(ItemList<Task> conflictSet, Schedule usedParent, int conflictedResourceNr) {
    9593      //Apply Crossover
    9694      foreach (ScheduledTask st in usedParent.Resources[conflictedResourceNr].Tasks) {
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs

    r13435 r13437  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    26 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
    2725using HeuristicLab.Optimization;
    2826using HeuristicLab.Parameters;
     
    3331  [Item("DirectScheduleRandomCreator", "Creator class used to create schedule encoding objects.")]
    3432  [StorableClass]
    35   public class DirectScheduleRandomCreator : ScheduleCreator, IStochasticOperator {
     33  public class DirectScheduleRandomCreator : ScheduleCreator, IStochasticOperator, IDirectScheduleOperator {
    3634
    3735    public ILookupParameter<IRandom> RandomParameter {
    3836      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3937    }
    40     public IValueLookupParameter<IntValue> JobsParameter {
    41       get { return (IValueLookupParameter<IntValue>)Parameters["Jobs"]; }
    42     }
    43     public IValueLookupParameter<IntValue> ResourcesParameter {
    44       get { return (IValueLookupParameter<IntValue>)Parameters["Resources"]; }
    45     }
    4638    public ILookupParameter<ItemList<Job>> JobDataParameter {
    4739      get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
    4840    }
    49 
    5041
    5142    [StorableConstructor]
     
    6051      : base() {
    6152      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    62       Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
    63       Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
    6453      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Job data taken from the JSSP - Instance."));
    65       ScheduleParameter.ActualName = "Schedule";
    6654    }
    6755
     
    8977          new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue),
    9078          jobData);
    91       } catch {
     79      }
     80      catch {
    9281        throw new Exception("ScheduleRandomCreator needs JobData parameter from a JSSP-Instance to create Schedule-Instances!");
    9382      }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators/DirectScheduleManipulator.cs

    r13435 r13437  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
     
    2930  [StorableClass]
    3031  public abstract class DirectScheduleManipulator : ScheduleManipulator, IDirectScheduleOperator {
     32    public ILookupParameter<ItemList<Job>> JobDataParameter {
     33      get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
     34    }
    3135
    3236    [StorableConstructor]
    3337    protected DirectScheduleManipulator(bool deserializing) : base(deserializing) { }
    3438    protected DirectScheduleManipulator(DirectScheduleManipulator original, Cloner cloner) : base(original, cloner) { }
     39
    3540    public DirectScheduleManipulator()
    3641      : base() {
    37       ScheduleParameter.ActualName = "Schedule";
     42      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Job data taken from the JSSP - Instance."));
    3843    }
    3944
     
    4247    public override IOperation InstrumentedApply() {
    4348      var schedule = ScheduleParameter.ActualValue as Schedule;
    44       if (schedule == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type Schedule.");
     49      if (schedule == null) throw new InvalidOperationException("Schedule was not found or is not of type Schedule.");
    4550      Manipulate(RandomParameter.ActualValue, schedule);
    4651      return base.InstrumentedApply();
Note: See TracChangeset for help on using the changeset viewer.