Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/08/17 07:34:46 (7 years ago)
Author:
abeham
Message:

#2747: worked on the CFSAP

  • Added problem definition that defines both sequence and assignment for a single nest
  • Added problem definition that would optimizes both sequence and assignment for multiple nests
  • Added interface
  • Added solving strategy that would use multiple instances of a template algorithm to optimize the worst nest
  • Fixed bug in parser regarding setup times
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/CFSAPSequenceOnly.cs

    r15456 r15460  
    4444    }
    4545
     46    public IntMatrix ProcessingTimes {
     47      get { return ProcessingTimesParameter.Value; }
     48      set { ProcessingTimesParameter.Value = value; }
     49    }
     50
    4651    public IValueParameter<ItemList<IntMatrix>> SetupTimesParameter {
    4752      get { return (IValueParameter<ItemList<IntMatrix>>)Parameters["SetupTimes"]; }
     53    }
     54
     55    public ItemList<IntMatrix> SetupTimes {
     56      get { return SetupTimesParameter.Value; }
     57      set { SetupTimesParameter.Value = value; }
    4858    }
    4959
     
    162172      for (int machine = 0; machine < 2; machine++) {
    163173        int[] assignment = Enumerable.Repeat(machine, N).ToArray();
    164         int newT = EvaluateAssignement(order, assignment, processingTimes, setupTimes);
     174        int newT = CFSAP.EvaluateAssignement(order, assignment, processingTimes, setupTimes);
    165175        if (newT < T) { //New best solution has been found
    166176          T = newT;
    167           assignment.CopyTo(optimalAssignment, N);
     177          optimalAssignment = assignment;
    168178        }
    169       }
    170 
    171       return T;
    172     }
    173 
    174     //Function to evaluate individual with the specified assignment
    175     public static int EvaluateAssignement(Permutation order, int[] assignment, IntMatrix processingTimes, ItemList<IntMatrix> setupTimes) {
    176       var N = order.Length;
    177       int T = 0;
    178 
    179       for (int i = 0; i < N; i++) {
    180         int operation = order[i];
    181         int machine = assignment[operation];
    182         T += processingTimes[machine, operation];
    183       }
    184 
    185       for (int machine = 0; machine < 2; machine++) {
    186         int first = -1;
    187         int last = -1;
    188         for (int i = 0; i < N; i++) {
    189           int operation = order[i];
    190           if (assignment[operation] == machine) {
    191             if (first == -1)
    192               first = operation;
    193             else
    194               T += setupTimes[machine][last, operation];
    195             last = operation;
    196           }
    197         }
    198         if (last != -1 && first != -1)
    199           T += setupTimes[machine][last, first];
    200179      }
    201180
     
    232211
    233212      return assignment;
     213    }
     214
     215    public void UpdateEncoding() {
     216      Encoding.Length = ProcessingTimes.Columns;
    234217    }
    235218
     
    265248      }
    266249      SetupTimesParameter.Value = setups;
    267       Encoding.Length = data.Jobs;
     250      UpdateEncoding();
    268251      Name = data.Name + "-nest" + nest;
    269252      Description = data.Description;
     253      if (data.BestKnownCycleTime.HasValue)
     254        BestKnownQuality = data.BestKnownCycleTime.Value;
     255      else BestKnownQualityParameter.Value = null;
    270256    }
    271257  }
Note: See TracChangeset for help on using the changeset viewer.