<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r66710297">src/mlpack/methods/ne/population.hpp</a>:</p>
<pre style='color:#555'>> + // Destructor.
> + ~Population() {}
> +
> + // Set/get best fitness.
> + double& BestFitness() { return aBestFitness; }
> +
> + // Set best fitness to be the minimum of all genomes' fitness.
> + void SetBestFitness() {
> + if (aGenomes.size() == 0)
> + return;
> +
> + aBestFitness = aGenomes[0].Fitness();
> + for (size_t i=0; i<aGenomes.size(); ++i) {
> + if (aGenomes[i].Fitness() < bestFitness) {
> + aBestFitness = aGenomes[i].Fitness();
> + }
</pre>
<p>Yeah, I have this idea in my mind. Actually I think we can add a SortByFitness() function to sort the genomes in population, so that we can get k best genomes easily.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686/files/65f093daf32f6cb353cd6b9304bab88a5e096fdc#r66710297">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFFFLotv9Ua49DT8STsKh9pnuMk_Dks5qKwfvgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFITo73i9jwK7Gy6qXG_1JB-INbuSks5qKwfvgaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686/files/65f093daf32f6cb353cd6b9304bab88a5e096fdc#r66710297"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>