Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/16 17:10:05 (7 years ago)
Author:
abeham
Message:

#2701:

  • Reusing similiarty calculator in BinaryMemPR
  • Fixing distance calculation for linear linkage and LinearLinkageMemPR
  • Small changes to base algorithm
  • Added biased model trainer for permutation (rank and fitness)
  • Fixing best known quality calculation for GCP
File:
1 edited

Legend:

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

    r14477 r14496  
    230230        while (Context.PopulationCount < 2) {
    231231          var child = Create(token);
    232           Context.HcSteps += HillClimb(child, token);
    233           Context.AddToPopulation(child);
    234           Analyze(token);
     232          Context.LocalSearchEvaluations += HillClimb(child, token);
     233          if (Replace(child, token) >= 0)
     234            Analyze(token);
    235235          token.ThrowIfCancellationRequested();
    236236          if (Terminate()) return;
    237237        }
    238         Context.HcSteps /= 2;
     238        Context.LocalSearchEvaluations /= 2;
    239239        Context.Initialized = true;
    240240      }
     
    262262      int replPos = -1;
    263263
    264       if (Context.Random.NextDouble() > parentDist) {
     264      if (Context.Random.NextDouble() > parentDist * parentDist) {
    265265        offspring = BreedAndImprove(p1, p2, token);
    266266        replPos = Replace(offspring, token);
     
    271271      }
    272272
    273       if (Context.Random.NextDouble() < parentDist) {
     273      if (Context.Random.NextDouble() < Math.Sqrt(parentDist)) {
    274274        offspring = RelinkAndImprove(p1, p2, token);
    275275        replPos = Replace(offspring, token);
     
    299299          offspring = (ISingleObjectiveSolutionScope<TSolution>)Context.AtPopulation(Context.Random.Next(Context.PopulationCount)).Clone();
    300300          Mutate(offspring, token);
    301           PerformTabuWalk(offspring, Context.HcSteps, token);
     301          PerformTabuWalk(offspring, Context.LocalSearchEvaluations, token);
    302302          replPos = Replace(offspring, token);
    303303          if (replPos >= 0) {
     
    318318        Results.Add(new Result("Iterations", new IntValue(Context.Iterations)));
    319319      else ((IntValue)res.Value).Value = Context.Iterations;
    320       if (!Results.TryGetValue("HcSteps", out res))
    321         Results.Add(new Result("HcSteps", new IntValue(Context.HcSteps)));
    322       else ((IntValue)res.Value).Value = Context.HcSteps;
     320      if (!Results.TryGetValue("LocalSearch Evaluations", out res))
     321        Results.Add(new Result("LocalSearch Evaluations", new IntValue(Context.LocalSearchEvaluations)));
     322      else ((IntValue)res.Value).Value = Context.LocalSearchEvaluations;
    323323      if (!Results.TryGetValue("ByBreeding", out res))
    324324        Results.Add(new Result("ByBreeding", new IntValue(Context.ByBreeding)));
Note: See TracChangeset for help on using the changeset viewer.