Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/12 12:22:33 (12 years ago)
Author:
jkarder
Message:

#1331:

  • fixed bug in path relinking selection
  • fixed bug in ScatterSearch.Prepare()
  • added custom interface (IImprovementOperator) for Scatter Search specific improvement operators
  • switched from diversity calculation to similarity calculation
  • separated IPathRelinker from ICrossover
  • changed TestFunctionsImprovementOperator to use reflection for evaluating functions
  • changed SolutionPoolUpdateMethod to use similarity calculation for solution comparison
  • improved TravelingSalesmanImprovementOperator
  • improved operator graph
  • removed specific operators used to evaluate TestFunctions problems
  • removed custom crossover operator (NChildCrossover)
  • added parameters and adjusted types
  • adjusted event handling
  • changed access levels
  • minor code improvements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackMultipleGuidesPathRelinker.cs

    r7778 r7786  
    5454        throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
    5555
    56       var v1 = initiator.Clone() as BinaryVector;
    57       var targets = new BinaryVector[guides.Length];
     56      BinaryVector v1 = initiator.Clone() as BinaryVector;
     57      BinaryVector[] targets = new BinaryVector[guides.Length];
    5858      Array.Copy(guides, targets, guides.Length);
    5959
     
    6161        throw new ArgumentException("At least one solution is of different length.");
    6262
    63       var solutions = new List<BinaryVector>();
     63      IList<BinaryVector> solutions = new List<BinaryVector>();
    6464      for (int i = 0; i < v1.Length; i++) {
    6565        // TODO: path relinking
    6666      }
    6767
    68       var selection = new List<IItem>();
     68      IList<IItem> selection = new List<IItem>();
    6969      if (solutions.Count > 0) {
    70         var noSol = (int)Math.Round(solutions.Count * n.Value);
     70        int noSol = (int)(solutions.Count * n.Value);
    7171        if (noSol <= 0) noSol++;
    72         var stepSize = (double)solutions.Count / (double)noSol;
     72        double stepSize = (double)solutions.Count / (double)noSol;
    7373        for (int i = 0; i < noSol; i++)
    74           selection.Add(solutions.ElementAt((int)Math.Round((i + 1) * stepSize - stepSize * 0.5)));
     74          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
    7575      }
    7676
Note: See TracChangeset for help on using the changeset viewer.