You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GeneticSearchResultnextGeneration=searchEngine.Next();// Run a single generation
112
113
Task.Run(() =>searchEngine.Run()); // Do in a new thread, so that we don't need to wait for the engine to finish
113
114
Thread.Sleep(10); // Give the engine some time to run
114
115
searchEngine.Pause();
115
116
vartask=Task.Run(() =>searchEngine.Run());
116
-
varresult=task.Result;
117
+
GeneticSearchResultresult=task.Result;
118
+
119
+
searchEngine.Dispose();
117
120
```
118
121
119
122
## Events
@@ -178,7 +181,7 @@ var result = searchEngine.Run();
178
181
```
179
182
180
183
### IPopulationRenwalManagers
181
-
[PopulationRenwalManagers](/GeneticAlgorithm/Interfaces/IPopulationRenwalManager.cs) will tell the engine to renew a certain percentage of the population if some condition is met.
184
+
[PopulationRenwalManagers](/GeneticAlgorithm/Interfaces/IPopulationRenwalManager.cs) will tell the engine to renew a certain percentage of the population if some condition is met. This can fix premature convergence.
182
185
You can create your own managers by implementing the IPopulationRenwalManager interface, or use one of the existing managers.
183
186
Note that there is no limit to the number of PopulationRenwalManagers you can add to your search engine.
184
187
@@ -273,7 +276,7 @@ VectorChromosome expects an [IMutationManager<T>](#mutationmanagers) and [IEvalu
@@ -370,4 +373,4 @@ var result = searchEngine.Run();
370
373
### Tutorial
371
374
372
375
You can find a tutorial on using an environment [here](https://github.com/ZviRosenfeld/GeneticAlgorithmEngine/wiki/Using-an-Environment).
373
-
The tutorial's full source code (alone with a poorly designed GUI) is located [here](/EnvironmentGui).
376
+
The tutorial's full source code (alongside a poorly designed GUI) is located [here](/EnvironmentGui).
0 commit comments