<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r71068967">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>&gt; +          return;
&gt; +        }
&gt; +      }
&gt; +    }
&gt; +
&gt; +    Species newSpecies = Species();
&gt; +    newSpecies.AddGenome(genome);
&gt; +    newSpecies.StaleAge(0);
&gt; +    population.AddSpecies(newSpecies);
&gt; +  }
&gt; +
&gt; +  // Remove stale species.
&gt; +  void RemoveStaleSpecies(Population&amp; population) {
&gt; +    for (ssize_t i=0; i&lt;population.aSpecies.size(); ++i) {
&gt; +      if (population.aSpecies[i].StaleAge() &gt; aStaleAgeThreshold) {
&gt; +        population.RemoveSpecies(i);
</pre>
<div class="email-fragment">Good point! thanks, I revised it.

2016-07-16 10:37 GMT-06:00 Marcus Edel &lt;notifications@github.com&gt;:</div>
<span class="email-hidden-toggle"><a href="#">…</a></span><div class="email-hidden-reply" style="display:none">
<div class="email-quoted-reply"> In src/mlpack/methods/ne/neat.hpp
 &lt;<a href="https://github.com/mlpack/mlpack/pull/686#discussion_r71068544" class="issue-link js-issue-link" data-url="https://github.com/mlpack/mlpack/issues/686" data-id="158975273" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#686 (comment)</a>&gt;:

 &gt; +          return;
 &gt; +        }
 &gt; +      }
 &gt; +    }
 &gt; +
 &gt; +    Species newSpecies = Species();
 &gt; +    newSpecies.AddGenome(genome);
 &gt; +    newSpecies.StaleAge(0);
 &gt; +    population.AddSpecies(newSpecies);
 &gt; +  }
 &gt; +
 &gt; +  // Remove stale species.
 &gt; +  void RemoveStaleSpecies(Population&amp; population) {
 &gt; +    for (ssize_t i=0; i&lt;population.aSpecies.size(); ++i) {
 &gt; +      if (population.aSpecies[i].StaleAge() &gt; aStaleAgeThreshold) {
 &gt; +        population.RemoveSpecies(i);

 This function could cause an error, because we can't increase i if we
 remove a species:

   void RemoveStaleSpecies(Population&amp; population)
   {
     for (std::vector&lt;Species&gt;::iterator it = population.aSpecies.begin();
          it != population.aSpecies.end();  /*it++*/)
     {
       if(it-&gt;StaleAge() &gt; aStaleAgeThreshold)
       {
         it = population.aSpecies.erase(it);
       }
       else
       {
         ++it;
       }
     }
   }

 —
 You are receiving this because you commented.
 Reply to this email directly, view it on GitHub
 &lt;<a href="https://github.com/mlpack/mlpack/pull/686/files/fc982b9406838eb9697000481e816165702e8ba9#r71068544">https://github.com/mlpack/mlpack/pull/686/files/fc982b9406838eb9697000481e816165702e8ba9#r71068544</a>&gt;,
 or mute the thread
 &lt;<a href="https://github.com/notifications/unsubscribe-auth/AD9tIQHO4X-7mxkbwLr5WVcK7vE870Wqks5qWQjdgaJpZM4IwJa6">https://github.com/notifications/unsubscribe-auth/AD9tIQHO4X-7mxkbwLr5WVcK7vE870Wqks5qWQjdgaJpZM4IwJa6</a>&gt;
 .
</div>
<div class="email-fragment"></div>
</div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<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/fc982b9406838eb9697000481e816165702e8ba9#r71068967">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFOcj-v3OilXDqb2tf7xDUujn1EVEks5qWRBWgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDcNylH0EqfYkULqEahjX5OiodDwks5qWRBWgaJpZM4IwJa6.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/fc982b9406838eb9697000481e816165702e8ba9#r71068967"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>