Parcourir la source

start using multi objective algorithm

Jérôme BUISINE il y a 4 ans
Parent
commit
4cd85b35ba
44 fichiers modifiés avec 581 ajouts et 2461 suppressions
  1. BIN
      docs/build/doctrees/environment.pickle
  2. BIN
      docs/build/doctrees/examples.doctree
  3. BIN
      docs/build/doctrees/macop.doctree
  4. BIN
      docs/build/doctrees/macop/macop.algorithms.Algorithm.doctree
  5. BIN
      docs/build/doctrees/macop/macop.algorithms.IteratedLocalSearch.doctree
  6. BIN
      docs/build/doctrees/macop/macop.algorithms.LocalSearch.doctree
  7. 1 4
      docs/build/html/_modules/index.html
  8. 0 456
      docs/build/html/_modules/macop/algorithms/Algorithm.html
  9. 0 274
      docs/build/html/_modules/macop/algorithms/IteratedLocalSearch.html
  10. 0 262
      docs/build/html/_modules/macop/algorithms/LocalSearch.html
  11. 19 14
      docs/build/html/_sources/examples.rst.txt
  12. 2 2
      docs/build/html/_sources/macop.rst.txt
  13. 0 22
      docs/build/html/_sources/macop/macop.algorithms.Algorithm.rst.txt
  14. 0 22
      docs/build/html/_sources/macop/macop.algorithms.IteratedLocalSearch.rst.txt
  15. 0 22
      docs/build/html/_sources/macop/macop.algorithms.LocalSearch.rst.txt
  16. 22 18
      docs/build/html/examples.html
  17. 7 145
      docs/build/html/genindex.html
  18. 9 14
      docs/build/html/macop.html
  19. 0 448
      docs/build/html/macop/macop.algorithms.Algorithm.html
  20. 0 317
      docs/build/html/macop/macop.algorithms.IteratedLocalSearch.html
  21. 0 314
      docs/build/html/macop/macop.algorithms.LocalSearch.html
  22. 2 2
      docs/build/html/macop/macop.checkpoints.BasicCheckpoint.html
  23. BIN
      docs/build/html/objects.inv
  24. 0 15
      docs/build/html/py-modindex.html
  25. 1 1
      docs/build/html/searchindex.js
  26. 19 14
      docs/source/examples.rst
  27. 2 2
      docs/source/macop.rst
  28. 0 22
      docs/source/macop/macop.algorithms.Algorithm.rst
  29. 0 22
      docs/source/macop/macop.algorithms.IteratedLocalSearch.rst
  30. 0 22
      docs/source/macop/macop.algorithms.LocalSearch.rst
  31. 2 2
      knapsackExample.py
  32. 89 0
      knapsackMultiExample.py
  33. 16 16
      macop/algorithms/Algorithm.py
  34. 1 1
      macop/algorithms/IteratedLocalSearch.py
  35. 1 1
      macop/algorithms/LocalSearch.py
  36. 0 0
      macop/algorithms/mono/__init__.py
  37. 176 0
      macop/algorithms/multi/MOEAD.py
  38. 87 0
      macop/algorithms/multi/MOSubProblem.py
  39. 0 0
      macop/algorithms/multi/__init__.py
  40. 3 0
      macop/checkpoints/Checkpoint.py
  41. 101 0
      macop/checkpoints/MultiCheckpoint.py
  42. 5 4
      macop/operators/Operator.py
  43. 7 2
      macop/operators/policies/Policy.py
  44. 9 1
      macop/solutions/Solution.py

BIN
docs/build/doctrees/environment.pickle


BIN
docs/build/doctrees/examples.doctree


BIN
docs/build/doctrees/macop.doctree


BIN
docs/build/doctrees/macop/macop.algorithms.Algorithm.doctree


BIN
docs/build/doctrees/macop/macop.algorithms.IteratedLocalSearch.doctree


BIN
docs/build/doctrees/macop/macop.algorithms.LocalSearch.doctree


+ 1 - 4
docs/build/html/_modules/index.html

@@ -149,10 +149,7 @@
            <div itemprop="articleBody">
             
   <h1>All modules for which code is available</h1>
-<ul><li><a href="macop/algorithms/Algorithm.html">macop.algorithms.Algorithm</a></li>
-<li><a href="macop/algorithms/IteratedLocalSearch.html">macop.algorithms.IteratedLocalSearch</a></li>
-<li><a href="macop/algorithms/LocalSearch.html">macop.algorithms.LocalSearch</a></li>
-<li><a href="macop/checkpoints/BasicCheckpoint.html">macop.checkpoints.BasicCheckpoint</a></li>
+<ul><li><a href="macop/checkpoints/BasicCheckpoint.html">macop.checkpoints.BasicCheckpoint</a></li>
 <li><a href="macop/checkpoints/Checkpoint.html">macop.checkpoints.Checkpoint</a></li>
 <li><a href="macop/evaluators/EvaluatorExample.html">macop.evaluators.EvaluatorExample</a></li>
 <li><a href="macop/operators/Operator.html">macop.operators.Operator</a></li>

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 456
docs/build/html/_modules/macop/algorithms/Algorithm.html


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 274
docs/build/html/_modules/macop/algorithms/IteratedLocalSearch.html


+ 0 - 262
docs/build/html/_modules/macop/algorithms/LocalSearch.html

@@ -1,262 +0,0 @@
-
-
-<!DOCTYPE html>
-<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
-<head>
-  <meta charset="utf-8">
-  
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  
-  <title>macop.algorithms.LocalSearch &mdash; macop v0.1.6 documentation</title>
-  
-
-  
-  
-  
-  
-
-  
-  <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script>
-  
-    
-      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
-        <script type="text/javascript" src="../../../_static/jquery.js"></script>
-        <script type="text/javascript" src="../../../_static/underscore.js"></script>
-        <script type="text/javascript" src="../../../_static/doctools.js"></script>
-        <script type="text/javascript" src="../../../_static/language_data.js"></script>
-    
-    <script type="text/javascript" src="../../../_static/js/theme.js"></script>
-
-    
-
-  
-  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
-  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
-    <link rel="index" title="Index" href="../../../genindex.html" />
-    <link rel="search" title="Search" href="../../../search.html" /> 
-</head>
-
-<body class="wy-body-for-nav">
-
-   
-  <div class="wy-grid-for-nav">
-    
-    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
-      <div class="wy-side-scroll">
-        <div class="wy-side-nav-search" >
-          
-
-          
-            <a href="../../../index.html" class="icon icon-home"> macop
-          
-
-          
-          </a>
-
-          
-            
-            
-              <div class="version">
-                0.1.6
-              </div>
-            
-          
-
-          
-<div role="search">
-  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
-    <input type="text" name="q" placeholder="Search docs" />
-    <input type="hidden" name="check_keywords" value="yes" />
-    <input type="hidden" name="area" value="default" />
-  </form>
-</div>
-
-          
-        </div>
-
-        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
-          
-            
-            
-              
-            
-            
-              <p class="caption"><span class="caption-text">Contents:</span></p>
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="../../../description.html">Description</a></li>
-<li class="toctree-l1"><a class="reference internal" href="../../../macop.html">Documentation</a></li>
-<li class="toctree-l1"><a class="reference internal" href="../../../examples.html">Some examples</a></li>
-<li class="toctree-l1"><a class="reference internal" href="../../../contributing.html">Contributing</a></li>
-</ul>
-
-            
-          
-        </div>
-      </div>
-    </nav>
-
-    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
-      
-      <nav class="wy-nav-top" aria-label="top navigation">
-        
-          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
-          <a href="../../../index.html">macop</a>
-        
-      </nav>
-
-
-      <div class="wy-nav-content">
-        
-        <div class="rst-content">
-        
-          
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<div role="navigation" aria-label="breadcrumbs navigation">
-
-  <ul class="wy-breadcrumbs">
-    
-      <li><a href="../../../index.html">Docs</a> &raquo;</li>
-        
-          <li><a href="../../index.html">Module code</a> &raquo;</li>
-        
-      <li>macop.algorithms.LocalSearch</li>
-    
-    
-      <li class="wy-breadcrumbs-aside">
-        
-      </li>
-    
-  </ul>
-
-  
-  <hr/>
-</div>
-          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
-           <div itemprop="articleBody">
-            
-  <h1>Source code for macop.algorithms.LocalSearch</h1><div class="highlight"><pre>
-<span></span><span class="sd">&quot;&quot;&quot;Local Search algorithm</span>
-<span class="sd">&quot;&quot;&quot;</span>
-
-<span class="c1"># main imports</span>
-<span class="kn">import</span> <span class="nn">logging</span>
-
-<span class="c1"># module imports</span>
-<span class="kn">from</span> <span class="nn">.Algorithm</span> <span class="kn">import</span> <span class="n">Algorithm</span>
-
-
-<div class="viewcode-block" id="LocalSearch"><a class="viewcode-back" href="../../../macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch">[docs]</a><span class="k">class</span> <span class="nc">LocalSearch</span><span class="p">(</span><span class="n">Algorithm</span><span class="p">):</span>
-    <span class="sd">&quot;&quot;&quot;Local Search used as exploitation optimization algorithm</span>
-
-<span class="sd">    Attributes:</span>
-<span class="sd">        initalizer: {function} -- basic function strategy to initialize solution</span>
-<span class="sd">        evaluator: {function} -- basic function in order to obtained fitness (mono or multiple objectives)</span>
-<span class="sd">        operators: {[Operator]} -- list of operator to use when launching algorithm</span>
-<span class="sd">        policy: {Policy} -- Policy class implementation strategy to select operators</span>
-<span class="sd">        validator: {function} -- basic function to check if solution is valid or not under some constraints</span>
-<span class="sd">        maximise: {bool} -- specify kind of optimization problem </span>
-<span class="sd">        currentSolution: {Solution} -- current solution managed for current evaluation</span>
-<span class="sd">        bestSolution: {Solution} -- best solution found so far during running algorithm</span>
-<span class="sd">        checkpoint: {Checkpoint} -- Checkpoint class implementation to keep track of algorithm and restart</span>
-<span class="sd">    &quot;&quot;&quot;</span>
-<div class="viewcode-block" id="LocalSearch.run"><a class="viewcode-back" href="../../../macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.run">[docs]</a>    <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_evaluations</span><span class="p">):</span>
-        <span class="sd">&quot;&quot;&quot;</span>
-<span class="sd">        Run the local search algorithm</span>
-
-<span class="sd">        Args:</span>
-<span class="sd">            _evaluations: {int} -- number of Local search evaluations</span>
-<span class="sd">            </span>
-<span class="sd">        Returns:</span>
-<span class="sd">            {Solution} -- best solution found</span>
-<span class="sd">        &quot;&quot;&quot;</span>
-
-        <span class="c1"># by default use of mother method to initialize variables</span>
-        <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">_evaluations</span><span class="p">)</span>
-
-        <span class="n">solutionSize</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">bestSolution</span><span class="o">.</span><span class="n">size</span>
-
-        <span class="c1"># local search algorithm implementation</span>
-        <span class="k">while</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">stop</span><span class="p">():</span>
-
-            <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">solutionSize</span><span class="p">):</span>
-
-                <span class="c1"># update solution using policy</span>
-                <span class="n">newSolution</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bestSolution</span><span class="p">)</span>
-
-                <span class="c1"># if better solution than currently, replace it</span>
-                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">isBetter</span><span class="p">(</span><span class="n">newSolution</span><span class="p">):</span>
-                    <span class="bp">self</span><span class="o">.</span><span class="n">bestSolution</span> <span class="o">=</span> <span class="n">newSolution</span>
-
-                <span class="c1"># increase number of evaluations</span>
-                <span class="bp">self</span><span class="o">.</span><span class="n">increaseEvaluation</span><span class="p">()</span>
-
-                <span class="bp">self</span><span class="o">.</span><span class="n">progress</span><span class="p">()</span>
-                <span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;---- Current </span><span class="si">%s</span><span class="s2"> - SCORE </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span>
-                             <span class="p">(</span><span class="n">newSolution</span><span class="p">,</span> <span class="n">newSolution</span><span class="o">.</span><span class="n">fitness</span><span class="p">()))</span>
-
-                <span class="c1"># stop algorithm if necessary</span>
-                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">stop</span><span class="p">():</span>
-                    <span class="k">break</span>
-
-        <span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;End of </span><span class="si">%s</span><span class="s2">, best solution found </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span>
-                     <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">bestSolution</span><span class="p">))</span>
-
-        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">bestSolution</span></div></div>
-</pre></div>
-
-           </div>
-           
-          </div>
-          <footer>
-  
-
-  <hr/>
-
-  <div role="contentinfo">
-    <p>
-        &copy; Copyright 2020, Jérôme BUISINE
-
-    </p>
-  </div>
-  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 
-
-</footer>
-
-        </div>
-      </div>
-
-    </section>
-
-  </div>
-  
-
-
-  <script type="text/javascript">
-      jQuery(function () {
-          SphinxRtdTheme.Navigation.enable(true);
-      });
-  </script>
-
-  
-  
-    
-   
-
-</body>
-</html>

+ 19 - 14
docs/build/html/_sources/examples.rst.txt

@@ -4,14 +4,16 @@ Some examples
 1. Mono-objective
 -----------------------
 
-In this tutorial, it will introduce the way of running your algorithm quickly.
-First of all we need to define the kind of solution best represent the problem. In this tutorial, we use the well known knapsack problem using 30 objects.
+In this tutorial, we introduce the way of using `macop` and running your algorithm quickly.
+First of all we need to define the kind of solution which best represent the problem. As example, we use the well known knapsack problem using 30 objects (solution size of 30).
 
 1.1 Problem definition
 ~~~~~~~~~~~~~~~~~~~~~~
 
 Hence, we define our problem :
+
 - value of each component of knapsack
+
 - weight associated to each of these components (objects)
 
 .. code:: python
@@ -26,16 +28,19 @@ Hence, we define our problem :
     """
     random.seed(42)
 
-    elements_score = [ random.randint(1, 20) for _ in range(30) ]
-    elements_weight = [ random.randint(5, 25) for _ in range(30) ]
+    elements_score = [ random.randint(1, 20) for _ in range(30) ] # value of each object
+    elements_weight = [ random.randint(5, 25) for _ in range(30) ] # weight of each object
 
 We can now define the solution representation. In knapsack problem we want to fill our knapsack in an optimization way selecting or not each component (object).
 The best way to represent this problem is to use the `BinarySolution` from `macop` which stores solution as a binary array.
 
-Using the solution representation, we need to define multiple things to fit our algorithm :
-- 1. function which validates or not a solution (based on constraints)
-- 2. function which evaluates the solution (in order to obtain fitness)
-- 3. initialization solution function
+Using the solution representation, we need to define multiple elements to fit our algorithm :
+
+- function which validates or not a solution (based on constraints)
+
+- function which evaluates the solution (in order to obtain fitness)
+
+- initialization solution function
 
 .. code:: python
     
@@ -50,8 +55,8 @@ Using the solution representation, we need to define multiple things to fit our
     """
     random.seed(42)
 
-    elements_score = [ random.randint(1, 20) for _ in range(30) ]
-    elements_weight = [ random.randint(2, 5) for _ in range(30) ]
+    elements_score = [ random.randint(1, 20) for _ in range(30) ] # value of each object
+    elements_weight = [ random.randint(5, 25) for _ in range(30) ] # weight of each object
 
     # 1. validator function (we accept only bag with maximum weight 80kg)
     def validator(_solution):
@@ -183,7 +188,7 @@ We can now instanciate our algorithm. We use the Iterated Local Search in this e
 
     import logging
 
-    from macop.algorithms.IteratedLocalSearch import IteratedLocalSearch as ILS
+    from macop.algorithms.mono.IteratedLocalSearch import IteratedLocalSearch as ILS
 
     """
     Problem definition
@@ -217,7 +222,7 @@ We need to specify the use of checkpoint if we prefer to restart from.
     
     import logging
 
-    from macop.algorithms.IteratedLocalSearch import IteratedLocalSearch as ILS
+    from macop.algorithms.mono.IteratedLocalSearch import IteratedLocalSearch as ILS
     from macop.checkpoints.BasicCheckpoint import BasicCheckpoint
 
     """
@@ -249,7 +254,7 @@ In this way, now we can run and obtained the best solution found in `n` evaluati
     bestSol = algo.run(10000)
     print('Solution score is {}'.format(evaluator(bestSol)))
 
-2. Multi-objective example
---------------------------
+2. Multi-objective
+-------------------
 
 Available soon...

+ 2 - 2
docs/build/html/_sources/macop.rst.txt

@@ -11,8 +11,8 @@ macop.algorithms
    :toctree: macop
    
    macop.algorithms.Algorithm
-   macop.algorithms.IteratedLocalSearch
-   macop.algorithms.LocalSearch
+   macop.algorithms.mono.IteratedLocalSearch
+   macop.algorithms.mono.LocalSearch
 
 macop.checkpoints
 -------------------

+ 0 - 22
docs/build/html/_sources/macop/macop.algorithms.Algorithm.rst.txt

@@ -1,22 +0,0 @@
-macop.algorithms.Algorithm
-==========================
-
-.. automodule:: macop.algorithms.Algorithm
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      Algorithm
-   
-   
-
-   
-   
-   

+ 0 - 22
docs/build/html/_sources/macop/macop.algorithms.IteratedLocalSearch.rst.txt

@@ -1,22 +0,0 @@
-macop.algorithms.IteratedLocalSearch
-====================================
-
-.. automodule:: macop.algorithms.IteratedLocalSearch
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      IteratedLocalSearch
-   
-   
-
-   
-   
-   

+ 0 - 22
docs/build/html/_sources/macop/macop.algorithms.LocalSearch.rst.txt

@@ -1,22 +0,0 @@
-macop.algorithms.LocalSearch
-============================
-
-.. automodule:: macop.algorithms.LocalSearch
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      LocalSearch
-   
-   
-
-   
-   
-   

Fichier diff supprimé car celui-ci est trop grand
+ 22 - 18
docs/build/html/examples.html


+ 7 - 145
docs/build/html/genindex.html

@@ -165,7 +165,6 @@
  | <a href="#D"><strong>D</strong></a>
  | <a href="#E"><strong>E</strong></a>
  | <a href="#F"><strong>F</strong></a>
- | <a href="#G"><strong>G</strong></a>
  | <a href="#I"><strong>I</strong></a>
  | <a href="#K"><strong>K</strong></a>
  | <a href="#L"><strong>L</strong></a>
@@ -175,22 +174,17 @@
  | <a href="#R"><strong>R</strong></a>
  | <a href="#S"><strong>S</strong></a>
  | <a href="#U"><strong>U</strong></a>
- | <a href="#V"><strong>V</strong></a>
  
 </div>
 <h2 id="A">A</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.addCheckpoint">addCheckpoint() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
       <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#macop.checkpoints.BasicCheckpoint.BasicCheckpoint.algo">algo (macop.checkpoints.BasicCheckpoint.BasicCheckpoint attribute)</a>
 
       <ul>
         <li><a href="macop/macop.checkpoints.Checkpoint.html#macop.checkpoints.Checkpoint.Checkpoint.algo">(macop.checkpoints.Checkpoint.Checkpoint attribute)</a>
 </li>
       </ul></li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm">Algorithm (class in macop.algorithms.Algorithm)</a>
-</li>
       <li><a href="macop/macop.operators.crossovers.Crossover.html#macop.operators.crossovers.Crossover.Crossover.apply">apply() (macop.operators.crossovers.Crossover.Crossover method)</a>
 
       <ul>
@@ -219,14 +213,6 @@
   <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#macop.checkpoints.BasicCheckpoint.BasicCheckpoint">BasicCheckpoint (class in macop.checkpoints.BasicCheckpoint)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.bestSolution">bestSolution (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.bestSolution">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.bestSolution">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="macop/macop.solutions.BinarySolution.html#macop.solutions.BinarySolution.BinarySolution">BinarySolution (class in macop.solutions.BinarySolution)</a>
@@ -241,28 +227,12 @@
 </li>
       <li><a href="macop/macop.checkpoints.Checkpoint.html#macop.checkpoints.Checkpoint.Checkpoint">Checkpoint (class in macop.checkpoints.Checkpoint)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.checkpoint">checkpoint (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.checkpoint">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.checkpoint">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="macop/macop.solutions.CombinatoryIntegerSolution.html#macop.solutions.CombinatoryIntegerSolution.CombinatoryIntegerSolution">CombinatoryIntegerSolution (class in macop.solutions.CombinatoryIntegerSolution)</a>
 </li>
       <li><a href="macop/macop.operators.crossovers.Crossover.html#macop.operators.crossovers.Crossover.Crossover">Crossover (class in macop.operators.crossovers.Crossover)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.currentSolution">currentSolution (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.currentSolution">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.currentSolution">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
   </ul></td>
 </tr></table>
 
@@ -283,22 +253,10 @@
 <h2 id="E">E</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.end">end() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.evaluate">evaluate() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.evaluator">evaluator (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.evaluator">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.evaluator">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
+      <li><a href="macop/macop.evaluators.EvaluatorExample.html#macop.evaluators.EvaluatorExample.evaluatorExample">evaluatorExample() (in module macop.evaluators.EvaluatorExample)</a>
 </li>
-      </ul></li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.evaluators.EvaluatorExample.html#macop.evaluators.EvaluatorExample.evaluatorExample">evaluatorExample() (in module macop.evaluators.EvaluatorExample)</a>
-</li>
       <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#macop.checkpoints.BasicCheckpoint.BasicCheckpoint.every">every (macop.checkpoints.BasicCheckpoint.BasicCheckpoint attribute)</a>
 
       <ul>
@@ -320,40 +278,10 @@
   </ul></td>
 </tr></table>
 
-<h2 id="G">G</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.getGlobalEvaluation">getGlobalEvaluation() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.getGlobalMaxEvaluation">getGlobalMaxEvaluation() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-  </ul></td>
-</tr></table>
-
 <h2 id="I">I</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.increaseEvaluation">increaseEvaluation() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.initalizer">initalizer (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.initalizer">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.initalizer">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.initRun">initRun() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
       <li><a href="macop/macop.solutions.IntegerSolution.html#macop.solutions.IntegerSolution.IntegerSolution">IntegerSolution (class in macop.solutions.IntegerSolution)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.isBetter">isBetter() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-      <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch">IteratedLocalSearch (class in macop.algorithms.IteratedLocalSearch)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -392,21 +320,11 @@
 </li>
       </ul></li>
   </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch">LocalSearch (class in macop.algorithms.LocalSearch)</a>
-</li>
-  </ul></td>
 </tr></table>
 
 <h2 id="M">M</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#module-macop.algorithms.Algorithm">macop.algorithms.Algorithm (module)</a>
-</li>
-      <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#module-macop.algorithms.IteratedLocalSearch">macop.algorithms.IteratedLocalSearch (module)</a>
-</li>
-      <li><a href="macop/macop.algorithms.LocalSearch.html#module-macop.algorithms.LocalSearch">macop.algorithms.LocalSearch (module)</a>
-</li>
       <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#module-macop.checkpoints.BasicCheckpoint">macop.checkpoints.BasicCheckpoint (module)</a>
 </li>
       <li><a href="macop/macop.checkpoints.Checkpoint.html#module-macop.checkpoints.Checkpoint">macop.checkpoints.Checkpoint (module)</a>
@@ -443,14 +361,6 @@
 </li>
       <li><a href="macop/macop.solutions.Solution.html#module-macop.solutions.Solution">macop.solutions.Solution (module)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.maximise">maximise (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.maximise">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.maximise">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
       <li><a href="macop/macop.operators.mutators.Mutation.html#macop.operators.mutators.Mutation.Mutation">Mutation (class in macop.operators.mutators.Mutation)</a>
 </li>
   </ul></td>
@@ -463,15 +373,11 @@
 </li>
       <li><a href="macop/macop.operators.Operator.html#macop.operators.Operator.Operator">Operator (class in macop.operators.Operator)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.operators">operators (macop.algorithms.Algorithm.Algorithm attribute)</a>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="macop/macop.operators.policies.Policy.html#macop.operators.policies.Policy.Policy.operators">operators (macop.operators.policies.Policy.Policy attribute)</a>
 
       <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.operators">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.operators">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.operators.policies.Policy.html#macop.operators.policies.Policy.Policy.operators">(macop.operators.policies.Policy.Policy attribute)</a>
-</li>
         <li><a href="macop/macop.operators.policies.RandomPolicy.html#macop.operators.policies.RandomPolicy.RandomPolicy.operators">(macop.operators.policies.RandomPolicy.RandomPolicy attribute)</a>
 </li>
         <li><a href="macop/macop.operators.policies.UCBPolicy.html#macop.operators.policies.UCBPolicy.UCBPolicy.operators">(macop.operators.policies.UCBPolicy.UCBPolicy attribute)</a>
@@ -483,21 +389,7 @@
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.parent">parent (macop.algorithms.Algorithm.Algorithm attribute)</a>
-</li>
       <li><a href="macop/macop.operators.policies.Policy.html#macop.operators.policies.Policy.Policy">Policy (class in macop.operators.policies.Policy)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.policy">policy (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.policy">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.policy">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.progress">progress() (macop.algorithms.Algorithm.Algorithm method)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -514,24 +406,16 @@
 </li>
       </ul></li>
       <li><a href="macop/macop.operators.policies.RandomPolicy.html#macop.operators.policies.RandomPolicy.RandomPolicy">RandomPolicy (class in macop.operators.policies.RandomPolicy)</a>
-</li>
-      <li><a href="macop/macop.operators.crossovers.RandomSplitCrossover.html#macop.operators.crossovers.RandomSplitCrossover.RandomSplitCrossover">RandomSplitCrossover (class in macop.operators.crossovers.RandomSplitCrossover)</a>
-</li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.resume">resume() (macop.algorithms.Algorithm.Algorithm method)</a>
 </li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="macop/macop.operators.crossovers.RandomSplitCrossover.html#macop.operators.crossovers.RandomSplitCrossover.RandomSplitCrossover">RandomSplitCrossover (class in macop.operators.crossovers.RandomSplitCrossover)</a>
+</li>
       <li><a href="macop/macop.operators.policies.UCBPolicy.html#macop.operators.policies.UCBPolicy.UCBPolicy.rewards">rewards (macop.operators.policies.UCBPolicy.UCBPolicy attribute)</a>
 </li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.run">run() (macop.algorithms.Algorithm.Algorithm method)</a>
+      <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#macop.checkpoints.BasicCheckpoint.BasicCheckpoint.run">run() (macop.checkpoints.BasicCheckpoint.BasicCheckpoint method)</a>
 
       <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.run">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch method)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.run">(macop.algorithms.LocalSearch.LocalSearch method)</a>
-</li>
-        <li><a href="macop/macop.checkpoints.BasicCheckpoint.html#macop.checkpoints.BasicCheckpoint.BasicCheckpoint.run">(macop.checkpoints.BasicCheckpoint.BasicCheckpoint method)</a>
-</li>
         <li><a href="macop/macop.checkpoints.Checkpoint.html#macop.checkpoints.Checkpoint.Checkpoint.run">(macop.checkpoints.Checkpoint.Checkpoint method)</a>
 </li>
       </ul></li>
@@ -565,8 +449,6 @@
       </ul></li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.setCheckpoint">setCheckpoint() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
       <li><a href="macop/macop.operators.mutators.SimpleBinaryMutation.html#macop.operators.mutators.SimpleBinaryMutation.SimpleBinaryMutation">SimpleBinaryMutation (class in macop.operators.mutators.SimpleBinaryMutation)</a>
 </li>
       <li><a href="macop/macop.operators.crossovers.SimpleCrossover.html#macop.operators.crossovers.SimpleCrossover.SimpleCrossover">SimpleCrossover (class in macop.operators.crossovers.SimpleCrossover)</a>
@@ -581,8 +463,6 @@
         <li><a href="macop/macop.solutions.IntegerSolution.html#macop.solutions.IntegerSolution.IntegerSolution.size">(macop.solutions.IntegerSolution.IntegerSolution attribute)</a>
 </li>
       </ul></li>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.stop">stop() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
   </ul></td>
 </tr></table>
 
@@ -592,24 +472,6 @@
       <li><a href="macop/macop.operators.policies.UCBPolicy.html#macop.operators.policies.UCBPolicy.UCBPolicy">UCBPolicy (class in macop.operators.policies.UCBPolicy)</a>
 </li>
   </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.update">update() (macop.algorithms.Algorithm.Algorithm method)</a>
-</li>
-  </ul></td>
-</tr></table>
-
-<h2 id="V">V</h2>
-<table style="width: 100%" class="indextable genindextable"><tr>
-  <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="macop/macop.algorithms.Algorithm.html#macop.algorithms.Algorithm.Algorithm.validator">validator (macop.algorithms.Algorithm.Algorithm attribute)</a>
-
-      <ul>
-        <li><a href="macop/macop.algorithms.IteratedLocalSearch.html#macop.algorithms.IteratedLocalSearch.IteratedLocalSearch.validator">(macop.algorithms.IteratedLocalSearch.IteratedLocalSearch attribute)</a>
-</li>
-        <li><a href="macop/macop.algorithms.LocalSearch.html#macop.algorithms.LocalSearch.LocalSearch.validator">(macop.algorithms.LocalSearch.LocalSearch attribute)</a>
-</li>
-      </ul></li>
-  </ul></td>
 </tr></table>
 
 

+ 9 - 14
docs/build/html/macop.html

@@ -35,7 +35,7 @@
   <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="next" title="macop.algorithms.Algorithm" href="macop/macop.algorithms.Algorithm.html" />
+    <link rel="next" title="macop.checkpoints.BasicCheckpoint" href="macop/macop.checkpoints.BasicCheckpoint.html" />
     <link rel="prev" title="Description" href="description.html" /> 
 </head>
 
@@ -89,12 +89,7 @@
 <li class="toctree-l1"><a class="reference internal" href="description.html">Description</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">Documentation</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="#macop">macop</a></li>
-<li class="toctree-l2"><a class="reference internal" href="#macop-algorithms">macop.algorithms</a><ul>
-<li class="toctree-l3"><a class="reference internal" href="macop/macop.algorithms.Algorithm.html">macop.algorithms.Algorithm</a></li>
-<li class="toctree-l3"><a class="reference internal" href="macop/macop.algorithms.IteratedLocalSearch.html">macop.algorithms.IteratedLocalSearch</a></li>
-<li class="toctree-l3"><a class="reference internal" href="macop/macop.algorithms.LocalSearch.html">macop.algorithms.LocalSearch</a></li>
-</ul>
-</li>
+<li class="toctree-l2"><a class="reference internal" href="#macop-algorithms">macop.algorithms</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#macop-checkpoints">macop.checkpoints</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="macop/macop.checkpoints.BasicCheckpoint.html">macop.checkpoints.BasicCheckpoint</a></li>
 <li class="toctree-l3"><a class="reference internal" href="macop/macop.checkpoints.Checkpoint.html">macop.checkpoints.Checkpoint</a></li>
@@ -207,14 +202,14 @@
 <col style="width: 90%" />
 </colgroup>
 <tbody>
-<tr class="row-odd"><td><p><a class="reference internal" href="macop/macop.algorithms.Algorithm.html#module-macop.algorithms.Algorithm" title="macop.algorithms.Algorithm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.Algorithm</span></code></a></p></td>
-<td><p>Abstract Algorithm class used as basic algorithm implementation with some specific initialization</p></td>
+<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.Algorithm</span></code></p></td>
+<td><p></p></td>
 </tr>
-<tr class="row-even"><td><p><a class="reference internal" href="macop/macop.algorithms.IteratedLocalSearch.html#module-macop.algorithms.IteratedLocalSearch" title="macop.algorithms.IteratedLocalSearch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.IteratedLocalSearch</span></code></a></p></td>
-<td><p>Iterated Local Search Algorithm implementation</p></td>
+<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.mono.IteratedLocalSearch</span></code></p></td>
+<td><p></p></td>
 </tr>
-<tr class="row-odd"><td><p><a class="reference internal" href="macop/macop.algorithms.LocalSearch.html#module-macop.algorithms.LocalSearch" title="macop.algorithms.LocalSearch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.LocalSearch</span></code></a></p></td>
-<td><p>Local Search algorithm</p></td>
+<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">macop.algorithms.mono.LocalSearch</span></code></p></td>
+<td><p></p></td>
 </tr>
 </tbody>
 </table>
@@ -324,7 +319,7 @@
   
     <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
       
-        <a href="macop/macop.algorithms.Algorithm.html" class="btn btn-neutral float-right" title="macop.algorithms.Algorithm" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
+        <a href="macop/macop.checkpoints.BasicCheckpoint.html" class="btn btn-neutral float-right" title="macop.checkpoints.BasicCheckpoint" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
       
       
         <a href="description.html" class="btn btn-neutral float-left" title="Description" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 448
docs/build/html/macop/macop.algorithms.Algorithm.html


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 317
docs/build/html/macop/macop.algorithms.IteratedLocalSearch.html


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 314
docs/build/html/macop/macop.algorithms.LocalSearch.html


+ 2 - 2
docs/build/html/macop/macop.checkpoints.BasicCheckpoint.html

@@ -36,7 +36,7 @@
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
     <link rel="next" title="macop.checkpoints.Checkpoint" href="macop.checkpoints.Checkpoint.html" />
-    <link rel="prev" title="macop.algorithms.LocalSearch" href="macop.algorithms.LocalSearch.html" /> 
+    <link rel="prev" title="Documentation" href="../macop.html" /> 
 </head>
 
 <body class="wy-body-for-nav">
@@ -234,7 +234,7 @@
         <a href="macop.checkpoints.Checkpoint.html" class="btn btn-neutral float-right" title="macop.checkpoints.Checkpoint" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
       
       
-        <a href="macop.algorithms.LocalSearch.html" class="btn btn-neutral float-left" title="macop.algorithms.LocalSearch" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
+        <a href="../macop.html" class="btn btn-neutral float-left" title="Documentation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
       
     </div>
   

BIN
docs/build/html/objects.inv


+ 0 - 15
docs/build/html/py-modindex.html

@@ -168,21 +168,6 @@
        <td>
        <code class="xref">macop</code></td><td>
        <em></em></td></tr>
-     <tr class="cg-1">
-       <td></td>
-       <td>&#160;&#160;&#160;
-       <a href="macop/macop.algorithms.Algorithm.html#module-macop.algorithms.Algorithm"><code class="xref">macop.algorithms.Algorithm</code></a></td><td>
-       <em></em></td></tr>
-     <tr class="cg-1">
-       <td></td>
-       <td>&#160;&#160;&#160;
-       <a href="macop/macop.algorithms.IteratedLocalSearch.html#module-macop.algorithms.IteratedLocalSearch"><code class="xref">macop.algorithms.IteratedLocalSearch</code></a></td><td>
-       <em></em></td></tr>
-     <tr class="cg-1">
-       <td></td>
-       <td>&#160;&#160;&#160;
-       <a href="macop/macop.algorithms.LocalSearch.html#module-macop.algorithms.LocalSearch"><code class="xref">macop.algorithms.LocalSearch</code></a></td><td>
-       <em></em></td></tr>
      <tr class="cg-1">
        <td></td>
        <td>&#160;&#160;&#160;

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
docs/build/html/searchindex.js


+ 19 - 14
docs/source/examples.rst

@@ -4,14 +4,16 @@ Some examples
 1. Mono-objective
 -----------------------
 
-In this tutorial, it will introduce the way of running your algorithm quickly.
-First of all we need to define the kind of solution best represent the problem. In this tutorial, we use the well known knapsack problem using 30 objects.
+In this tutorial, we introduce the way of using `macop` and running your algorithm quickly.
+First of all we need to define the kind of solution which best represent the problem. As example, we use the well known knapsack problem using 30 objects (solution size of 30).
 
 1.1 Problem definition
 ~~~~~~~~~~~~~~~~~~~~~~
 
 Hence, we define our problem :
+
 - value of each component of knapsack
+
 - weight associated to each of these components (objects)
 
 .. code:: python
@@ -26,16 +28,19 @@ Hence, we define our problem :
     """
     random.seed(42)
 
-    elements_score = [ random.randint(1, 20) for _ in range(30) ]
-    elements_weight = [ random.randint(5, 25) for _ in range(30) ]
+    elements_score = [ random.randint(1, 20) for _ in range(30) ] # value of each object
+    elements_weight = [ random.randint(5, 25) for _ in range(30) ] # weight of each object
 
 We can now define the solution representation. In knapsack problem we want to fill our knapsack in an optimization way selecting or not each component (object).
 The best way to represent this problem is to use the `BinarySolution` from `macop` which stores solution as a binary array.
 
-Using the solution representation, we need to define multiple things to fit our algorithm :
-- 1. function which validates or not a solution (based on constraints)
-- 2. function which evaluates the solution (in order to obtain fitness)
-- 3. initialization solution function
+Using the solution representation, we need to define multiple elements to fit our algorithm :
+
+- function which validates or not a solution (based on constraints)
+
+- function which evaluates the solution (in order to obtain fitness)
+
+- initialization solution function
 
 .. code:: python
     
@@ -50,8 +55,8 @@ Using the solution representation, we need to define multiple things to fit our
     """
     random.seed(42)
 
-    elements_score = [ random.randint(1, 20) for _ in range(30) ]
-    elements_weight = [ random.randint(2, 5) for _ in range(30) ]
+    elements_score = [ random.randint(1, 20) for _ in range(30) ] # value of each object
+    elements_weight = [ random.randint(5, 25) for _ in range(30) ] # weight of each object
 
     # 1. validator function (we accept only bag with maximum weight 80kg)
     def validator(_solution):
@@ -183,7 +188,7 @@ We can now instanciate our algorithm. We use the Iterated Local Search in this e
 
     import logging
 
-    from macop.algorithms.IteratedLocalSearch import IteratedLocalSearch as ILS
+    from macop.algorithms.mono.IteratedLocalSearch import IteratedLocalSearch as ILS
 
     """
     Problem definition
@@ -217,7 +222,7 @@ We need to specify the use of checkpoint if we prefer to restart from.
     
     import logging
 
-    from macop.algorithms.IteratedLocalSearch import IteratedLocalSearch as ILS
+    from macop.algorithms.mono.IteratedLocalSearch import IteratedLocalSearch as ILS
     from macop.checkpoints.BasicCheckpoint import BasicCheckpoint
 
     """
@@ -249,7 +254,7 @@ In this way, now we can run and obtained the best solution found in `n` evaluati
     bestSol = algo.run(10000)
     print('Solution score is {}'.format(evaluator(bestSol)))
 
-2. Multi-objective example
---------------------------
+2. Multi-objective
+-------------------
 
 Available soon...

+ 2 - 2
docs/source/macop.rst

@@ -11,8 +11,8 @@ macop.algorithms
    :toctree: macop
    
    macop.algorithms.Algorithm
-   macop.algorithms.IteratedLocalSearch
-   macop.algorithms.LocalSearch
+   macop.algorithms.mono.IteratedLocalSearch
+   macop.algorithms.mono.LocalSearch
 
 macop.checkpoints
 -------------------

+ 0 - 22
docs/source/macop/macop.algorithms.Algorithm.rst

@@ -1,22 +0,0 @@
-macop.algorithms.Algorithm
-==========================
-
-.. automodule:: macop.algorithms.Algorithm
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      Algorithm
-   
-   
-
-   
-   
-   

+ 0 - 22
docs/source/macop/macop.algorithms.IteratedLocalSearch.rst

@@ -1,22 +0,0 @@
-macop.algorithms.IteratedLocalSearch
-====================================
-
-.. automodule:: macop.algorithms.IteratedLocalSearch
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      IteratedLocalSearch
-   
-   
-
-   
-   
-   

+ 0 - 22
docs/source/macop/macop.algorithms.LocalSearch.rst

@@ -1,22 +0,0 @@
-macop.algorithms.LocalSearch
-============================
-
-.. automodule:: macop.algorithms.LocalSearch
-
-   
-   
-   
-
-   
-   
-   .. rubric:: Classes
-
-   .. autosummary::
-   
-      LocalSearch
-   
-   
-
-   
-   
-   

+ 2 - 2
knapsackExample.py

@@ -4,7 +4,6 @@ import os
 import random
 
 # module imports
-from macop.algorithms.IteratedLocalSearch import IteratedLocalSearch as ILS
 from macop.solutions.BinarySolution import BinarySolution
 from macop.evaluators.EvaluatorExample import evaluatorExample
 
@@ -16,6 +15,7 @@ from macop.operators.crossovers.RandomSplitCrossover import RandomSplitCrossover
 from macop.operators.policies.RandomPolicy import RandomPolicy
 from macop.operators.policies.UCBPolicy import UCBPolicy
 
+from macop.algorithms.mono.IteratedLocalSearch import IteratedLocalSearch as ILS
 from macop.checkpoints.BasicCheckpoint import BasicCheckpoint
 
 if not os.path.exists('data'):
@@ -67,7 +67,7 @@ def main():
     algo = ILS(init, evaluator, operators, policy, validator, _maximise=True)
     algo.addCheckpoint(_class=BasicCheckpoint, _every=5, _filepath=filepath)
 
-    bestSol = algo.run(10000)
+    bestSol = algo.run(1000)
 
     print('Solution score is {}'.format(evaluator(bestSol)))
     print('Solution weigth is {}'.format(knapsackWeight(bestSol)))

+ 89 - 0
knapsackMultiExample.py

@@ -0,0 +1,89 @@
+# main imports
+import logging
+import os
+import random
+
+# module imports
+from macop.solutions.BinarySolution import BinarySolution
+from macop.evaluators.EvaluatorExample import evaluatorExample
+
+from macop.operators.mutators.SimpleMutation import SimpleMutation
+from macop.operators.mutators.SimpleBinaryMutation import SimpleBinaryMutation
+from macop.operators.crossovers.SimpleCrossover import SimpleCrossover
+from macop.operators.crossovers.RandomSplitCrossover import RandomSplitCrossover
+
+from macop.operators.policies.RandomPolicy import RandomPolicy
+from macop.operators.policies.UCBPolicy import UCBPolicy
+
+from macop.algorithms.multi.MOEAD import MOEAD
+from macop.checkpoints.BasicCheckpoint import BasicCheckpoint
+
+if not os.path.exists('data'):
+    os.makedirs('data')
+
+# logging configuration
+logging.basicConfig(format='%(asctime)s %(message)s', filename='data/exampleMOEAD.log', level=logging.DEBUG)
+
+random.seed(42)
+
+elements_score1 = [ random.randint(1, 20) for _ in range(30) ]
+elements_score2 = [ random.randint(1, 20) for _ in range(30) ]
+elements_weight = [ random.randint(2, 5) for _ in range(30) ]
+
+def knapsackWeight(_solution):
+
+    weight_sum = 0
+    for index, elem in enumerate(_solution.data):
+        weight_sum += elements_weight[index] * elem
+
+    return weight_sum
+
+# default validator
+def validator(_solution):
+
+    if knapsackWeight(_solution) <= 80:
+        return True
+    else:
+        False
+
+# define init random solution
+def init():
+    return BinarySolution([], 30).random(validator)
+
+def evaluator1(_solution):
+
+    fitness = 0
+    for index, elem in enumerate(_solution.data):
+        fitness += (elements_score1[index] * elem)
+
+    return fitness
+
+def evaluator2(_solution):
+
+    fitness = 0
+    for index, elem in enumerate(_solution.data):
+        fitness += (elements_score2[index] * elem)
+
+    return fitness
+
+
+filepath = "data/checkpointsMOEAD.csv"
+
+def main():
+
+    operators = [SimpleBinaryMutation(), SimpleMutation(), SimpleCrossover(), RandomSplitCrossover()]
+    policy = UCBPolicy(operators)
+
+    # pass list of evaluators
+    algo = MOEAD(20, 5, init, [evaluator1, evaluator2], operators, policy, validator, _maximise=True)
+    algo.addCheckpoint(_class=BasicCheckpoint, _every=5, _filepath=filepath)
+
+    bestSol = algo.run(1000)
+    bestSol = algo.run(1000)
+
+    print('Solution score1 is {}'.format(evaluator1(bestSol)))
+    print('Solution score2 is {}'.format(evaluator2(bestSol)))
+    print('Solution weigth is {}'.format(knapsackWeight(bestSol)))
+
+if __name__ == "__main__":
+    main()

+ 16 - 16
macop/algorithms/Algorithm.py

@@ -39,11 +39,23 @@ class Algorithm():
         self.checkpoint = None
         self.bestSolution = None
 
+        # by default
+        self.numberOfEvaluations = 0
+        self.maxEvaluations = 0
+
         # other parameters
         self.parent = _parent  # parent algorithm if it's sub algorithm
+
         #self.maxEvaluations = 0 # by default
         self.maximise = _maximise
 
+        # track reference of algo into operator (keep an eye into best solution)
+        for operator in self.operators:
+            operator.setAlgo(self)
+
+        # also track reference for policy
+        self.policy.setAlgo(self)
+
         self.initRun()
 
     def addCheckpoint(self, _class, _every, _filepath):
@@ -83,25 +95,14 @@ class Algorithm():
 
     def initRun(self):
         """
-        Method which initialiazes or re-initializes the whole algorithm context: operators, current solution, best solution (by default current solution)
+        Initialize the current solution and best solution
         """
 
-        # track reference of algo into operator (keep an eye into best solution)
-        for operator in self.operators:
-            operator.setAlgo(self)
-
-        # also track reference for policy
-        self.policy.setAlgo(self)
-
         self.currentSolution = self.initializer()
 
         # evaluate current solution
         self.currentSolution.evaluate(self.evaluator)
 
-        # reinitialize policy
-        # if self.parent is not None:
-        #     self.policy = globals()[type(self.policy).__name__]()
-
         # keep in memory best known solution (current solution)
         self.bestSolution = self.currentSolution
 
@@ -209,9 +210,8 @@ class Algorithm():
         Run the specific algorithm following number of evaluations to find optima
         """
 
-        self.maxEvaluations = _evaluations
-
-        self.initRun()
+        # append number of max evaluation if multiple run called
+        self.maxEvaluations += _evaluations
 
         # check if global evaluation is used or not
         if self.parent is not None and self.getGlobalEvaluation() != 0:
@@ -247,7 +247,7 @@ class Algorithm():
         """Display end message into `run` method
         """
         print(
-            macop_text('({}) Found after {} evaluations => {}'.format(
+            macop_text('({}) Found after {} evaluations \n   - {}'.format(
                 type(self).__name__, self.numberOfEvaluations,
                 self.bestSolution)))
         print(macop_line())

+ 1 - 1
macop/algorithms/IteratedLocalSearch.py

@@ -5,7 +5,7 @@
 import logging
 
 # module imports
-from .Algorithm import Algorithm
+from ..Algorithm import Algorithm
 from .LocalSearch import LocalSearch
 
 

+ 1 - 1
macop/algorithms/LocalSearch.py

@@ -5,7 +5,7 @@
 import logging
 
 # module imports
-from .Algorithm import Algorithm
+from ..Algorithm import Algorithm
 
 
 class LocalSearch(Algorithm):

+ 0 - 0
macop/algorithms/mono/__init__.py


+ 176 - 0
macop/algorithms/multi/MOEAD.py

@@ -0,0 +1,176 @@
+"""Multi-Ojective Evolutionary Algorithm with Scalar Decomposition algorithm
+"""
+
+# main imports
+import logging
+import math
+import numpy as np
+
+# module imports
+from ..Algorithm import Algorithm
+from .MOSubProblem import MOSubProblem
+
+
+class MOEAD(Algorithm):
+    """Multi-Ojective Evolutionary Algorithm with Scalar Decomposition
+
+    Attributes:
+        mu: {int} -- number of sub problems
+        T: {[float]} -- number of neightbors for each sub problem
+        initalizer: {function} -- basic function strategy to initialize solution
+        evaluator: {[function]} -- list of basic function in order to obtained fitness (multiple objectives)
+        operators: {[Operator]} -- list of operator to use when launching algorithm
+        policy: {Policy} -- Policy class implementation strategy to select operators
+        validator: {function} -- basic function to check if solution is valid or not under some constraints
+        maximise: {bool} -- specify kind of optimization problem 
+        currentSolution: {Solution} -- current solution managed for current evaluation
+        bestSolution: {Solution} -- best solution found so far during running algorithm
+        checkpoint: {Checkpoint} -- Checkpoint class implementation to keep track of algorithm and restart
+    """
+
+    def __init__(self,
+                 _mu,
+                 _T,
+                 _initalizer,
+                 _evaluator,
+                 _operators,
+                 _policy,
+                 _validator,
+                 _maximise=True,
+                 _parent=None):
+
+        # redefinition of constructor to well use `initRun` method
+        self.initializer = _initalizer
+        self.evaluator = _evaluator
+        self.operators = _operators
+        self.policy = _policy
+        self.validator = _validator
+        self.checkpoint = None
+        self.bestSolution = None
+
+        # by default
+        self.numberOfEvaluations = 0
+        self.maxEvaluations = 0
+
+        # other parameters
+        self.parent = _parent  # parent algorithm if it's sub algorithm
+
+        #self.maxEvaluations = 0 # by default
+        self.maximise = _maximise
+
+        # track reference of algo into operator (keep an eye into best solution)
+        for operator in self.operators:
+            operator.setAlgo(self)
+
+        # also track reference for policy
+        self.policy.setAlgo(self)
+
+        if _mu < _T:
+            raise ValueError('`mu` cannot be less than `T`')
+        self.mu = _mu
+        self.T = _T
+
+        # initialize neighbors for each sub problem
+        self.setNeighbors()
+
+        weights = []
+        for i in range(self.mu):
+            angle = math.pi / 2 * i / (self.mu - 1)
+            weights.append([math.cos(angle), math.sin(angle)])
+
+        self.subProblems = []
+
+        for i in range(self.mu):
+
+            # compute weight sum from solution
+            sub_evaluator = lambda _solution: sum(list([ eval(_solution) * weights[i][w_i] for w_i, eval in enumerate(_evaluator)]))
+
+            subProblem = MOSubProblem(i, weights[i], _initalizer, sub_evaluator, _operators, _policy, _validator, _maximise, self)
+            self.subProblems.append(subProblem)
+
+        self.population = [ None for n in range(self.mu) ]
+    
+        # no need to initialize using sub problem
+        # self.initRun()
+        
+    def initRun(self):
+        """
+        Method which initialiazes or re-initializes the whole algorithm context specifically for MOEAD
+        """
+
+        self.currentSolution = self.initializer()
+
+        # evaluate current solution
+        self.subProblems[0].run(1)
+
+        # keep in memory best known solution (current solution)
+        self.bestSolution = self.subProblems[0].bestSolution
+
+    def run(self, _evaluations):
+        """
+        Run the local search algorithm
+
+        Args:
+            _evaluations: {int} -- number of Local search evaluations
+            
+        Returns:
+            {Solution} -- best solution found
+        """
+
+        # by default use of mother method to initialize variables
+        super().run(_evaluations)
+
+        # enable checkpoint for MOEAD
+        if self.checkpoint is not None:
+            self.resume()
+
+        # initialize each sub problem
+        for i in range(self.mu):
+            self.subProblems[i].run(1)
+
+            self.population[i] = self.subProblems[i].bestSolution
+
+        # MOEAD algorithm implementation
+        while not self.stop():
+
+            for i in range(self.mu):
+
+                # run 1 iteration into sub problem `i`
+                self.subProblems[i].run(1)
+
+                # stop algorithm if necessary
+                if self.stop():
+                    break
+
+        logging.info("End of %s, best solution found %s" %
+                     (type(self).__name__, self.bestSolution))
+
+        self.end()
+
+        return self.bestSolution
+
+    def setNeighbors(self):
+
+        dmin = dmax = 0
+
+        if self.T % 2 == 1:
+            dmin = - int(self.T / 2)
+            dmax = int(self.T / 2) + 1
+        else:
+            dmin = - int(self.T/2) + 1
+            dmax = + self.T / 2
+        
+        # init neighbord list 
+        self.neighbors = [ [] for n in range(self.mu) ]
+
+        for direction in range(0, -dmin):
+            for i in range(self.T):
+                self.neighbors[direction].append(i)
+        
+        for direction in range(-dmin, self.mu - dmax):
+            for i in range (direction + dmin, direction + dmax):
+                self.neighbors[direction].append(i)
+        
+        for direction in range(self.mu - dmax, self.mu):
+            for i in range(self.mu - self.T, self.mu):
+                self.neighbors[direction].append(i)

+ 87 - 0
macop/algorithms/multi/MOSubProblem.py

@@ -0,0 +1,87 @@
+"""Local Search algorithm
+"""
+
+# main imports
+import logging
+
+# module imports
+from ..Algorithm import Algorithm
+
+
+class MOSubProblem(Algorithm):
+    """Specific MO sub problem used into MOEAD
+
+    Attributes:
+        index: {int} -- sub problem index
+        weights: {[float]} -- sub problems objectives weights
+        initalizer: {function} -- basic function strategy to initialize solution
+        evaluator: {function} -- basic function in order to obtained fitness (mono or multiple objectives)
+        operators: {[Operator]} -- list of operator to use when launching algorithm
+        policy: {Policy} -- Policy class implementation strategy to select operators
+        validator: {function} -- basic function to check if solution is valid or not under some constraints
+        maximise: {bool} -- specify kind of optimization problem 
+        currentSolution: {Solution} -- current solution managed for current evaluation
+        bestSolution: {Solution} -- best solution found so far during running algorithm
+        checkpoint: {Checkpoint} -- Checkpoint class implementation to keep track of algorithm and restart
+    """
+
+    def __init__(self,
+                 _index,
+                 _weights,
+                 _initalizer,
+                 _evaluator,
+                 _operators,
+                 _policy,
+                 _validator,
+                 _maximise=True,
+                 _parent=None):
+
+
+        super().__init__(_initalizer, _evaluator, _operators, _policy, _validator, _maximise, _parent)
+
+        self.index = _index
+        self.weights = _weights
+
+    def run(self, _evaluations):
+        """
+        Run the local search algorithm
+
+        Args:
+            _evaluations: {int} -- number of Local search evaluations
+            
+        Returns:
+            {Solution} -- best solution found
+        """
+
+        # by default use of mother method to initialize variables
+        super().run(_evaluations)
+
+        solutionSize = self.bestSolution.size
+
+        # local search algorithm implementation
+        while not self.stop():
+
+            for _ in range(solutionSize):
+
+                # update solution using policy
+                newSolution = self.update(self.bestSolution)
+
+                # if better solution than currently, replace it
+                if self.isBetter(newSolution):
+                    self.bestSolution = newSolution
+
+                # increase number of evaluations
+                self.increaseEvaluation()
+
+                self.progress()
+                logging.info("---- Current %s - SCORE %s" %
+                             (newSolution, newSolution.fitness()))
+
+                # stop algorithm if necessary
+                if self.stop():
+                    break
+
+        logging.info("End of %s, best solution found %s" %
+                     (type(self).__name__, self.bestSolution))
+
+        return self.bestSolution

+ 0 - 0
macop/algorithms/multi/__init__.py


+ 3 - 0
macop/checkpoints/Checkpoint.py

@@ -3,6 +3,7 @@
 # main imports
 import os
 import logging
+from abc import abstractmethod
 
 
 class Checkpoint():
@@ -25,12 +26,14 @@ class Checkpoint():
         if not os.path.exists(head):
             os.makedirs(head)
 
+    @abstractmethod
     def run(self):
         """
         Check if necessary to do backup based on `every` variable
         """
         pass
 
+    @abstractmethod
     def load(self):
         """
         Load last backup line of solution and set algorithm state at this backup

+ 101 - 0
macop/checkpoints/MultiCheckpoint.py

@@ -0,0 +1,101 @@
+"""Basic Checkpoint class implementation
+"""
+
+# main imports
+import os
+import logging
+import numpy as np
+
+# module imports
+from .Checkpoint import Checkpoint
+from ..utils.color import macop_text, macop_line
+
+
+class BasicCheckpoint(Checkpoint):
+    """
+    BasicCheckpoint is used for loading previous computations and start again after loading checkpoit
+
+    Attributes:
+        algo: {Algorithm} -- main algorithm instance reference
+        every: {int} -- checkpoint frequency used (based on number of evaluations)
+        filepath: {str} -- file path where checkpoints will be saved
+    """
+    def __init__(self, _algo, _every, _filepath):
+        self.algo = _algo
+        self.every = _every
+        self.filepath = _filepath
+
+    def run(self):
+        """
+        Check if necessary to do backup based on `every` variable
+        """
+        # get current best solution
+        solution = self.algo.bestSolution
+
+        currentEvaluation = self.algo.getGlobalEvaluation()
+
+        # backup if necessary
+        if currentEvaluation % self.every == 0:
+
+            logging.info("Checkpoint is done into " + self.filepath)
+
+            solutionData = ""
+            solutionSize = len(solution.data)
+
+            for index, val in enumerate(solution.data):
+                solutionData += str(val)
+
+                if index < solutionSize - 1:
+                    solutionData += ' '
+
+            line = str(currentEvaluation) + ';' + solutionData + ';' + str(
+                solution.fitness()) + ';\n'
+
+            # check if file exists
+            if not os.path.exists(self.filepath):
+                with open(self.filepath, 'w') as f:
+                    f.write(line)
+            else:
+                with open(self.filepath, 'a') as f:
+                    f.write(line)
+
+    def load(self):
+        """
+        Load last backup line of solution and set algorithm state (best solution and evaluations) at this backup
+        """
+        if os.path.exists(self.filepath):
+
+            logging.info('Load best solution from last checkpoint')
+            with open(self.filepath) as f:
+
+                # get last line and read data
+                lastline = f.readlines()[-1]
+                data = lastline.split(';')
+
+                # get evaluation  information
+                globalEvaluation = int(data[0])
+
+                if self.algo.parent is not None:
+                    self.algo.parent.numberOfEvaluations = globalEvaluation
+                else:
+                    self.algo.numberOfEvaluations = globalEvaluation
+
+                # get best solution data information
+                solutionData = list(map(int, data[1].split(' ')))
+
+                self.algo.bestSolution.data = np.array(solutionData)
+                self.algo.bestSolution.score = float(data[2])
+
+            print(
+                macop_text('Restart algorithm from evaluation {}.'.format(
+                    self.algo.numberOfEvaluations)))
+
+        else:
+            print(
+                macop_text(
+                    'No backup found... Start running algorithm from evaluation 0.'
+                ))
+            logging.info(
+                "Can't load backup... Backup filepath not valid in Checkpoint")
+
+        print(macop_line())

+ 5 - 4
macop/operators/Operator.py

@@ -2,6 +2,7 @@
 """
 # main imports
 from enum import Enum
+from abc import abstractmethod
 
 
 # enumeration which stores kind of operator
@@ -15,19 +16,19 @@ class KindOperator(Enum):
 class Operator():
     """Abstract Operator class which enables to update solution applying operator (computation)
     """
+
+    @abstractmethod
     def __init__(self):
         pass
 
+    @abstractmethod
     def apply(self, _solution):
         """Apply the current operator transformation
 
         Args:
             _solution: {Solution} -- Solution instance
-
-        Raises:
-            NotImplementedError: if method not implemented into child class
         """
-        raise NotImplementedError
+        pass
 
     def setAlgo(self, _algo):
         """Keep into operator reference of the whole algorithm

+ 7 - 2
macop/operators/policies/Policy.py

@@ -1,6 +1,7 @@
 """Abstract class which is used for applying strategy when selecting and applying operator 
 """
 import logging
+from abc import abstractmethod
 
 
 # define policy to choose `operator` function at current iteration
@@ -13,11 +14,15 @@ class Policy():
     def __init__(self, _operators):
         self.operators = _operators
 
+    @abstractmethod
     def select(self):
         """
-        Select specific operator to solution and returns solution
+        Select specific operator
+
+        Returns:
+            {Operator} -- selected operator
         """
-        raise NotImplementedError
+        pass
 
     def apply(self, _solution):
         """

+ 9 - 1
macop/solutions/Solution.py

@@ -1,6 +1,7 @@
 """Abstract solution class
 """
 
+from abc import abstractmethod
 
 class Solution():
     def __init__(self, _data, _size):
@@ -50,11 +51,18 @@ class Solution():
         """
         return self.score
 
+    @abstractmethod
     def random(self, _validator):
         """
         Initialize solution using random data
+
+        Args:
+            _validator: {function} -- specific function which validates or not a solution
+
+        Returns:
+            {Solution} -- generated solution
         """
-        raise NotImplementedError
+        pass
 
     def __str__(self):
         print("Generic solution with ", self.data)