Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/17 18:18:37 (7 years ago)
Author:
abeham
Message:

#2701:

  • Tagged unbiased models with property
  • Changed default configuration
  • Added solution distance to breeding, relinking and delinking performance models
  • Changed sampling model to base prediction on average distance in genotype space
  • Changed target for hillclimber and relinking to relative (quality improvement)
  • changed breeding to count cache hits per crossover
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Binary/BinaryMemPR.cs

    r14557 r14563  
    4545      foreach (var trainer in ApplicationManager.Manager.GetInstances<ISolutionModelTrainer<BinaryMemPRPopulationContext>>())
    4646        SolutionModelTrainerParameter.ValidValues.Add(trainer);
    47      
     47
     48      if (SolutionModelTrainerParameter.ValidValues.Count > 0) {
     49        var unbiased = SolutionModelTrainerParameter.ValidValues.FirstOrDefault(x => !x.Bias);
     50        if (unbiased != null) SolutionModelTrainerParameter.Value = unbiased;
     51      }
     52
    4853      foreach (var localSearch in ApplicationManager.Manager.GetInstances<ILocalSearch<BinaryMemPRSolutionContext>>()) {
    4954        LocalSearchParameter.ValidValues.Add(localSearch);
     
    156161      cache.Add(p2.Solution);
    157162
    158       var cacheHits = 0;
     163      var cacheHits = new Dictionary<int, int>() { { 0, 0 }, { 1, 0 }, { 2, 0 } };
    159164      ISingleObjectiveSolutionScope<BinaryVector> offspring = null;
     165     
    160166      while (evaluations < N) {
    161167        BinaryVector c = null;
    162         var xochoice = Context.Random.Next(3);
     168        var xochoice = cacheHits.SampleRandom(Context.Random).Key;
    163169        switch (xochoice) {
    164170          case 0: c = NPointCrossover.Apply(Context.Random, p1.Solution, p2.Solution, new IntValue(1)); break;
     
    167173        }
    168174        if (cache.Contains(c)) {
    169           cacheHits++;
    170           if (cacheHits > 50) break;
     175          cacheHits[xochoice]++;
     176          if (cacheHits[xochoice] > 10) {
     177            cacheHits.Remove(xochoice);
     178            if (cacheHits.Count == 0) break;
     179          }
    171180          continue;
    172181        }
Note: See TracChangeset for help on using the changeset viewer.