|
86 | 86 | <li class="toctree-l1 current"><a class="current reference internal" href="#">Tutorials</a><ul> |
87 | 87 | <li class="toctree-l2"><a class="reference internal" href="#implement-your-own-problem">Implement your own problem</a></li> |
88 | 88 | <li class="toctree-l2"><a class="reference internal" href="#implement-your-own-algorithm">Implement your own algorithm</a></li> |
| 89 | +<li class="toctree-l2"><a class="reference internal" href="#manage-the-reproducibility-of-results">Manage the reproducibility of results</a></li> |
89 | 90 | <li class="toctree-l2"><a class="reference internal" href="#save-data-with-the-framework">Save data with the framework</a></li> |
90 | 91 | </ul> |
91 | 92 | </li> |
@@ -240,6 +241,28 @@ <h2>Implement your own algorithm<a class="headerlink" href="#implement-your-own- |
240 | 241 | <p>For example with the implementation of MOEA/D-DE <a class="bibtex reference internal" href="references.html#moead-de" id="id1">[LZ09]</a> in the class <code class="xref py py-class docutils literal notranslate"><span class="pre">moead_framework.algorithm.combinatorial.moead_delta_nr</span></code> that extends <strong>Moead</strong> to rewrite the |
241 | 242 | function update_solutions() and add two new parameters.</p> |
242 | 243 | </div> |
| 244 | +<div class="section" id="manage-the-reproducibility-of-results"> |
| 245 | +<h2>Manage the reproducibility of results<a class="headerlink" href="#manage-the-reproducibility-of-results" title="Permalink to this headline">¶</a></h2> |
| 246 | +<p>Reproducibility of results is a major principle for scientific research. |
| 247 | +The feature used here is not specific to the framework but |
| 248 | +can be used for every python project that uses the random and numpy modules.</p> |
| 249 | +<p>Because the framework uses the random and numpy modules, you can be sure |
| 250 | +to have the same results by running the same script several times if you |
| 251 | +add the following instructions before initializing problems or algorithms:</p> |
| 252 | +<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">random</span> |
| 253 | +<span class="kn">import</span> <span class="nn">numpy</span> |
| 254 | + |
| 255 | +<span class="n">seed</span> <span class="o">=</span> <span class="mi">0</span> |
| 256 | +<span class="n">random</span><span class="o">.</span><span class="n">seed</span><span class="p">(</span><span class="n">seed</span><span class="p">)</span> |
| 257 | +<span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">seed</span><span class="p">(</span><span class="n">seed</span><span class="p">)</span> |
| 258 | +</pre></div> |
| 259 | +</div> |
| 260 | +<p>You can find more information with the following links:</p> |
| 261 | +<ul class="simple"> |
| 262 | +<li><p><a class="reference external" href="https://docs.python.org/3/library/random.html">https://docs.python.org/3/library/random.html</a></p></li> |
| 263 | +<li><p><a class="reference external" href="https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html">https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html</a></p></li> |
| 264 | +</ul> |
| 265 | +</div> |
243 | 266 | <div class="section" id="save-data-with-the-framework"> |
244 | 267 | <h2>Save data with the framework<a class="headerlink" href="#save-data-with-the-framework" title="Permalink to this headline">¶</a></h2> |
245 | 268 | <p>You can easily save a set of solutions by using the function <code class="code docutils literal notranslate"><span class="pre">save_population("population.txt",</span> <span class="pre">population)</span></code>. |
|
0 commit comments