- Timestamp:
- 12/16/16 17:10:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/MemPRAlgorithm.cs
r14477 r14496 230 230 while (Context.PopulationCount < 2) { 231 231 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); 235 235 token.ThrowIfCancellationRequested(); 236 236 if (Terminate()) return; 237 237 } 238 Context. HcSteps /= 2;238 Context.LocalSearchEvaluations /= 2; 239 239 Context.Initialized = true; 240 240 } … … 262 262 int replPos = -1; 263 263 264 if (Context.Random.NextDouble() > parentDist ) {264 if (Context.Random.NextDouble() > parentDist * parentDist) { 265 265 offspring = BreedAndImprove(p1, p2, token); 266 266 replPos = Replace(offspring, token); … … 271 271 } 272 272 273 if (Context.Random.NextDouble() < parentDist) {273 if (Context.Random.NextDouble() < Math.Sqrt(parentDist)) { 274 274 offspring = RelinkAndImprove(p1, p2, token); 275 275 replPos = Replace(offspring, token); … … 299 299 offspring = (ISingleObjectiveSolutionScope<TSolution>)Context.AtPopulation(Context.Random.Next(Context.PopulationCount)).Clone(); 300 300 Mutate(offspring, token); 301 PerformTabuWalk(offspring, Context. HcSteps, token);301 PerformTabuWalk(offspring, Context.LocalSearchEvaluations, token); 302 302 replPos = Replace(offspring, token); 303 303 if (replPos >= 0) { … … 318 318 Results.Add(new Result("Iterations", new IntValue(Context.Iterations))); 319 319 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; 323 323 if (!Results.TryGetValue("ByBreeding", out res)) 324 324 Results.Add(new Result("ByBreeding", new IntValue(Context.ByBreeding)));
Note: See TracChangeset
for help on using the changeset viewer.