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/PriorityRulesVector
Files:
1 added
1 deleted
8 edited

Legend:

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