Skip to content

Commit

Permalink
Deploying to gh-pages from @ ac7b6d2 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Jan 13, 2025
1 parent 5ae554e commit e8d20ee
Show file tree
Hide file tree
Showing 17 changed files with 175 additions and 175 deletions.
242 changes: 121 additions & 121 deletions _static/pygments.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/cpp/algorithms/pso.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ <h1>Particle Swarm Optimization (PSO)<a class="headerlink" href="#particle-swarm
<span id="_CPPv3N5pagmo3psoE"></span><span id="_CPPv2N5pagmo3psoE"></span><span id="pagmo::pso"></span><span class="target" id="classpagmo_1_1pso"></span><span class="k"><span class="pre">class</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">pso</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo3psoE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>Particle Swarm Optimization. </p>
<p><img alt="../../../_images/pso.png" src="../../../_images/pso.png" /></p>
<p>Particle swarm optimization (PSO) is a population based algorithm inspired by the foraging behaviour of swarms. In PSO each point has memory of the position where it achieved the best performance <span class="math notranslate nohighlight">\(\mathbf x^l_i\)</span> (local memory) and of the best decision vector <span class="math notranslate nohighlight">\( \mathbf x^g \)</span> in a certain neighbourhood, and uses this information to update its position using the equations (constriction coefficient): <div class="math notranslate nohighlight">
<p>Particle swarm optimization (PSO) is a population based algorithm inspired by the foraging behaviour of swarms. In PSO each point has memory of the position where it achieved the best performance <span class="math notranslate nohighlight">\(\mathbf x^l_i\)</span> (local memory) and of the best decision vector <span class="math notranslate nohighlight">\( \mathbf x^g \)</span> in a certain neighbourhood, and uses this information to update its position using the equations (constriction coefficient): <div class="math notranslate nohighlight">
\[\begin{split}
\begin{array}{l}
\mathbf v_{i+1} = \omega \left( \mathbf v_i + \eta_1 \mathbf r_1 \cdot \left( \mathbf x_i - \mathbf x^l_i \right)
Expand All @@ -429,7 +429,7 @@ <h1>Particle Swarm Optimization (PSO)<a class="headerlink" href="#particle-swarm
\mathbf x_{i+1} = \mathbf x_i + \mathbf v_i
\end{array}
\end{split}\]</div>
or (inertia weight): <div class="math notranslate nohighlight">
or (inertia weight): <div class="math notranslate nohighlight">
\[\begin{split}
\begin{array}{l}
\mathbf v_{i+1} = \omega \mathbf v_i + \eta_1 \mathbf r_1 \cdot \left( \mathbf x_i - \mathbf x^l_i \right)
Expand Down
30 changes: 15 additions & 15 deletions docs/cpp/miscellanea/type_traits.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/cpp/problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ <h1>Problem<a class="headerlink" href="#problem" title="Permalink to this headli
<span id="_CPPv3N5pagmo7problemE"></span><span id="_CPPv2N5pagmo7problemE"></span><span id="pagmo::problem"></span><span class="target" id="classpagmo_1_1problem"></span><span class="k"><span class="pre">class</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">problem</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo7problemE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>Problem class. </p>
<p><img alt="../../_images/prob_no_text.png" src="../../_images/prob_no_text.png" /></p>
<p>This class represents a generic <em>mathematical programming</em> or <em>evolutionary optimization</em> problem in the form: <div class="math notranslate nohighlight">
<p>This class represents a generic <em>mathematical programming</em> or <em>evolutionary optimization</em> problem in the form: <div class="math notranslate nohighlight">
\[\begin{split}
\begin{array}{rl}
\mbox{find:} &amp; \mathbf {lb} \le \mathbf x \le \mathbf{ub}\\
Expand All @@ -441,10 +441,10 @@ <h1>Problem<a class="headerlink" href="#problem" title="Permalink to this headli
\end{array}
\end{split}\]</div>
</p>
<p>where <span class="math notranslate nohighlight">\(\mathbf x \in \mathbb R^{n_{cx}} \times \mathbb Z^{n_{ix}}\)</span> is called <em>decision vector</em> or <em>chromosome</em>, and is made of <span class="math notranslate nohighlight">\(n_{cx}\)</span> real numbers and <span class="math notranslate nohighlight">\(n_{ix}\)</span> integers (all represented as doubles). The total problem dimension is then indicated with <span class="math notranslate nohighlight">\(n_x = n_{cx} + n_{ix}\)</span>. <span class="math notranslate nohighlight">\(\mathbf{lb}, \mathbf{ub} \in
\mathbb R^{n_{cx}} \times \mathbb Z^{n_{ix}}\)</span> are the <em>box-bounds</em>, <span class="math notranslate nohighlight">\( \mathbf f: \mathbb R^{n_{cx}} \times
\mathbb Z^{n_{ix}} \rightarrow \mathbb R^{n_{obj}}\)</span> define the <em>objectives</em>, <span class="math notranslate nohighlight">\( \mathbf c_e: \mathbb R^{n_{cx}}
\times \mathbb Z^{n_{ix}} \rightarrow \mathbb R^{n_{ec}}\)</span> are non linear <em>equality constraints</em>, and <span class="math notranslate nohighlight">\( \mathbf
<p>where <span class="math notranslate nohighlight">\(\mathbf x \in \mathbb R^{n_{cx}} \times \mathbb Z^{n_{ix}}\)</span> is called <em>decision vector</em> or <em>chromosome</em>, and is made of <span class="math notranslate nohighlight">\(n_{cx}\)</span> real numbers and <span class="math notranslate nohighlight">\(n_{ix}\)</span> integers (all represented as doubles). The total problem dimension is then indicated with <span class="math notranslate nohighlight">\(n_x = n_{cx} + n_{ix}\)</span>. <span class="math notranslate nohighlight">\(\mathbf{lb}, \mathbf{ub} \in
\mathbb R^{n_{cx}} \times \mathbb Z^{n_{ix}}\)</span> are the <em>box-bounds</em>, <span class="math notranslate nohighlight">\( \mathbf f: \mathbb R^{n_{cx}} \times
\mathbb Z^{n_{ix}} \rightarrow \mathbb R^{n_{obj}}\)</span> define the <em>objectives</em>, <span class="math notranslate nohighlight">\( \mathbf c_e: \mathbb R^{n_{cx}}
\times \mathbb Z^{n_{ix}} \rightarrow \mathbb R^{n_{ec}}\)</span> are non linear <em>equality constraints</em>, and <span class="math notranslate nohighlight">\( \mathbf
c_i: \mathbb R^{n_{cx}} \times \mathbb Z^{n_{ix}} \rightarrow \mathbb R^{n_{ic}}\)</span> are non linear <em>inequality constraints</em>. Note that the objectives and constraints may also depend from an added value <span class="math notranslate nohighlight">\(s\)</span> seeding the values of any number of stochastic variables. This allows also for stochastic programming tasks to be represented by this class. A tolerance is also considered for all constraints and set, by default, to zero. It can be modified via the <a class="reference internal" href="#classpagmo_1_1problem_1ab1bbd8f6f4c119aef9e04fdfa499a33e"><span class="std std-ref">problem::set_c_tol()</span></a> method.</p>
<p>In order to define an optimization problem in pagmo, the user must first define a class (or a struct) whose methods describe the properties of the problem and allow to compute the objective function, the gradient, the constraints, etc. In pagmo, we refer to such a class as a <strong>user-defined problem</strong>, or UDP for short. Once defined and instantiated, a UDP can then be used to construct an instance of this class, <a class="reference internal" href="#classpagmo_1_1problem"><span class="std std-ref">pagmo::problem</span></a>, which provides a generic interface to optimization problems.</p>
<p>Every UDP must implement at least the following two methods: <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>vector_double fitness(const vector_double &amp;) const;
Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/problems/ackley.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ <h1>Ackley<a class="headerlink" href="#ackley" title="Permalink to this headline
<span id="_CPPv3N5pagmo6ackleyE"></span><span id="_CPPv2N5pagmo6ackleyE"></span><span id="pagmo::ackley"></span><span class="target" id="structpagmo_1_1ackley"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">ackley</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo6ackleyE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>The Ackley problem. </p>
<p><img alt="../../../_images/ackley.png" src="../../../_images/ackley.png" /></p>
<p>This is a scalable box-constrained continuous single-objective problem. The objective function is the generalised n-dimensional Ackley function: <div class="math notranslate nohighlight">
<p>This is a scalable box-constrained continuous single-objective problem. The objective function is the generalised n-dimensional Ackley function: <div class="math notranslate nohighlight">
\[
F\left(x_1,\ldots,x_n\right) = 20 + e - 20e^{-\frac 15 \sqrt{\frac 1n \sum_{i=1}^n x_i^2}} - e^{\frac 1n
\sum_{i=1}^n \cos(2\pi x_i)}, \quad x_i \in \left[ -15,30 \right].
Expand Down
8 changes: 4 additions & 4 deletions docs/cpp/problems/decompose.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,14 @@ <h1>Decompose<a class="headerlink" href="#decompose" title="Permalink to this he
<li><p>boundary interception method (with penalty constraint).</p></li>
</ul>
</p>
<p>In the case of <span class="math notranslate nohighlight">\(n\)</span> objectives, we indicate with: <span class="math notranslate nohighlight">\( \mathbf f(\mathbf x) = [f_1(\mathbf x), \ldots, f_n(\mathbf
x)] \)</span> the vector containing the original multiple objectives, with: <span class="math notranslate nohighlight">\( \boldsymbol \lambda = (\lambda_1, \ldots,
\lambda_n) \)</span> an <span class="math notranslate nohighlight">\(n\)</span>-dimensional weight vector and with: <span class="math notranslate nohighlight">\( \mathbf z^* = (z^*_1, \ldots, z^*_n) \)</span> an <span class="math notranslate nohighlight">\(n\)</span>-dimensional reference point. We also ussume <span class="math notranslate nohighlight">\(\lambda_i &gt; 0, \forall i=1..n\)</span> and <span class="math notranslate nohighlight">\(\sum_i \lambda_i =
<p>In the case of <span class="math notranslate nohighlight">\(n\)</span> objectives, we indicate with: <span class="math notranslate nohighlight">\( \mathbf f(\mathbf x) = [f_1(\mathbf x), \ldots, f_n(\mathbf
x)] \)</span> the vector containing the original multiple objectives, with: <span class="math notranslate nohighlight">\( \boldsymbol \lambda = (\lambda_1, \ldots,
\lambda_n) \)</span> an <span class="math notranslate nohighlight">\(n\)</span>-dimensional weight vector and with: <span class="math notranslate nohighlight">\( \mathbf z^* = (z^*_1, \ldots, z^*_n) \)</span> an <span class="math notranslate nohighlight">\(n\)</span>-dimensional reference point. We also ussume <span class="math notranslate nohighlight">\(\lambda_i &gt; 0, \forall i=1..n\)</span> and <span class="math notranslate nohighlight">\(\sum_i \lambda_i =
1\)</span>.</p>
<p>The decomposed problem is thus a single objective optimization problem having the following single objective, according to the decomposition method chosen:</p>
<p><ul class="simple">
<li><p>weighted decomposition: <span class="math notranslate nohighlight">\( f_d(\mathbf x) = \boldsymbol \lambda \cdot \mathbf f \)</span>,</p></li>
<li><p>Tchebycheff decomposition: <span class="math notranslate nohighlight">\( f_d(\mathbf x) = \max_{1 \leq i \leq m} \lambda_i \vert f_i(\mathbf x) - z^*_i \vert
<li><p>Tchebycheff decomposition: <span class="math notranslate nohighlight">\( f_d(\mathbf x) = \max_{1 \leq i \leq m} \lambda_i \vert f_i(\mathbf x) - z^*_i \vert
\)</span>,</p></li>
<li><p>boundary interception method (with penalty constraint): <span class="math notranslate nohighlight">\( f_d(\mathbf x) = d_1 + \theta d_2\)</span>,</p></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/problems/griewank.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ <h1>Griewank<a class="headerlink" href="#griewank" title="Permalink to this head
<span id="_CPPv3N5pagmo8griewankE"></span><span id="_CPPv2N5pagmo8griewankE"></span><span id="pagmo::griewank"></span><span class="target" id="structpagmo_1_1griewank"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">griewank</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo8griewankE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>The Griewank problem. </p>
<p><img alt="../../../_images/griewank.png" src="../../../_images/griewank.png" /></p>
<p>This is a scalable box-constrained continuous single-objective problem. The objective function is the generalised n-dimensional Griewank function: <div class="math notranslate nohighlight">
<p>This is a scalable box-constrained continuous single-objective problem. The objective function is the generalised n-dimensional Griewank function: <div class="math notranslate nohighlight">
\[
F\left(x_1,\ldots,x_n\right) = \sum_{i=1}^n x_i^2 / 4000 - \prod_{i=1}^n\cos\frac{x_i}{\sqrt{i}}, \quad x_i \in
\left[ -600,600 \right].
Expand Down
4 changes: 2 additions & 2 deletions docs/cpp/problems/inventory.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ <h1>News-vendor problem<a class="headerlink" href="#news-vendor-problem" title="
<span id="_CPPv3N5pagmo9inventoryE"></span><span id="_CPPv2N5pagmo9inventoryE"></span><span id="pagmo::inventory"></span><span class="target" id="classpagmo_1_1inventory"></span><span class="k"><span class="pre">class</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">inventory</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo9inventoryE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>Stochastic Programming Test Problem: An Inventory Model. </p>
<p><img alt="../../../_images/newsvendor.png" src="../../../_images/newsvendor.png" /></p>
<p>This problem is a generalization of the simple inventory problem so-called of the “news-vendor”, widely used to introduce the main tools and techniques of stochastic programming Assume you are a newsvendor and each week, for the next <span class="math notranslate nohighlight">\( N\)</span> weeks, you need to decide how many journals to order (indicated with the decision variable <span class="math notranslate nohighlight">\( x_i \)</span>). The weekly journal demand is unknown to you and is indicated with the variable <span class="math notranslate nohighlight">\(d_i\)</span>. The cost of ordering journals before the week starts is <span class="math notranslate nohighlight">\( c\)</span>, the cost of ordering journals during the week (in order to meet an unforeseen demand) is <span class="math notranslate nohighlight">\( b \)</span> and the cost of having to hold unsold journals is <span class="math notranslate nohighlight">\( h \)</span>. The inventory level of journals will be defined by the succession: <div class="math notranslate nohighlight">
<p>This problem is a generalization of the simple inventory problem so-called of the “news-vendor”, widely used to introduce the main tools and techniques of stochastic programming Assume you are a newsvendor and each week, for the next <span class="math notranslate nohighlight">\( N\)</span> weeks, you need to decide how many journals to order (indicated with the decision variable <span class="math notranslate nohighlight">\( x_i \)</span>). The weekly journal demand is unknown to you and is indicated with the variable <span class="math notranslate nohighlight">\(d_i\)</span>. The cost of ordering journals before the week starts is <span class="math notranslate nohighlight">\( c\)</span>, the cost of ordering journals during the week (in order to meet an unforeseen demand) is <span class="math notranslate nohighlight">\( b \)</span> and the cost of having to hold unsold journals is <span class="math notranslate nohighlight">\( h \)</span>. The inventory level of journals will be defined by the succession: <div class="math notranslate nohighlight">
\[
I_i = [I_{i-1} + x_i - d_i]_+, I_1 = 0
\]</div>
while the total cost of running the journal sales for <span class="math notranslate nohighlight">\(N\)</span> weeks will be: <div class="math notranslate nohighlight">
while the total cost of running the journal sales for <span class="math notranslate nohighlight">\(N\)</span> weeks will be: <div class="math notranslate nohighlight">
\[
J(\mathbf x, \mathbf d) = c \sum_{i=1}^N x_i+ b \sum_{i=1}^N [d_i - I_i - x_i]_+ + h \sum_{i=1}^N [I_i + x_i -
d_i]_+
Expand Down
8 changes: 4 additions & 4 deletions docs/cpp/problems/minlp_rastrigin.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,18 +420,18 @@ <h1>MINLP Rastrigin<a class="headerlink" href="#minlp-rastrigin" title="Permalin
<span id="_CPPv3N5pagmo15minlp_rastriginE"></span><span id="_CPPv2N5pagmo15minlp_rastriginE"></span><span id="pagmo::minlp_rastrigin"></span><span class="target" id="structpagmo_1_1minlp__rastrigin"></span><span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">minlp_rastrigin</span></span></span><a class="headerlink" href="#_CPPv4N5pagmo15minlp_rastriginE" title="Permalink to this definition">#</a><br /></dt>
<dd><p>A MINLP version of the Rastrigin problem. </p>
<p><img alt="../../../_images/rastrigin.png" src="../../../_images/rastrigin.png" /></p>
<p>This is a scalable, box-constrained, mixed integer nonlinear programmng (MINLP) problem. The objective function is the generalised n-dimensional Rastrigin function: <div class="math notranslate nohighlight">
<p>This is a scalable, box-constrained, mixed integer nonlinear programmng (MINLP) problem. The objective function is the generalised n-dimensional Rastrigin function: <div class="math notranslate nohighlight">
\[
F\left(x_1,\ldots,x_n\right) = 10 \cdot n + \sum_{i=1}^n x_i^2 - 10\cdot\cos\left( 2\pi \cdot x_i \right)
\]</div>
</p>
<p>where we constraint the last <span class="math notranslate nohighlight">\(m\)</span> components of the decision vector to be integers. The variables are box bounded as follows: <span class="math notranslate nohighlight">\(\quad x_i \in [-5.12,5.12], \forall i = 1 .. n-m\)</span>, <span class="math notranslate nohighlight">\(\quad x_i \in [-10,-5], \forall
<p>where we constraint the last <span class="math notranslate nohighlight">\(m\)</span> components of the decision vector to be integers. The variables are box bounded as follows: <span class="math notranslate nohighlight">\(\quad x_i \in [-5.12,5.12], \forall i = 1 .. n-m\)</span>, <span class="math notranslate nohighlight">\(\quad x_i \in [-10,-5], \forall
i = m+1 .. n\)</span></p>
<p>Gradients (dense) are also provided (also for the integer part) as: <div class="math notranslate nohighlight">
<p>Gradients (dense) are also provided (also for the integer part) as: <div class="math notranslate nohighlight">
\[
G_i\left(x_1,\ldots,x_n\right) = 2 x_i + 10 \cdot 2\pi \cdot\sin\left( 2\pi \cdot x_i \right)
\]</div>
And Hessians (sparse as only the diagonal is non-zero) are: <div class="math notranslate nohighlight">
And Hessians (sparse as only the diagonal is non-zero) are: <div class="math notranslate nohighlight">
\[
H_{ii}\left(x_1,\ldots,x_n\right) = 2 + 10 \cdot 4\pi^2 \cdot\cos\left( 2\pi \cdot x_i \right)
\]</div>
Expand Down
Loading

0 comments on commit e8d20ee

Please sign in to comment.