Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/18/17 14:38:18 (6 years ago)
Author:
ddorfmei
Message:

#2747: Improved hard-coded genetic algorithm

  • implemented restart strategy
  • implemented 1-Opt algorithm
  • added parameters to control restart strategy and optimal assignment strategy
  • additional results: best solution found after number of generations, jobs/nests (for evaluation only)
File:
1 moved

Legend:

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

    r15532 r15533  
    2626
    2727namespace HeuristicLab.Problems.Scheduling.CFSAP {
    28   public static class OptimalAssignment {
     28  public static class OptimalPolynomialAssignment {
    2929
    3030    public static int[] MakeAssignment(Permutation order, IntMatrix processingTimes, ItemList<IntMatrix> setupTimes, out int T) {
     
    3333      int[,,] weights = new int[2, 2 * N, 2 * N];
    3434      int[,] graph = new int[2, N];
    35       int[,] prevPath = new int[2, N + 1];                     //Only for optimal assignment evaluation
    36       int[] optimalAssignment = new int[N];                //Only for optimal assignment evaluation
     35      int[,] prevPath = new int[2, N + 1];    //Only for optimal assignment evaluation
     36      int[] optimalAssignment = new int[N];   //Only for optimal assignment evaluation
    3737
    3838      //Calculate weights in the graph
    39       for (int S = 0; S < N; S++) { //Starting point of the arc
    40         for (int sM = 0; sM < 2; sM++) {    //Starting point machine
     39      for (int S = 0; S < N; S++) {        //Starting point of the arc
     40        for (int sM = 0; sM < 2; sM++) {   //Starting point machine
    4141          int eM = sM == 0 ? 1 : 0;
    4242          weights[sM, S, S + 1] = 0;
     
    8787          if (newT < T) {
    8888            T = newT;
    89             optimalAssignment = MakeAssignement(S, SM, prevPath, order);
     89            optimalAssignment = MakeAssignment(S, SM, prevPath, order);
    9090          }
    9191        }
     
    104104    }
    105105
    106     private static int[] MakeAssignement(int start, int startMach, int[,] prevPath, Permutation order) {
     106    private static int[] MakeAssignment(int start, int startMach, int[,] prevPath, Permutation order) {
    107107      var N = order.Length;
    108108      int[] assignment = Enumerable.Repeat(-1, N).ToArray();
Note: See TracChangeset for help on using the changeset viewer.