├── docs ├── .nojekyll ├── _static │ ├── readme.md │ ├── up.png │ ├── down.png │ ├── file.png │ ├── minus.png │ ├── plus.png │ ├── comment.png │ ├── up-pressed.png │ ├── ajax-loader.gif │ ├── comment-close.png │ ├── down-pressed.png │ ├── comment-bright.png │ ├── fonts │ │ ├── Lato-Bold.ttf │ │ ├── Inconsolata.ttf │ │ ├── Lato-Regular.ttf │ │ ├── Lato │ │ │ ├── lato-bold.eot │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-italic.eot │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-regular.eot │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-italic.woff2 │ │ │ ├── lato-regular.woff │ │ │ ├── lato-regular.woff2 │ │ │ ├── lato-bolditalic.eot │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ └── lato-bolditalic.woff2 │ │ ├── Inconsolata-Bold.ttf │ │ ├── RobotoSlab-Bold.ttf │ │ ├── Inconsolata-Regular.ttf │ │ ├── RobotoSlab-Regular.ttf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ └── RobotoSlab │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ └── roboto-slab-v7-regular.woff2 │ ├── graphviz.css │ ├── css │ │ └── badge_only.css │ ├── js │ │ ├── theme.js │ │ └── modernizr.min.js │ ├── pygments.css │ ├── doctools.js │ ├── underscore.js │ ├── language_data.js │ ├── documentation_options.js │ ├── basic.css │ └── searchtools.js ├── objects.inv ├── doctrees │ ├── index.doctree │ ├── environment.pickle │ ├── pso.clases.doctree │ ├── pso.codigo.doctree │ ├── pso.ejemplos.doctree │ ├── pso.introduccion.doctree │ ├── pso.clases.enjambre.doctree │ └── pso.clases.particula.doctree ├── _sources │ ├── pso.clases.enjambre.rst.txt │ ├── pso.clases.particula.rst.txt │ ├── pso.clases.rst.txt │ ├── index.rst.txt │ ├── pso.codigo.rst.txt │ ├── pso.ejemplos.rst.txt │ ├── pso.introduccion2.md.txt │ └── pso.introduccion.rst.txt ├── .buildinfo ├── _modules │ ├── builtins.html │ └── index.html ├── search.html ├── pso.clases.html ├── py-modindex.html ├── index.html ├── searchindex.js ├── genindex.html └── pso.introduccion.html ├── animacion.mp4 └── README.md /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/_static/readme.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /animacion.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/animacion.mp4 -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/objects.inv -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/up.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_sources/pso.clases.enjambre.rst.txt: -------------------------------------------------------------------------------- 1 | Enjambre 2 | =============== 3 | 4 | .. automodule:: pso.clases.class_enjambre 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /docs/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/doctrees/pso.clases.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.clases.doctree -------------------------------------------------------------------------------- /docs/doctrees/pso.codigo.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.codigo.doctree -------------------------------------------------------------------------------- /docs/_sources/pso.clases.particula.rst.txt: -------------------------------------------------------------------------------- 1 | Particula 2 | ================ 3 | 4 | .. automodule:: pso.clases.class_particula 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/doctrees/pso.ejemplos.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.ejemplos.doctree -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/doctrees/pso.introduccion.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.introduccion.doctree -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/doctrees/pso.clases.enjambre.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.clases.enjambre.doctree -------------------------------------------------------------------------------- /docs/doctrees/pso.clases.particula.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/doctrees/pso.clases.particula.doctree -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoaquinAmatRodrigo/optimizacion_PSO_python/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c304b5b9cebabf020cb1239273fa9036 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_sources/pso.clases.rst.txt: -------------------------------------------------------------------------------- 1 | Clases del optimizador 2 | ================================================================================ 3 | 4 | El optimizador consta de de dos clases. 5 | 6 | 7 | .. toctree:: 8 | 9 | pso.clases.particula 10 | pso.clases.enjambre 11 | 12 | -------------------------------------------------------------------------------- /docs/_static/graphviz.css: -------------------------------------------------------------------------------- 1 | /* 2 | * graphviz.css 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- graphviz extension. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | img.graphviz { 13 | border: 0; 14 | max-width: 100%; 15 | } 16 | 17 | object.graphviz { 18 | max-width: 100%; 19 | } 20 | -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | OPTIMIZACIÓN PSO CON PYTHON 2 | ================================================================================ 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | :caption: Tabla de contenidos: 7 | 8 | pso.introduccion 9 | pso.codigo 10 | pso.ejemplos 11 | 12 | 13 | Indices and tables 14 | ================================================================================ 15 | 16 | * :ref:`genindex` 17 | * :ref:`modindex` 18 | * :ref:`search` 19 | -------------------------------------------------------------------------------- /docs/_sources/pso.codigo.rst.txt: -------------------------------------------------------------------------------- 1 | Código Python 2 | ================================================================================ 3 | 4 | 5 | Particula 6 | -------------------------------------------------------------------------------- 7 | 8 | .. automodule:: pso.clases.class_particula 9 | :members: 10 | 11 | 12 | Enjambre 13 | -------------------------------------------------------------------------------- 14 | 15 | .. automodule:: pso.clases.class_enjambre 16 | :members: 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # optimizacion_PSO_python 2 | Implementación de un algoritmo de optimización *particle swarm optimization* (PSO) con python. 3 | 4 | + Documentación: https://joaquinamatrodrigo.github.io/optimizacion_PSO_python/ 5 | + El archivo *PSO_python.py* contiene las clases y funciones necesarias para la optimización. 6 | + El jupyter notebook *PSO_python.ipynb* contiene información detallada del funcionamiento del optimizador, ejemplos y visualizaciones. 7 | 8 |

9 | 10 | Creative Commons Licence
This work by Joaquín Amat Rodrigo is licensed under a Creative Commons Attribution 4.0 International License. 11 | -------------------------------------------------------------------------------- /docs/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} 2 | -------------------------------------------------------------------------------- /docs/_sources/pso.ejemplos.rst.txt: -------------------------------------------------------------------------------- 1 | Ejemplos 2 | ================================================================================ 3 | 4 | 5 | 6 | .. code-block:: python 7 | 8 | import numpy as np 9 | import random 10 | import warnings 11 | import random 12 | import copy 13 | import pandas as pd 14 | import time 15 | import matplotlib 16 | import matplotlib.pyplot as plt 17 | from datetime import datetime 18 | 19 | # Función objetivo que se quiere minimizar 20 | def funcion_objetivo(x_0, x_1): 21 | """ 22 | Para la región acotada entre −10<=x_0<=0 y −6.5<=x_1<=0 la función tiene 23 | múltiples mínimos locales y un único minimo global que se encuentra en 24 | f(−3.1302468,−1.5821422) = −106.7645367 25 | """ 26 | f = np.sin(x_1)*np.exp(1-np.cos(x_0))**2 \ 27 | + np.cos(x_0)*np.exp(1-np.sin(x_1))**2 \ 28 | + (x_0-x_1)**2 29 | return(f) 30 | 31 | # Contour plot función objetivo 32 | x_0 = np.linspace(start = -10, stop = 0, num = 100) 33 | x_1 = np.linspace(start = -6.5, stop = 0, num = 100) 34 | x_0, x_1 = np.meshgrid(x_0, x_1) 35 | z = funcion_objetivo(x_0, x_1) 36 | plt.contour(x_0, x_1, z, 35, cmap='RdGy') 37 | 38 | enjambre = Enjambre( 39 | n_particulas = 50, 40 | n_variables = 2, 41 | limites_inf = [-10, -6.5], 42 | limites_sup = [0, 0], 43 | verbose = False 44 | ) 45 | 46 | enjambre.optimizar( 47 | funcion_objetivo = funcion_objetivo, 48 | optimizacion = "minimizar", 49 | n_iteraciones = 250, 50 | inercia = 0.8, 51 | reduc_inercia = True, 52 | inercia_max = 0.9, 53 | inercia_min = 0.4, 54 | peso_cognitivo = 1, 55 | peso_social = 2, 56 | parada_temprana = True, 57 | rondas_parada = 5, 58 | tolerancia_parada = 10**-8, 59 | verbose = False 60 | ) 61 | 62 | enjambre 63 | 64 | # Evolución de la optimización 65 | enjambre.resultados_df['mejor_valor_enjambre'].plot() 66 | 67 | # Representación evolución partículas gráfico animado 68 | import matplotlib.animation as animation 69 | import plotly_express as px 70 | 71 | def extraer_posicion(particula): 72 | posicion = particula.posicion 73 | return(posicion) 74 | 75 | lista_df_temp = [] 76 | 77 | for i in np.arange(len(enjambre.historico_particulas)): 78 | posiciones = list(map(extraer_posicion, enjambre.historico_particulas[i])) 79 | df_temp = pd.DataFrame({"iteracion": i, "posicion": posiciones}) 80 | lista_df_temp.append(df_temp) 81 | 82 | df_posiciones = pd.concat(lista_df_temp) 83 | 84 | df_posiciones[['x_0','x_1']] = pd.DataFrame(df_posiciones["posicion"].values.tolist(), 85 | index= df_posiciones.index) 86 | 87 | df_posiciones.head() 88 | 89 | px.scatter( 90 | df_posiciones, 91 | x = "x_0", 92 | y = "x_1", 93 | range_x = [-10, 0], 94 | range_y = [-6.5, 0], 95 | animation_frame = "iteracion" 96 | ) 97 | 98 | fig = plt.figure(figsize=(8,5)) 99 | plt.xlim(-10,0) 100 | plt.ylim(-6.5,0) 101 | 102 | def animate(i): 103 | p2 = fig.clear() 104 | plt.xlim(-10,0) 105 | plt.ylim(-6.5,0) 106 | df_posiciones_i = df_posiciones[df_posiciones["iteracion"] == i][["x_0", "x_1"]] 107 | p1 = plt.contour(x_0, x_1, z, 35, cmap='RdGy') 108 | p2 = plt.scatter(df_posiciones_i["x_0"], df_posiciones_i["x_1"]) 109 | 110 | ani = matplotlib.animation.FuncAnimation(fig, animate, repeat=True, blit=True) 111 | plt.show() 112 | -------------------------------------------------------------------------------- /docs/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | /* sphinx_rtd_theme version 0.4.3 | MIT license */ 2 | /* Built 20190212 16:02 */ 3 | require=function r(s,a,l){function c(e,n){if(!a[e]){if(!s[e]){var i="function"==typeof require&&require;if(!n&&i)return i(e,!0);if(u)return u(e,!0);var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(n){return c(s[e][1][n]||n)},o,o.exports,r,s,a,l)}return a[e].exports}for(var u="function"==typeof require&&require,n=0;n"),i("table.docutils.footnote").wrap("
"),i("table.docutils.citation").wrap("
"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i(''),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | builtins — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 98 | 99 |
100 | 101 | 102 | 108 | 109 | 110 |
111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
    133 | 134 |
  • Docs »
  • 135 | 136 |
  • Module code »
  • 137 | 138 |
  • builtins
  • 139 | 140 | 141 |
  • 142 | 143 |
  • 144 | 145 |
146 | 147 | 148 |
149 |
150 |
151 |
152 | 153 |

Source code for builtins

154 | 
155 | 
156 | 157 |
158 | 159 |
160 |
161 | 162 | 163 |
164 | 165 |
166 |

167 | © Copyright 2019, Joaquín Amat Rodrigo 168 | 169 |

170 |
171 | Built with Sphinx using a theme provided by Read the Docs. 172 | 173 |
174 | 175 |
176 |
177 | 178 |
179 | 180 |
181 | 182 | 183 | 184 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /docs/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Overview: module code — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 98 | 99 |
100 | 101 | 102 | 108 | 109 | 110 |
111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
    133 | 134 |
  • Docs »
  • 135 | 136 |
  • Overview: module code
  • 137 | 138 | 139 |
  • 140 | 141 |
  • 142 | 143 |
144 | 145 | 146 |
147 |
148 |
149 |
150 | 151 |

All modules for which code is available

152 | 155 | 156 |
157 | 158 |
159 |
160 | 161 | 162 |
163 | 164 |
165 |

166 | © Copyright 2019, Joaquín Amat Rodrigo 167 | 168 |

169 |
170 | Built with Sphinx using a theme provided by Read the Docs. 171 | 172 |
173 | 174 |
175 |
176 | 177 |
178 | 179 |
180 | 181 | 182 | 183 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Search — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 99 | 100 |
101 | 102 | 103 | 109 | 110 | 111 |
112 | 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
132 | 133 |
    134 | 135 |
  • Docs »
  • 136 | 137 |
  • Search
  • 138 | 139 | 140 |
  • 141 | 142 | 143 | 144 |
  • 145 | 146 |
147 | 148 | 149 |
150 |
151 |
152 |
153 | 154 | 162 | 163 | 164 |
165 | 166 |
167 | 168 |
169 | 170 |
171 |
172 | 173 | 174 |
175 | 176 |
177 |

178 | © Copyright 2019, Joaquín Amat Rodrigo 179 | 180 |

181 |
182 | Built with Sphinx using a theme provided by Read the Docs. 183 | 184 |
185 | 186 |
187 |
188 | 189 |
190 | 191 |
192 | 193 | 194 | 195 | 200 | 201 | 202 | 203 | 204 | 205 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /docs/pso.clases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Clases del optimizador — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 98 | 99 |
100 | 101 | 102 | 108 | 109 | 110 |
111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
    133 | 134 |
  • Docs »
  • 135 | 136 |
  • Clases del optimizador
  • 137 | 138 | 139 |
  • 140 | 141 | 142 | View page source 143 | 144 | 145 |
  • 146 | 147 |
148 | 149 | 150 |
151 |
152 |
153 |
154 | 155 |
156 |

Clases del optimizador

157 |

El optimizador consta de de dos clases.

158 |
159 | 167 |
168 |
169 | 170 | 171 |
172 | 173 |
174 |
175 | 176 | 177 |
178 | 179 |
180 |

181 | © Copyright 2019, Joaquín Amat Rodrigo 182 | 183 |

184 |
185 | Built with Sphinx using a theme provided by Read the Docs. 186 | 187 |
188 | 189 |
190 |
191 | 192 |
193 | 194 |
195 | 196 | 197 | 198 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /docs/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Python Module Index — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
48 | 49 | 101 | 102 |
103 | 104 | 105 | 111 | 112 | 113 |
114 | 115 |
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 |
134 | 135 |
    136 | 137 |
  • Docs »
  • 138 | 139 |
  • Python Module Index
  • 140 | 141 | 142 |
  • 143 | 144 |
  • 145 | 146 |
147 | 148 | 149 |
150 |
151 |
152 |
153 | 154 | 155 |

Python Module Index

156 | 157 |
158 | p 159 |
160 | 161 | 162 | 163 | 165 | 166 | 168 | 171 | 172 | 173 | 176 | 177 | 178 | 181 |
 
164 | p
169 | pso 170 |
    174 | pso.clases.class_enjambre 175 |
    179 | pso.clases.class_particula 180 |
182 | 183 | 184 |
185 | 186 |
187 |
188 | 189 | 190 |
191 | 192 |
193 |

194 | © Copyright 2019, Joaquín Amat Rodrigo 195 | 196 |

197 |
198 | Built with Sphinx using a theme provided by Read the Docs. 199 | 200 |
201 | 202 |
203 |
204 | 205 |
206 | 207 |
208 | 209 | 210 | 211 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | OPTIMIZACIÓN PSO CON PYTHON — Optimización PSO 0.0.1 documentation 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 99 | 100 |
101 | 102 | 103 | 109 | 110 | 111 |
112 | 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
132 | 133 |
    134 | 135 |
  • Docs »
  • 136 | 137 |
  • OPTIMIZACIÓN PSO CON PYTHON
  • 138 | 139 | 140 |
  • 141 | 142 | 143 | View page source 144 | 145 | 146 |
  • 147 | 148 |
149 | 150 | 151 |
152 |
153 |
154 |
155 | 156 |
157 |

OPTIMIZACIÓN PSO CON PYTHON

158 |
159 |

Tabla de contenidos:

160 | 181 |
182 |
183 |
184 |

Indices and tables

185 | 190 |
191 | 192 | 193 |
194 | 195 |
196 |
197 | 198 | 204 | 205 | 206 |
207 | 208 |
209 |

210 | © Copyright 2019, Joaquín Amat Rodrigo 211 | 212 |

213 |
214 | Built with Sphinx using a theme provided by Read the Docs. 215 | 216 |
217 | 218 |
219 |
220 | 221 |
222 | 223 |
224 | 225 | 226 | 227 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | -------------------------------------------------------------------------------- /docs/_sources/pso.introduccion2.md.txt: -------------------------------------------------------------------------------- 1 | # Introducción 2 | 3 | 4 | La optimización por enjambre de partículas (*Particle Swarm Optimization, PSO*) es un método de optimización heurística orientado a encontrar mínimos o máximos globales. Su funcionamiento está inspirado en el comportamiento que tienen las bandadas de pájaros o bancos de peces en los que, el movimiento de cada individuo (dirección, velocidad, aceleración...), es el resultado de combinar las decisiones individuales de cada uno con el comportamiento del resto. 5 | 6 | >*El método de enjambre de partículas es solo una de las muchas estrategias de optimización heurística que existen, una alternativa común son los [algoritmos genéticos](https://rpubs.com/Joaquin_AR/465473).* 7 | 8 | >*La optimización heurística no tiene por qué ser la forma de optimización más adecuada en todos los escenarios. Si el problema en cuestión puede optimizarse de forma analítica, suele ser más adecuado resolverlo de esta forma.* 9 | 10 | >*La implementación de algoritmo que se muestra en este documento pretende ser lo más explicativa posible aunque para ello no sea la más eficiente.* 11 | 12 | El código de las funciones desarrolladas a lo largo del documento puede descargarse en el siguiente [link](https://github.com/JoaquinAmatRodrigo/optimizacion_PSO_python/blob/master/PSO_python.py) 13 | 14 | 15 | ## Algoritmo 16 | 17 | Aunque existen variaciones, algunas de las cuales se describen a lo largo de este documento, en términos generales, la estructura de un algoritmo *PSO* para optimizar (maximizar o minimizar) una función con una o múltiples variables sigue los siguientes pasos: 18 | 19 | ---- 20 | 21 | 1. Crear un enjambre inicial de $n$ partículas aleatorias. Cada partícula consta de 4 elementos: una posición que representa una determinada combinación de valores de las variables, el valor de la función objetivo en la posición donde se encuentra la partícula, una velocidad que indica cómo y hacia donde se desplaza la partícula, y un registro de la mejor posición en la que ha estado la partícula hasta el momento. 22 |

23 | 24 | 2. Evaluar cada partícula con la función objetivo. 25 |

26 | 27 | 3. Actualizar la posición y velocidad de cada partícula. Esta es la parte que proporciona al algoritmo la capacidad de optimización. En el apartado [Mover partícula](#Mover partícula) se describe con detalle el proceso. 28 |

29 | 30 | 4. Si no se cumple un criterio de parada, volver al paso 2. 31 | 32 | ---- 33 | 34 | En los siguientes apartados se implementan cada una de las etapas del proceso para, finalmente, combinarlas todas en una única función. 35 |

36 | 37 | ### Crear partícula 38 | 39 | Cada partícula está definida por una posición, velocidad y valor que varían a medida que la partícula se mueve. Además, también almacena la mejor posición en la que ha estado hasta el momento. Cuando se crea aun nueva partícula, únicamente se dispone de información sobre su posición y velocidad (normalmente iniciada como cero), el resto de valores no se conocen hasta que la partícula es evaluada. 40 |

41 | 42 | ### Evaluar partícula 43 | 44 | Evaluar una partícula consiste en calcular el valor de la función objetivo en la posición que ocupa la partícula es ese momento. Cada partícula almacena también la posición con mejor valor en la que ha estado hasta el momento. Para poder identificar 45 | si una nueva posición es mejor que las anteriores, es necesario conocer si se trata de un problema de minimización o maximización. 46 |

47 | 48 | ### Mover partícula 49 | 50 | Mover una partícula implica actualizar su velocidad y posición. Este paso es el más importante ya que otorga al algoritmo la capacidad de optimizar. 51 | 52 | La velocidad de cada partícula del enjambre se actualiza empleando la siguiente ecuación: 53 | 54 | ```math 55 | 56 | v_i(t+1) = wv_i(t) + c_1r_1[\hat{x}_i(t) - x_i(t)] + c_2r_2[g(t) - x_i(t)] 57 | 58 | ``` 59 | 60 | `$ v_i(t+1) = wv_i(t) + c_1r_1[\hat{x}_i(t) - x_i(t)] + c_2r_2[g(t) - x_i(t)] $` 61 | 62 | donde: 63 | 64 | + `$ v_i(t+1) $`: velocidad de la partícula $i$ en el momento $t + 1$, es decir, la nueva velocidad. 65 | + `$ v_i(t) $`: velocidad de la partícula $i$ en el momento $t$, es decir, la velocidad actual. 66 | + `$w$`: coeficiente de inercia, reduce o aumenta a la velocidad de la partícula. 67 | + `$c_1$`: coeficiente cognitivo. 68 | + `$r_1$`: vector de valores aleatorios entre 0 y 1 de longitud igual a la del vector velocidad. 69 | + `$\hat{x}_i(t)$`: mejor posición en la que ha estado la partícula $i$ hasta el momento. 70 | + `$x_i(t)$`: posición de la partícula $i$ en el momento $t$. 71 | + `$c_2$`: coeficiente social. 72 | + `$r_2$`: vector de valores aleatorios entre 0 y 1 de longitud igual a la del vector velocidad. 73 | + `$g(t)$`: posición de todo el enjambre en el momento $t$, el mejor valor global. 74 | 75 | 76 | Para comprender como se relaciona esta ecuación con el movimiento de la partícula, resulta útil diferenciar tres partes: 77 | 78 | + $wv_i(t)$ es la componente de inercia, responsable de mantener a la partícula moviéndose en la dirección en la que lo ha estado haciendo hasta el momento. El valor recomendado del coeficiente de inercia $w$ suele ser entre 0.8 y 1.2. Si $w<1$, la partícula se va desacelerando a medida que avanzan las iteraciones, esto se traduce en menor exploración pero una convergencia hacia el óptimo más rápida. Si $w>1$, la partícula se va acelerando, lo que permite explorar más zonas del espacio de la función pero dificulta la convergencia. 79 | 80 | 81 | + $c_1r_1[\hat{x}_i(t) - x_i(t)]$ es la componente cognitiva, responsable de que la partícula tienda a moverse hacia la posición donde ha obtenido mejores resultados hasta el momento. El coeficiente cognitivo $c_1$ suele estar acotado en el rango [0, 2], siendo 2 el valor recomendado. $r_1$ es un vector de valores aleatorios entre 0 y 1 (un valor por cada dimensión) que aporta cierto comportamiento estocástico al movimiento de las partículas, mejorando así la capacidad de escapar de mínimos locales. 82 | 83 | 84 | + $c_2r_2[g(t) - x_i(t)]$ es la componente social, responsable de que la partícula tienda a moverse hacia la mejor posición encontrada por el enjambre hasta el momento. Puede interpretarse como el "conocimiento colectivo". El valor del coeficiente social $c_2$ suele estar acotado en el rango [0, 2], siendo 2 el valor recomendado. $r_2$ es un vector de valores aleatorios entre 0 y 1 (un valor por cada dimensión) que aporta cierto comportamiento estocástico al movimiento de las partículas, mejorando así la capacidad de escapar de mínimos locales. 85 | 86 | 87 | + La magnitud relativa entre la componente cognitiva y la componente social permite regular el comportamiento exploratorio del algoritmo. Cuanto mayor es el valor de $c_1$ respecto a $c_2$, mayor independencia de movimiento tiene cada partícula, lo que permite mayor exploración pero mayor lentitud en la convergencia. Por el contrario, cuanto mayor es el valor de $c_2$ respecto a $c_1$, más obligadas están las partículas a moverse hacia la mejor región encontrada hasta el momento, lo que reduce la exploración pero acelera la convergencia. 88 | 89 | 90 | + En algunas versiones del algoritmo, $r_1$ y $r_2$ son escalares en lugar de vectores. Multiplicar cada componente de la velocidad por un valor aleatorio distinto añade mayores fluctuaciones al movimiento de las partículas, lo que, aun a riesgo de retrasar la convergencia, suele generar mejores resultados. 91 | 92 | Una vez calculada la nueva velocidad, se puede actualizar la posición de la partícula con la ecuación: 93 | 94 | $$x_i(t+1) = x_i(t) + v_i(t+1)$$ 95 | 96 | 97 | Uno de los principales problemas del algoritmo *PSO* es que las partículas suelen adquirir velocidades excesivamente altas, lo que les lleva a salirse de los límites del espacio de búsqueda o a que sean incapaces de converger en la región óptima. Es en este paso del algoritmo donde más investigaciones y adaptaciones se han hecho. Algunas de las soluciones son: 98 | 99 | + Limitar la velocidad máxima que puede alcanzar una partícula. Siendo [$x_{min}$, $x_{max}$] los límites inferior y superior del espacio de búsqueda de cada variable, la velocidad máxima que puede alcanzar la partícula en esa dirección es $v_{max} = k(x_{max} - x_{min})/2$, donde $k$ suele ser un valor entre 0.1 y 1. 100 | 101 | 102 | + Si el valor de alguna de las variables excede los límites impuestos, se sobrescribe con el valor del límite correspondiente y se reinicia su velocidad a cero. 103 | 104 | 105 | + Reducción lineal del coeficiente de inercia $w$. Esta estrategia consiste en ir reduciendo el coeficiente de inercia a medida que avanzan las iteraciones. En las primeras iteraciones, las partículas tiene mucha capacidad de exploración y, a medida que avanza el proceso, va reduciéndose su velocidad favoreciendo la convergencia. Puede conseguirse este efecto con la ecuación: 106 | 107 | $$w_t = (w_{max} - w_{min}) \frac{t_{max} -t}{t_{max}} + w_{min}$$ 108 | 109 | donde: 110 | 111 | + `$w_{t}$`: coeficiente de inercia en la iteración $t$. 112 | + `$w_{max}$`: coeficiente de inercia máximo. Valor con el que se inicia el algoritmo. Valor recomendado de 0.9. 113 | + `$w_{min}$`: coeficiente de inercia mínimo. Valor que se alcanza en la última iteración. Valor recomendado de 0.4. 114 | + `$t_{max}$`: número máximo de iteraciones. 115 | 116 | 117 | La siguiente función actualiza la posición de una partícula teniendo en cuenta su posición y velocidad actual, la mejor posición global encontrada por el enjambre, los coeficientes de inercia, cognitivo, social, y los límites de búsqueda. 118 | 119 | 120 | Ejemplo codico python 121 | 122 | ```python 123 | import numpy as np 124 | ``` 125 | 126 | Ejemplo codico R 127 | 128 | ```r 129 | print("Hola") 130 | paste(c("1","2") 131 | ``` 132 | 133 | -------------------------------------------------------------------------------- /docs/_sources/pso.introduccion.rst.txt: -------------------------------------------------------------------------------- 1 | Introducción 2 | ================================================================================ 3 | 4 | La optimización por enjambre de partículas (*Particle Swarm Optimization, PSO*) es un método de optimización heurística orientado a encontrar mínimos o máximos globales. Su funcionamiento está inspirado en el comportamiento que tienen las bandadas de pájaros o bancos de peces en los que, el movimiento de cada individuo (dirección, velocidad, aceleración...), es el resultado de combinar las decisiones individuales de cada uno con el comportamiento del resto. 5 | 6 | El método de enjambre de partículas es solo una de las muchas estrategias de optimización heurística que existen, una alternativa común son los `algoritmos genéticos `_. 7 | 8 | La optimización heurística no tiene por qué ser la forma de optimización más adecuada en todos los escenarios. Si el problema en cuestión puede optimizarse de forma analítica, suele ser más adecuado resolverlo de esta forma. 9 | 10 | La implementación de algoritmo que se muestra en este documento pretende ser lo más explicativa posible aunque para ello no sea la más eficiente. 11 | 12 | El código de las funciones desarrolladas a lo largo del documento puede descargarse en el siguiente `Link `_. 13 | 14 | 15 | 16 | Algoritmo 17 | -------------------------------------------------------------------------------- 18 | 19 | 20 | Aunque existen variaciones, algunas de las cuales se describen a lo largo de este documento, en términos generales, la estructura de un algoritmo *PSO* para optimizar (maximizar o minimizar) una función con una o múltiples variables sigue los siguientes pasos: 21 | 22 | ---- 23 | 24 | 1) Crear un enjambre inicial de :math:`n` partículas aleatorias. Cada partícula consta de 4 elementos: una posición que representa una determinada combinación de valores de las variables, el valor de la función objetivo en la posición donde se encuentra la partícula, una velocidad que indica cómo y hacia donde se desplaza la partícula, y un registro de la mejor posición en la que ha estado la partícula hasta el momento. 25 | 26 | 27 | 2) Evaluar cada partícula con la función objetivo. 28 | 29 | 30 | 3) Actualizar la posición y velocidad de cada partícula. Esta es la parte que proporciona al algoritmo la capacidad de optimización. En el apartado **Mover partícula** se describe con detalle el proceso. 31 | 32 | 33 | 4) Si no se cumple un criterio de parada, volver al paso 2. 34 | 35 | ---- 36 | 37 | En los siguientes apartados se implementan cada una de las etapas del proceso para, finalmente, combinarlas todas en una única función. 38 | 39 | Crear partícula 40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 41 | 42 | Cada partícula está definida por una posición, velocidad y valor que varían a medida que la partícula se mueve. Además, también almacena la mejor posición en la que ha estado hasta el momento. Cuando se crea aun nueva partícula, únicamente se dispone de información sobre su posición y velocidad (normalmente iniciada como cero), el resto de valores no se conocen hasta que la partícula es evaluada. 43 | 44 | Evaluar partícula 45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 46 | 47 | Evaluar una partícula consiste en calcular el valor de la función objetivo en la posición que ocupa la partícula es ese momento. Cada partícula almacena también la posición con mejor valor en la que ha estado hasta el momento. Para poder identificar 48 | si una nueva posición es mejor que las anteriores, es necesario conocer si se trata de un problema de minimización o maximización. 49 | 50 | 51 | Mover partícula 52 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 53 | 54 | Mover una partícula implica actualizar su velocidad y posición. Este paso es el más importante ya que otorga al algoritmo la capacidad de optimizar. 55 | 56 | La velocidad de cada partícula del enjambre se actualiza empleando la siguiente ecuación: 57 | 58 | .. math:: v_i(t+1) = wv_i(t) + c_1r_1[\hat{x}_i(t) - x_i(t)] + c_2r_2[g(t) - x_i(t)] 59 | 60 | donde: 61 | 62 | - :math:`v_i(t+1)`: velocidad de la partícula :math:`i` en el momento :math:`t + 1`, es decir, la nueva velocidad. 63 | 64 | - :math:`v_i(t)`: velocidad de la partícula :math:`i` en el momento :math:`t`, es decir, la velocidad actual. 65 | 66 | - :math:`w`: coeficiente de inercia, reduce o aumenta a la velocidad de la partícula. 67 | 68 | - :math:`c_1`: coeficiente cognitivo. 69 | 70 | - :math:`r_1`: vector de valores aleatorios entre 0 y 1 de longitud igual a la del vector velocidad. 71 | 72 | - :math:`\hat{x}_i(t)`: mejor posición en la que ha estado la partícula :math:`i` hasta el momento. 73 | 74 | - :math:`x_i(t)`: posición de la partícula :math:`i` en el momento :math:`t`. 75 | 76 | - :math:`c_2`: coeficiente social. 77 | 78 | - :math:`r_2`: vector de valores aleatorios entre 0 y 1 de longitud igual a la del vector velocidad. 79 | 80 | - :math:`g(t)`: posición de todo el enjambre en el momento :math:`t`, el mejor valor global. 81 | 82 | 83 | Para comprender como se relaciona esta ecuación con el movimiento de la partícula, resulta útil diferenciar tres partes: 84 | 85 | :math:`wv_i(t)` 86 | Es la componente de inercia, responsable de mantener a la partícula moviéndose en la dirección en la que lo ha estado haciendo hasta el momento. El valor recomendado del coeficiente de inercia :math:`w` suele ser entre 0.8 y 1.2. Si :math:`w<1`, la partícula se va desacelerando a medida que avanzan las iteraciones, esto se traduce en menor exploración pero una convergencia hacia el óptimo más rápida. Si :math:`w>1`, la partícula se va acelerando, lo que permite explorar más zonas del espacio de la función pero dificulta la convergencia. 87 | 88 | 89 | :math:`c_1r_1[\hat{x}_i(t) - x_i(t)]` 90 | Es la componente cognitiva, responsable de que la partícula tienda a moverse hacia la posición donde ha obtenido mejores resultados hasta el momento. El coeficiente cognitivo :math:`c_1` suele estar acotado en el rango [0, 2], siendo 2 el valor recomendado. :math:`r_1` es un vector de valores aleatorios entre 0 y 1 (un valor por cada dimensión) que aporta cierto comportamiento estocástico al movimiento de las partículas, mejorando así la capacidad de escapar de mínimos locales. 91 | 92 | 93 | :math:`c_2r_2[g(t) - x_i(t)]` 94 | Es la componente social, responsable de que la partícula tienda a moverse hacia la mejor posición encontrada por el enjambre hasta el momento. Puede interpretarse como el "conocimiento colectivo". El valor del coeficiente social :math:`c_2` suele estar acotado en el rango [0, 2], siendo 2 el valor recomendado. :math:`r_2` es un vector de valores aleatorios entre 0 y 1 (un valor por cada dimensión) que aporta cierto comportamiento estocástico al movimiento de las partículas, mejorando así la capacidad de escapar de mínimos locales. 95 | 96 | 97 | La magnitud relativa entre la componente cognitiva y la componente social permite regular el comportamiento exploratorio del algoritmo. Cuanto mayor es el valor de :math:`c_1` respecto a :math:`c_2`, mayor independencia de movimiento tiene cada partícula, lo que permite mayor exploración pero mayor lentitud en la convergencia. Por el contrario, cuanto mayor es el valor de :math:`c_2` respecto a :math:`c_1`, más obligadas están las partículas a moverse hacia la mejor región encontrada hasta el momento, lo que reduce la exploración pero acelera la convergencia. 98 | 99 | 100 | En algunas versiones del algoritmo, :math:`r_1` y :math:`r_2` son escalares en lugar de vectores. Multiplicar cada componente de la velocidad por un valor aleatorio distinto añade mayores fluctuaciones al movimiento de las partículas, lo que, aun a riesgo de retrasar la convergencia, suele generar mejores resultados. 101 | 102 | Una vez calculada la nueva velocidad, se puede actualizar la posición de la partícula con la ecuación: 103 | 104 | .. math:: x_i(t+1) = x_i(t) + v_i(t+1) 105 | 106 | 107 | Uno de los principales problemas del algoritmo *PSO* es que las partículas suelen adquirir velocidades excesivamente altas, lo que les lleva a salirse de los límites del espacio de búsqueda o a que sean incapaces de converger en la región óptima. Es en este paso del algoritmo donde más investigaciones y adaptaciones se han hecho. Algunas de las soluciones son: 108 | 109 | - Limitar la velocidad máxima que puede alcanzar una partícula. Siendo [:math:`x_{min}`, :math:`x_{max}`] los límites inferior y superior del espacio de búsqueda de cada variable, la velocidad máxima que puede alcanzar la partícula en esa dirección es :math:`v_{max} = k(x_{max} - x_{min})/2`, donde :math:`k` suele ser un valor entre 0.1 y 1. 110 | 111 | 112 | - Si el valor de alguna de las variables excede los límites impuestos, se sobrescribe con el valor del límite correspondiente y se reinicia su velocidad a cero. 113 | 114 | 115 | - Reducción lineal del coeficiente de inercia :math:`w`. Esta estrategia consiste en ir reduciendo el coeficiente de inercia a medida que avanzan las iteraciones. En las primeras iteraciones, las partículas tiene mucha capacidad de exploración y, a medida que avanza el proceso, va reduciéndose su velocidad favoreciendo la convergencia. Puede conseguirse este efecto con la ecuación: 116 | 117 | .. math:: w_t = (w_{max} - w_{min}) \frac{t_{max} -t}{t_{max}} + w_{min} 118 | 119 | donde: 120 | 121 | - :math:`w_{t}`: coeficiente de inercia en la iteración :math:`t`. 122 | - :math:`w_{max}`: coeficiente de inercia máximo. Valor con el que se inicia el algoritmo. Valor recomendado de 0.9. 123 | - :math:`w_{min}`: coeficiente de inercia mínimo. Valor que se alcanza en la última iteración. Valor recomendado de 0.4. 124 | - :math:`t_{max}`: número máximo de iteraciones. 125 | -------------------------------------------------------------------------------- /docs/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["index","pso.clases","pso.clases.enjambre","pso.clases.particula","pso.codigo","pso.ejemplos","pso.introduccion","pso.introduccion2"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1,sphinx:55},filenames:["index.rst","pso.clases.rst","pso.clases.enjambre.rst","pso.clases.particula.rst","pso.codigo.rst","pso.ejemplos.rst","pso.introduccion.rst","pso.introduccion2.md"],objects:{"pso.clases":{class_enjambre:[4,0,0,"-"],class_particula:[4,0,0,"-"]},"pso.clases.class_enjambre":{Enjambre:[4,1,1,""]},"pso.clases.class_enjambre.Enjambre":{"part\u00edculas":[4,2,1,""],diferencia_abs:[4,2,1,""],evaluar_enjambre:[4,3,1,""],historico_mejor_posicion:[4,2,1,""],historico_mejor_valor:[4,2,1,""],historico_particulas:[4,2,1,""],iter_optimizacion:[4,2,1,""],limites_inf:[4,2,1,""],limites_sup:[4,2,1,""],mejor_particula:[4,2,1,""],mejor_valor:[4,2,1,""],mostrar_particulas:[4,3,1,""],mover_enjambre:[4,3,1,""],n_particulas:[4,2,1,""],n_variables:[4,2,1,""],optimizado:[4,2,1,""],optimizar:[4,3,1,""],posicion_optima:[4,2,1,""],resultados_df:[4,2,1,""],valor_optimo:[4,2,1,""]},"pso.clases.class_particula":{Particula:[4,1,1,""]},"pso.clases.class_particula.Particula":{evaluar_particula:[4,3,1,""],limites_inf:[4,2,1,""],limites_sup:[4,2,1,""],mejor_posicion:[4,2,1,""],mejor_valor:[4,2,1,""],mover_particula:[4,3,1,""],n_variables:[4,2,1,""],posicion:[4,2,1,""],valor:[4,2,1,""],velocidad:[4,2,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method"},terms:{"\u00f3ptima":[6,7],"\u00f3ptimo":[6,7],"\u00faltima":[2,4,6,7],"\u00fanica":[6,7],"\u00fanicament":[6,7],"\u00fanico":[2,4,5],"\u00fatil":[6,7],"a\u00f1ad":[6,7],"aceleraci\u00f3n":[6,7],"adem\u00e1":[3,4,6,7],"anal\u00edtica":[6,7],"as\u00ed":[2,4,6,7],"b\u00fasqueda":[3,4,6,7],"c\u00f3digo":[0,6,7],"c\u00f3mo":[6,7],"class":[2,3,4],"com\u00fan":[6,7],"combinaci\u00f3n":[3,4,6,7],"creaci\u00f3n":[3,4],"cuesti\u00f3n":[6,7],"default":[2,3,4],"dimensi\u00f3n":[6,7],"direcci\u00f3n":[6,7],"ecuaci\u00f3n":[6,7],"est\u00e1":[6,7],"est\u00e1n":[3,4,6,7],"estoc\u00e1stico":[6,7],"eval\u00faa":[2,3,4],"evoluci\u00f3n":5,"exploraci\u00f3n":[6,7],"float":[2,3,4],"funci\u00f3n":[2,3,4,5,6,7],"function":[2,3,4],"gen\u00e9tico":[6,7],"gr\u00e1fico":5,"heur\u00edstica":[6,7],"hist\u00f3rico":[2,3,4],"implementaci\u00f3n":[6,7],"import":[5,7],"informaci\u00f3n":[2,3,4,6,7],"int":[2,3,4],"introducci\u00f3n":0,"iteraci\u00f3n":[2,4,6,7],"l\u00edmite":[2,3,4,6,7],"m\u00e1s":[6,7],"m\u00e1xima":[6,7],"m\u00e1ximo":[6,7],"m\u00e9todo":[2,3,4,6,7],"m\u00ednima":[2,4],"m\u00ednimo":[2,4,5,6,7],"m\u00faltipl":[2,4,5,6,7],"maximizaci\u00f3n":[6,7],"minimizaci\u00f3n":[6,7],"movi\u00e9ndos":[6,7],"n\u00famero":[2,3,4,6,7],"num\u00e9rico":[3,4],"optimizaci\u00f3n":[2,4,5,6,7],"p\u00e1jaro":[6,7],"part\u00edcula":[0,2,3,4,5],"posici\u00f3n":[2,3,4,6,7],"qu\u00e9":[6,7],"r\u00e1pida":[6,7],"reducci\u00f3n":[2,4,6,7],"reduci\u00e9ndos":[6,7],"regi\u00f3n":[2,4,5,6,7],"representaci\u00f3n":5,"return":[2,3,4,5],"ser\u00e1":[2,3,4],"ser\u00e1n":[2,3,4],"t\u00e9rmino":[6,7],"tambi\u00e9n":[6,7],"true":[2,3,4,5],"vac\u00edo":[3,4],"var\u00edan":[6,7],Los:[2,3,4],absoluta:[2,4],acelera:[6,7],acelerando:[6,7],acotada:[2,3,4,5],acotado:[3,4,6,7],activ:[2,4],activa:[2,4],activar:[2,4],actual:[2,3,4,6,7],actualiza:[2,4,6,7],actualizar:[3,4,6,7],adaptacion:[6,7],adecuada:[6,7],adecuado:[6,7],adquirir:[6,7],alcanza:[6,7],alcanzar:[6,7],aleatoria:[6,7],aleatorio:[3,4,6,7],algoritmo:[0,2,4],alguna:[2,3,4,6,7],almacena:[6,7],alta:[6,7],alternativa:[6,7],ani:5,anim:5,animado:5,animation_fram:5,anterior:[2,3,4,6,7],apartado:[6,7],aporta:[6,7],append:5,arang:5,argumento:[2,3,4],arrai:[3,4],atributo:[3,4],aumenta:[6,7],aun:[6,7],aunqu:[6,7],avanza:[6,7],avanzan:[6,7],banco:[6,7],bandada:[6,7],blit:5,bool:[2,3,4],c_1:[6,7],c_1r_1:[6,7],c_2:[6,7],c_2r_2:[6,7],cada:[2,3,4,6,7],calculada:[6,7],calculando:[3,4],calcular:[6,7],cambio:[2,4],capacidad:[6,7],caso:[2,4],cero:[6,7],cierto:[6,7],clase:[2,3,4],class_enjambr:[2,4],class_particula:[3,4],clear:5,cmap:5,codico:7,coeficient:[2,3,4,6,7],cognitiva:[6,7],cognitivo:[2,3,4,6,7],coincid:[3,4],colectivo:[6,7],combinar:[6,7],combinarla:[6,7],como:[2,4,6,7],compara:[3,4],component:[6,7],comportamiento:[6,7],comprend:[6,7],con:[2,3,4,6,7],concat:5,conoc:[6,7],conocen:[6,7],conocimiento:[6,7],consecutiva:[2,4],conseguirs:[6,7],considerar:[2,4],consist:[6,7],consta:[1,6,7],contenido:0,contour:5,contrario:[6,7],converg:[6,7],convergencia:[6,7],copi:5,core:[2,4],correspondient:[6,7],cos:[2,4,5],crea:[2,4,6,7],creada:[3,4],crean:[2,4],crear:[0,2,3,4],criterio:[6,7],cual:[6,7],cuando:[6,7],cuanto:[6,7],cuenta:7,cumpl:[6,7],datafram:[2,4,5],datetim:5,debe:[2,4],decir:[6,7],decision:[6,7],def:[2,3,4,5],defecto:[2,4],definen:[2,3,4],definida:[3,4,6,7],del:[2,3,4,6,7],dependiendo:[2,3,4],desacelerando:[6,7],desarrollada:[6,7],descargars:[6,7],describ:[6,7],describen:[6,7],desea:[2,4],desplaza:[6,7],detal:[6,7],determinada:[6,7],detien:[2,4],df_posicion:5,df_posiciones_i:5,df_temp:5,diferencia:[2,4],diferencia_ab:[2,4],diferenciar:[6,7],dificulta:[6,7],dispon:[3,4,6,7],distinto:[3,4,6,7],documento:[6,7],dond:[2,4,6,7],dos:1,durant:[2,4],efecto:[6,7],eficient:[6,7],ejecuta:[3,4],ejemplo:[0,2,3,4,7],elemento:[6,7],ello:[6,7],empleando:[6,7],emplear:[2,3,4],encontrada:[6,7],encontrado:[2,4],encontrar:[6,7],encuentra:[3,4,5,6,7],enjambr:[0,1,3,5,6,7],entr:[2,4,5,6,7],esa:[6,7],escalar:[6,7],escapar:[6,7],escenario:[6,7],ese:[6,7],espacio:[6,7],est:[2,3,4,6,7],esta:[2,3,4,6,7],estado:[2,4,6,7],estar:[3,4,6,7],esto:[2,3,4,6,7],estrategia:[6,7],estructura:[6,7],etapa:[6,7],evaluada:[6,7],evaluar:[0,2,3,4],evaluar_enjambr:[2,4],evaluar_particula:[3,4],exampl:[2,3,4],exced:[6,7],except:[2,3,4],excesivament:[6,7],existen:[6,7],exp:[2,4,5],explicativa:[6,7],explorar:[6,7],exploratorio:[6,7],extraer_posicion:5,fals:[2,3,4,5],favoreciendo:[6,7],fig:5,figsiz:5,figur:5,finalment:[6,7],floar:[2,4],fluctuacion:[6,7],forma:[6,7],frac:[6,7],frame:[2,4],from:5,funcanim:5,funcion:[6,7],funcion_objetivo:[2,3,4,5],funcionamiento:[6,7],general:[6,7],generar:[6,7],global:[2,4,5,6,7],hacia:[6,7],haciendo:[6,7],hai:[2,4],han:[6,7],hasta:[2,3,4,6,7],hat:[6,7],head:5,hecho:[6,7],historico_mejor_posicion:[2,4],historico_mejor_valor:[2,4],historico_particula:[2,4,5],hola:7,identifica:[2,4],identificar:[6,7],ignorado:[2,4],igual:[6,7],implementan:[6,7],implica:[3,4,6,7],important:[6,7],impuesto:[6,7],incapac:[6,7],independencia:[6,7],index:[0,5],indica:[2,4,6,7],individual:[6,7],individuo:[6,7],inercia:[2,3,4,5,6,7],inercia_max:[2,4,5],inercia_min:[2,4,5],inferior:[2,3,4,6,7],inici:[2,3,4,6,7],inicia:[6,7],iniciada:[6,7],inspirado:[6,7],interpretars:[6,7],investigacion:[6,7],iter_optimizacion:[2,4],iteracion:[2,4,5,6,7],largo:[6,7],las:[2,3,4,6,7],len:5,lentitud:[6,7],les:[6,7],limitar:[6,7],limites_inf:[2,3,4,5],limites_sup:[2,3,4,5],lineal:[6,7],link:[6,7],linspac:5,list:[2,3,4,5],lista:[2,4],lista_df_temp:5,lleva:[6,7],local:[2,4,5,6,7],longitud:[3,4,6,7],los:[2,3,4,6,7],lugar:[6,7],m_iteracion:[2,4],magnitud:[6,7],manten:[6,7],map:5,matplotlib:5,max:[6,7],maximizar:[2,3,4,6,7],mayor:[2,3,4,6,7],medida:[6,7],mejor:[2,3,4,6,7],mejor_p_enjambr:[3,4],mejor_particula:[2,4],mejor_posicion:[3,4],mejor_valor:[2,3,4],mejor_valor_enjambr:5,mejora:[2,4],mejorando:[6,7],menor:[2,3,4,6,7],meshgrid:5,method:[2,3,4],min:[6,7],minimizar:[2,3,4,5,6,7],minimo:[2,4,5],modifica:[3,4],modul:0,momento:[2,3,4,6,7],mostrar:[2,3,4],mostrar_particula:[2,4],mover:[0,3,4],mover_enjambr:[2,4],mover_particula:[3,4],movers:[6,7],movimiento:[3,4,6,7],mucha:[6,7],muestra:[2,4,6,7],muestran:[2,4],muev:[2,4,6,7],multiplicar:[6,7],n_iteracion:[2,4,5],n_particula:[2,4,5],n_variabl:[2,3,4,5],narrai:[2,3,4],ndarrai:[2,3,4],necesario:[6,7],none:[2,3,4],normalment:[6,7],nueva:[2,3,4,6,7],num:5,numero:[2,4],numpi:[2,3,4,5,7],object:[2,4],objetivo:[3,4,5,6,7],obligada:[6,7],obtenido:[6,7],ocupa:[6,7],optim:[6,7],optimizacion:[2,3,4,5],optimizado:[2,4],optimizar:[2,3,4,5,6,7],optimizars:[6,7],option:[2,3,4],orientado:[6,7],otorga:[6,7],page:0,panda:[2,4,5],pantalla:[2,3,4],para:[2,3,4,5,6,7],parada:[2,4,6,7],parada_temprana:[2,4,5],paramet:[2,3,4],part:[3,4,6,7],particl:[6,7],particula:[0,1,2,5],paso:[6,7],past:7,pece:[6,7],permit:[3,4,6,7],pero:[6,7],peso_cognitivo:[2,3,4,5],peso_soci:[2,3,4,5],plot:5,plotly_express:5,plt:5,poder:[6,7],por:[2,3,4,6,7],posibl:[3,4,6,7],posicion:[3,4,5],posicion_optima:[2,4],predefinir:[2,3,4],pretend:[6,7],primera:[2,4,6,7],principal:[6,7],print:7,problema:[6,7],proceso:[2,3,4,6,7],proporciona:[6,7],pso:[2,3,4,6,7],pued:[3,4,6,7],pyplot:5,python:7,que:[2,3,4,5,6,7],quier:[2,3,4,5],r_1:[6,7],r_2:[6,7],rais:[2,3,4],random:5,range_i:5,range_x:5,rango:[3,4,6,7],rdgy:5,realiza:[2,4],recomendado:[6,7],reduc:[6,7],reduc_inercia:[2,4,5],reduc_min:[2,4],reduciendo:[6,7],registro:[6,7],regular:[6,7],reinicia:[6,7],relaciona:[6,7],relativa:[6,7],remplazado:[2,3,4],repeat:5,representa:[3,4,6,7],resolverlo:[6,7],respecto:[2,4,6,7],respons:[6,7],resto:[3,4,6,7],resulta:[6,7],resultado:[3,4,6,7],resultados_df:[2,4,5],retrasar:[6,7],riesgo:[6,7],rondas_parada:[2,4,5],salga:[3,4],salirs:[6,7],scatter:5,sea:[6,7],sean:[6,7],search:0,self:[2,4],ser:[6,7],show:5,sido:[2,4],siendo:[6,7],sigu:[6,7],siguient:[6,7],sin:[2,4,5],sobr:[3,4,6,7],sobrescrib:[6,7],social:[2,3,4,6,7],solo:[2,3,4,6,7],solucion:[6,7],son:[2,4,6,7],sourc:[2,3,4],start:5,stop:5,suel:[6,7],suelen:[6,7],superior:[2,3,4,6,7],sus:[2,4],swarm:[6,7],tabla:0,tal:[2,4],temprana:[2,4],tener:[2,4],tenido:[2,3,4],teniendo:7,tien:[2,4,5,6,7],tienda:[6,7],tienen:[6,7],time:5,toda:[2,4,6,7],todo:[3,4,6,7],tolerancia_parada:[2,4,5],tolist:5,toma:[3,4],traduc:[6,7],trata:[6,7],tre:[6,7],type:[2,3,4],una:[2,3,4,6,7],uno:[6,7],v_i:[6,7],valor:[2,3,4,6,7],valor_optimo:[2,4],valorqu:[2,4],valu:5,variabl:[2,3,4,6,7],variacion:[6,7],vector:[6,7],velocidad:[3,4,6,7],verbos:[2,3,4,5],version:[6,7],vez:[6,7],volver:[6,7],w_t:6,warn:5,wv_i:[6,7],x_0:[2,3,4,5],x_1:[2,3,4,5],x_2:[2,3,4],x_i:[6,7],xlim:5,ylim:5,zona:[3,4,6,7]},titles:["OPTIMIZACI\u00d3N PSO CON PYTHON","Clases del optimizador","Enjambre","Particula","C\u00f3digo Python","Ejemplos","Introducci\u00f3n","Introducci\u00f3n"],titleterms:{"c\u00f3digo":4,"introducci\u00f3n":[6,7],"optimizaci\u00f3n":0,"part\u00edcula":[6,7],algoritmo:[6,7],clase:1,con:0,crear:[6,7],del:1,ejemplo:5,enjambr:[2,4],evaluar:[6,7],indic:0,mover:[6,7],optimizador:1,particula:[3,4],pso:0,python:[0,4],tabl:0}}) -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var bbox = span.getBBox(); 91 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | var parentOfText = node.parentNode.parentNode; 98 | addItems.push({ 99 | "parent": node.parentNode, 100 | "target": rect}); 101 | } 102 | } 103 | } 104 | else if (!jQuery(node).is("button, select, textarea")) { 105 | jQuery.each(node.childNodes, function() { 106 | highlight(this, addItems); 107 | }); 108 | } 109 | } 110 | var addItems = []; 111 | var result = this.each(function() { 112 | highlight(this, addItems); 113 | }); 114 | for (var i = 0; i < addItems.length; ++i) { 115 | jQuery(addItems[i].parent).before(addItems[i].target); 116 | } 117 | return result; 118 | }; 119 | 120 | /* 121 | * backward compatibility for jQuery.browser 122 | * This will be supported until firefox bug is fixed. 123 | */ 124 | if (!jQuery.browser) { 125 | jQuery.uaMatch = function(ua) { 126 | ua = ua.toLowerCase(); 127 | 128 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 129 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 130 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 131 | /(msie) ([\w.]+)/.exec(ua) || 132 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 133 | []; 134 | 135 | return { 136 | browser: match[ 1 ] || "", 137 | version: match[ 2 ] || "0" 138 | }; 139 | }; 140 | jQuery.browser = {}; 141 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 142 | } 143 | 144 | /** 145 | * Small JavaScript module for the documentation. 146 | */ 147 | var Documentation = { 148 | 149 | init : function() { 150 | this.fixFirefoxAnchorBug(); 151 | this.highlightSearchWords(); 152 | this.initIndexTable(); 153 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 154 | this.initOnKeyListeners(); 155 | } 156 | }, 157 | 158 | /** 159 | * i18n support 160 | */ 161 | TRANSLATIONS : {}, 162 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 163 | LOCALE : 'unknown', 164 | 165 | // gettext and ngettext don't access this so that the functions 166 | // can safely bound to a different name (_ = Documentation.gettext) 167 | gettext : function(string) { 168 | var translated = Documentation.TRANSLATIONS[string]; 169 | if (typeof translated === 'undefined') 170 | return string; 171 | return (typeof translated === 'string') ? translated : translated[0]; 172 | }, 173 | 174 | ngettext : function(singular, plural, n) { 175 | var translated = Documentation.TRANSLATIONS[singular]; 176 | if (typeof translated === 'undefined') 177 | return (n == 1) ? singular : plural; 178 | return translated[Documentation.PLURALEXPR(n)]; 179 | }, 180 | 181 | addTranslations : function(catalog) { 182 | for (var key in catalog.messages) 183 | this.TRANSLATIONS[key] = catalog.messages[key]; 184 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 185 | this.LOCALE = catalog.locale; 186 | }, 187 | 188 | /** 189 | * add context elements like header anchor links 190 | */ 191 | addContextElements : function() { 192 | $('div[id] > :header:first').each(function() { 193 | $('\u00B6'). 194 | attr('href', '#' + this.id). 195 | attr('title', _('Permalink to this headline')). 196 | appendTo(this); 197 | }); 198 | $('dt[id]').each(function() { 199 | $('\u00B6'). 200 | attr('href', '#' + this.id). 201 | attr('title', _('Permalink to this definition')). 202 | appendTo(this); 203 | }); 204 | }, 205 | 206 | /** 207 | * workaround a firefox stupidity 208 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 209 | */ 210 | fixFirefoxAnchorBug : function() { 211 | if (document.location.hash && $.browser.mozilla) 212 | window.setTimeout(function() { 213 | document.location.href += ''; 214 | }, 10); 215 | }, 216 | 217 | /** 218 | * highlight the search words provided in the url in the text 219 | */ 220 | highlightSearchWords : function() { 221 | var params = $.getQueryParameters(); 222 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 223 | if (terms.length) { 224 | var body = $('div.body'); 225 | if (!body.length) { 226 | body = $('body'); 227 | } 228 | window.setTimeout(function() { 229 | $.each(terms, function() { 230 | body.highlightText(this.toLowerCase(), 'highlighted'); 231 | }); 232 | }, 10); 233 | $('') 235 | .appendTo($('#searchbox')); 236 | } 237 | }, 238 | 239 | /** 240 | * init the domain index toggle buttons 241 | */ 242 | initIndexTable : function() { 243 | var togglers = $('img.toggler').click(function() { 244 | var src = $(this).attr('src'); 245 | var idnum = $(this).attr('id').substr(7); 246 | $('tr.cg-' + idnum).toggle(); 247 | if (src.substr(-9) === 'minus.png') 248 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 249 | else 250 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 251 | }).css('display', ''); 252 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 253 | togglers.click(); 254 | } 255 | }, 256 | 257 | /** 258 | * helper function to hide the search marks again 259 | */ 260 | hideSearchWords : function() { 261 | $('#searchbox .highlight-link').fadeOut(300); 262 | $('span.highlighted').removeClass('highlighted'); 263 | }, 264 | 265 | /** 266 | * make the url absolute 267 | */ 268 | makeURL : function(relativeURL) { 269 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 270 | }, 271 | 272 | /** 273 | * get the current relative url 274 | */ 275 | getCurrentURL : function() { 276 | var path = document.location.pathname; 277 | var parts = path.split(/\//); 278 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 279 | if (this === '..') 280 | parts.pop(); 281 | }); 282 | var url = parts.join('/'); 283 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 284 | }, 285 | 286 | initOnKeyListeners: function() { 287 | $(document).keyup(function(event) { 288 | var activeElementType = document.activeElement.tagName; 289 | // don't navigate when in search box or textarea 290 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 291 | switch (event.keyCode) { 292 | case 37: // left 293 | var prevHref = $('link[rel="prev"]').prop('href'); 294 | if (prevHref) { 295 | window.location.href = prevHref; 296 | return false; 297 | } 298 | case 39: // right 299 | var nextHref = $('link[rel="next"]').prop('href'); 300 | if (nextHref) { 301 | window.location.href = nextHref; 302 | return false; 303 | } 304 | } 305 | } 306 | }); 307 | } 308 | }; 309 | 310 | // quick alias for translations 311 | _ = Documentation.gettext; 312 | 313 | $(document).ready(function() { 314 | Documentation.init(); 315 | }); 316 | -------------------------------------------------------------------------------- /docs/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; 14 | 15 | 16 | /* Non-minified version JS is _stemmer.js if file is provided */ 17 | /** 18 | * Porter Stemmer 19 | */ 20 | var Stemmer = function() { 21 | 22 | var step2list = { 23 | ational: 'ate', 24 | tional: 'tion', 25 | enci: 'ence', 26 | anci: 'ance', 27 | izer: 'ize', 28 | bli: 'ble', 29 | alli: 'al', 30 | entli: 'ent', 31 | eli: 'e', 32 | ousli: 'ous', 33 | ization: 'ize', 34 | ation: 'ate', 35 | ator: 'ate', 36 | alism: 'al', 37 | iveness: 'ive', 38 | fulness: 'ful', 39 | ousness: 'ous', 40 | aliti: 'al', 41 | iviti: 'ive', 42 | biliti: 'ble', 43 | logi: 'log' 44 | }; 45 | 46 | var step3list = { 47 | icate: 'ic', 48 | ative: '', 49 | alize: 'al', 50 | iciti: 'ic', 51 | ical: 'ic', 52 | ful: '', 53 | ness: '' 54 | }; 55 | 56 | var c = "[^aeiou]"; // consonant 57 | var v = "[aeiouy]"; // vowel 58 | var C = c + "[^aeiouy]*"; // consonant sequence 59 | var V = v + "[aeiou]*"; // vowel sequence 60 | 61 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 62 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 63 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 64 | var s_v = "^(" + C + ")?" + v; // vowel in stem 65 | 66 | this.stemWord = function (w) { 67 | var stem; 68 | var suffix; 69 | var firstch; 70 | var origword = w; 71 | 72 | if (w.length < 3) 73 | return w; 74 | 75 | var re; 76 | var re2; 77 | var re3; 78 | var re4; 79 | 80 | firstch = w.substr(0,1); 81 | if (firstch == "y") 82 | w = firstch.toUpperCase() + w.substr(1); 83 | 84 | // Step 1a 85 | re = /^(.+?)(ss|i)es$/; 86 | re2 = /^(.+?)([^s])s$/; 87 | 88 | if (re.test(w)) 89 | w = w.replace(re,"$1$2"); 90 | else if (re2.test(w)) 91 | w = w.replace(re2,"$1$2"); 92 | 93 | // Step 1b 94 | re = /^(.+?)eed$/; 95 | re2 = /^(.+?)(ed|ing)$/; 96 | if (re.test(w)) { 97 | var fp = re.exec(w); 98 | re = new RegExp(mgr0); 99 | if (re.test(fp[1])) { 100 | re = /.$/; 101 | w = w.replace(re,""); 102 | } 103 | } 104 | else if (re2.test(w)) { 105 | var fp = re2.exec(w); 106 | stem = fp[1]; 107 | re2 = new RegExp(s_v); 108 | if (re2.test(stem)) { 109 | w = stem; 110 | re2 = /(at|bl|iz)$/; 111 | re3 = new RegExp("([^aeiouylsz])\\1$"); 112 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 113 | if (re2.test(w)) 114 | w = w + "e"; 115 | else if (re3.test(w)) { 116 | re = /.$/; 117 | w = w.replace(re,""); 118 | } 119 | else if (re4.test(w)) 120 | w = w + "e"; 121 | } 122 | } 123 | 124 | // Step 1c 125 | re = /^(.+?)y$/; 126 | if (re.test(w)) { 127 | var fp = re.exec(w); 128 | stem = fp[1]; 129 | re = new RegExp(s_v); 130 | if (re.test(stem)) 131 | w = stem + "i"; 132 | } 133 | 134 | // Step 2 135 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 136 | if (re.test(w)) { 137 | var fp = re.exec(w); 138 | stem = fp[1]; 139 | suffix = fp[2]; 140 | re = new RegExp(mgr0); 141 | if (re.test(stem)) 142 | w = stem + step2list[suffix]; 143 | } 144 | 145 | // Step 3 146 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 147 | if (re.test(w)) { 148 | var fp = re.exec(w); 149 | stem = fp[1]; 150 | suffix = fp[2]; 151 | re = new RegExp(mgr0); 152 | if (re.test(stem)) 153 | w = stem + step3list[suffix]; 154 | } 155 | 156 | // Step 4 157 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 158 | re2 = /^(.+?)(s|t)(ion)$/; 159 | if (re.test(w)) { 160 | var fp = re.exec(w); 161 | stem = fp[1]; 162 | re = new RegExp(mgr1); 163 | if (re.test(stem)) 164 | w = stem; 165 | } 166 | else if (re2.test(w)) { 167 | var fp = re2.exec(w); 168 | stem = fp[1] + fp[2]; 169 | re2 = new RegExp(mgr1); 170 | if (re2.test(stem)) 171 | w = stem; 172 | } 173 | 174 | // Step 5 175 | re = /^(.+?)e$/; 176 | if (re.test(w)) { 177 | var fp = re.exec(w); 178 | stem = fp[1]; 179 | re = new RegExp(mgr1); 180 | re2 = new RegExp(meq1); 181 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 182 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 183 | w = stem; 184 | } 185 | re = /ll$/; 186 | re2 = new RegExp(mgr1); 187 | if (re.test(w) && re2.test(w)) { 188 | re = /.$/; 189 | w = w.replace(re,""); 190 | } 191 | 192 | // and turn initial Y back to y 193 | if (firstch == "y") 194 | w = firstch.toLowerCase() + w.substr(1); 195 | return w; 196 | } 197 | } 198 | 199 | 200 | 201 | 202 | 203 | var splitChars = (function() { 204 | var result = {}; 205 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 206 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 207 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 208 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 209 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 210 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 211 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 212 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 213 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 214 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 215 | var i, j, start, end; 216 | for (i = 0; i < singles.length; i++) { 217 | result[singles[i]] = true; 218 | } 219 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 220 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 221 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 222 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 223 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 224 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 225 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 226 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 227 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 228 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 229 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 230 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 231 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 232 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 233 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 234 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 235 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 236 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 237 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 238 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 239 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 240 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 241 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 242 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 243 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 244 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 245 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 246 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 247 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 248 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 249 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 250 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 251 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 252 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 253 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 254 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 255 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 256 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 257 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 258 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 259 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 260 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 261 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 262 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 263 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 264 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 265 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 266 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 267 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 268 | for (i = 0; i < ranges.length; i++) { 269 | start = ranges[i][0]; 270 | end = ranges[i][1]; 271 | for (j = start; j <= end; j++) { 272 | result[j] = true; 273 | } 274 | } 275 | return result; 276 | })(); 277 | 278 | function splitQuery(query) { 279 | var result = []; 280 | var start = -1; 281 | for (var i = 0; i < query.length; i++) { 282 | if (splitChars[query.charCodeAt(i)]) { 283 | if (start !== -1) { 284 | result.push(query.slice(start, i)); 285 | start = -1; 286 | } 287 | } else if (start === -1) { 288 | start = i; 289 | } 290 | } 291 | if (start !== -1) { 292 | result.push(query.slice(start)); 293 | } 294 | return result; 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '0.0.1', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false, 10 | SEARCH_LANGUAGE_STOP_WORDS: ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"] 11 | }; 12 | 13 | 14 | 15 | /* Non-minified version JS is _stemmer.js if file is provided */ 16 | /** 17 | * Porter Stemmer 18 | */ 19 | var Stemmer = function() { 20 | 21 | var step2list = { 22 | ational: 'ate', 23 | tional: 'tion', 24 | enci: 'ence', 25 | anci: 'ance', 26 | izer: 'ize', 27 | bli: 'ble', 28 | alli: 'al', 29 | entli: 'ent', 30 | eli: 'e', 31 | ousli: 'ous', 32 | ization: 'ize', 33 | ation: 'ate', 34 | ator: 'ate', 35 | alism: 'al', 36 | iveness: 'ive', 37 | fulness: 'ful', 38 | ousness: 'ous', 39 | aliti: 'al', 40 | iviti: 'ive', 41 | biliti: 'ble', 42 | logi: 'log' 43 | }; 44 | 45 | var step3list = { 46 | icate: 'ic', 47 | ative: '', 48 | alize: 'al', 49 | iciti: 'ic', 50 | ical: 'ic', 51 | ful: '', 52 | ness: '' 53 | }; 54 | 55 | var c = "[^aeiou]"; // consonant 56 | var v = "[aeiouy]"; // vowel 57 | var C = c + "[^aeiouy]*"; // consonant sequence 58 | var V = v + "[aeiou]*"; // vowel sequence 59 | 60 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 61 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 62 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 63 | var s_v = "^(" + C + ")?" + v; // vowel in stem 64 | 65 | this.stemWord = function (w) { 66 | var stem; 67 | var suffix; 68 | var firstch; 69 | var origword = w; 70 | 71 | if (w.length < 3) 72 | return w; 73 | 74 | var re; 75 | var re2; 76 | var re3; 77 | var re4; 78 | 79 | firstch = w.substr(0,1); 80 | if (firstch == "y") 81 | w = firstch.toUpperCase() + w.substr(1); 82 | 83 | // Step 1a 84 | re = /^(.+?)(ss|i)es$/; 85 | re2 = /^(.+?)([^s])s$/; 86 | 87 | if (re.test(w)) 88 | w = w.replace(re,"$1$2"); 89 | else if (re2.test(w)) 90 | w = w.replace(re2,"$1$2"); 91 | 92 | // Step 1b 93 | re = /^(.+?)eed$/; 94 | re2 = /^(.+?)(ed|ing)$/; 95 | if (re.test(w)) { 96 | var fp = re.exec(w); 97 | re = new RegExp(mgr0); 98 | if (re.test(fp[1])) { 99 | re = /.$/; 100 | w = w.replace(re,""); 101 | } 102 | } 103 | else if (re2.test(w)) { 104 | var fp = re2.exec(w); 105 | stem = fp[1]; 106 | re2 = new RegExp(s_v); 107 | if (re2.test(stem)) { 108 | w = stem; 109 | re2 = /(at|bl|iz)$/; 110 | re3 = new RegExp("([^aeiouylsz])\\1$"); 111 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 112 | if (re2.test(w)) 113 | w = w + "e"; 114 | else if (re3.test(w)) { 115 | re = /.$/; 116 | w = w.replace(re,""); 117 | } 118 | else if (re4.test(w)) 119 | w = w + "e"; 120 | } 121 | } 122 | 123 | // Step 1c 124 | re = /^(.+?)y$/; 125 | if (re.test(w)) { 126 | var fp = re.exec(w); 127 | stem = fp[1]; 128 | re = new RegExp(s_v); 129 | if (re.test(stem)) 130 | w = stem + "i"; 131 | } 132 | 133 | // Step 2 134 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 135 | if (re.test(w)) { 136 | var fp = re.exec(w); 137 | stem = fp[1]; 138 | suffix = fp[2]; 139 | re = new RegExp(mgr0); 140 | if (re.test(stem)) 141 | w = stem + step2list[suffix]; 142 | } 143 | 144 | // Step 3 145 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 146 | if (re.test(w)) { 147 | var fp = re.exec(w); 148 | stem = fp[1]; 149 | suffix = fp[2]; 150 | re = new RegExp(mgr0); 151 | if (re.test(stem)) 152 | w = stem + step3list[suffix]; 153 | } 154 | 155 | // Step 4 156 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 157 | re2 = /^(.+?)(s|t)(ion)$/; 158 | if (re.test(w)) { 159 | var fp = re.exec(w); 160 | stem = fp[1]; 161 | re = new RegExp(mgr1); 162 | if (re.test(stem)) 163 | w = stem; 164 | } 165 | else if (re2.test(w)) { 166 | var fp = re2.exec(w); 167 | stem = fp[1] + fp[2]; 168 | re2 = new RegExp(mgr1); 169 | if (re2.test(stem)) 170 | w = stem; 171 | } 172 | 173 | // Step 5 174 | re = /^(.+?)e$/; 175 | if (re.test(w)) { 176 | var fp = re.exec(w); 177 | stem = fp[1]; 178 | re = new RegExp(mgr1); 179 | re2 = new RegExp(meq1); 180 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 181 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 182 | w = stem; 183 | } 184 | re = /ll$/; 185 | re2 = new RegExp(mgr1); 186 | if (re.test(w) && re2.test(w)) { 187 | re = /.$/; 188 | w = w.replace(re,""); 189 | } 190 | 191 | // and turn initial Y back to y 192 | if (firstch == "y") 193 | w = firstch.toLowerCase() + w.substr(1); 194 | return w; 195 | } 196 | } 197 | 198 | 199 | 200 | 201 | 202 | var splitChars = (function() { 203 | var result = {}; 204 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 205 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 206 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 207 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 208 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 209 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 210 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 211 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 212 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 213 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 214 | var i, j, start, end; 215 | for (i = 0; i < singles.length; i++) { 216 | result[singles[i]] = true; 217 | } 218 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 219 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 220 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 221 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 222 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 223 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 224 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 225 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 226 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 227 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 228 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 229 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 230 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 231 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 232 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 233 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 234 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 235 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 236 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 237 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 238 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 239 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 240 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 241 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 242 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 243 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 244 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 245 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 246 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 247 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 248 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 249 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 250 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 251 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 252 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 253 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 254 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 255 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 256 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 257 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 258 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 259 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 260 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 261 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 262 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 263 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 264 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 265 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 266 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 267 | for (i = 0; i < ranges.length; i++) { 268 | start = ranges[i][0]; 269 | end = ranges[i][1]; 270 | for (j = start; j <= end; j++) { 271 | result[j] = true; 272 | } 273 | } 274 | return result; 275 | })(); 276 | 277 | function splitQuery(query) { 278 | var result = []; 279 | var start = -1; 280 | for (var i = 0; i < query.length; i++) { 281 | if (splitChars[query.charCodeAt(i)]) { 282 | if (start !== -1) { 283 | result.push(query.slice(start, i)); 284 | start = -1; 285 | } 286 | } else if (start === -1) { 287 | start = i; 288 | } 289 | } 290 | if (start !== -1) { 291 | result.push(query.slice(start)); 292 | } 293 | return result; 294 | } 295 | 296 | 297 | -------------------------------------------------------------------------------- /docs/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox form.search { 85 | overflow: hidden; 86 | } 87 | 88 | div.sphinxsidebar #searchbox input[type="text"] { 89 | float: left; 90 | width: 80%; 91 | padding: 0.25em; 92 | box-sizing: border-box; 93 | } 94 | 95 | div.sphinxsidebar #searchbox input[type="submit"] { 96 | float: left; 97 | width: 20%; 98 | border-left: none; 99 | padding: 0.25em; 100 | box-sizing: border-box; 101 | } 102 | 103 | 104 | img { 105 | border: 0; 106 | max-width: 100%; 107 | } 108 | 109 | /* -- search page ----------------------------------------------------------- */ 110 | 111 | ul.search { 112 | margin: 10px 0 0 20px; 113 | padding: 0; 114 | } 115 | 116 | ul.search li { 117 | padding: 5px 0 5px 20px; 118 | background-image: url(file.png); 119 | background-repeat: no-repeat; 120 | background-position: 0 7px; 121 | } 122 | 123 | ul.search li a { 124 | font-weight: bold; 125 | } 126 | 127 | ul.search li div.context { 128 | color: #888; 129 | margin: 2px 0 0 30px; 130 | text-align: left; 131 | } 132 | 133 | ul.keywordmatches li.goodmatch a { 134 | font-weight: bold; 135 | } 136 | 137 | /* -- index page ------------------------------------------------------------ */ 138 | 139 | table.contentstable { 140 | width: 90%; 141 | margin-left: auto; 142 | margin-right: auto; 143 | } 144 | 145 | table.contentstable p.biglink { 146 | line-height: 150%; 147 | } 148 | 149 | a.biglink { 150 | font-size: 1.3em; 151 | } 152 | 153 | span.linkdescr { 154 | font-style: italic; 155 | padding-top: 5px; 156 | font-size: 90%; 157 | } 158 | 159 | /* -- general index --------------------------------------------------------- */ 160 | 161 | table.indextable { 162 | width: 100%; 163 | } 164 | 165 | table.indextable td { 166 | text-align: left; 167 | vertical-align: top; 168 | } 169 | 170 | table.indextable ul { 171 | margin-top: 0; 172 | margin-bottom: 0; 173 | list-style-type: none; 174 | } 175 | 176 | table.indextable > tbody > tr > td > ul { 177 | padding-left: 0em; 178 | } 179 | 180 | table.indextable tr.pcap { 181 | height: 10px; 182 | } 183 | 184 | table.indextable tr.cap { 185 | margin-top: 10px; 186 | background-color: #f2f2f2; 187 | } 188 | 189 | img.toggler { 190 | margin-right: 3px; 191 | margin-top: 3px; 192 | cursor: pointer; 193 | } 194 | 195 | div.modindex-jumpbox { 196 | border-top: 1px solid #ddd; 197 | border-bottom: 1px solid #ddd; 198 | margin: 1em 0 1em 0; 199 | padding: 0.4em; 200 | } 201 | 202 | div.genindex-jumpbox { 203 | border-top: 1px solid #ddd; 204 | border-bottom: 1px solid #ddd; 205 | margin: 1em 0 1em 0; 206 | padding: 0.4em; 207 | } 208 | 209 | /* -- domain module index --------------------------------------------------- */ 210 | 211 | table.modindextable td { 212 | padding: 2px; 213 | border-collapse: collapse; 214 | } 215 | 216 | /* -- general body styles --------------------------------------------------- */ 217 | 218 | div.body { 219 | min-width: 450px; 220 | max-width: 800px; 221 | } 222 | 223 | div.body p, div.body dd, div.body li, div.body blockquote { 224 | -moz-hyphens: auto; 225 | -ms-hyphens: auto; 226 | -webkit-hyphens: auto; 227 | hyphens: auto; 228 | } 229 | 230 | a.headerlink { 231 | visibility: hidden; 232 | } 233 | 234 | h1:hover > a.headerlink, 235 | h2:hover > a.headerlink, 236 | h3:hover > a.headerlink, 237 | h4:hover > a.headerlink, 238 | h5:hover > a.headerlink, 239 | h6:hover > a.headerlink, 240 | dt:hover > a.headerlink, 241 | caption:hover > a.headerlink, 242 | p.caption:hover > a.headerlink, 243 | div.code-block-caption:hover > a.headerlink { 244 | visibility: visible; 245 | } 246 | 247 | div.body p.caption { 248 | text-align: inherit; 249 | } 250 | 251 | div.body td { 252 | text-align: left; 253 | } 254 | 255 | .first { 256 | margin-top: 0 !important; 257 | } 258 | 259 | p.rubric { 260 | margin-top: 30px; 261 | font-weight: bold; 262 | } 263 | 264 | img.align-left, .figure.align-left, object.align-left { 265 | clear: left; 266 | float: left; 267 | margin-right: 1em; 268 | } 269 | 270 | img.align-right, .figure.align-right, object.align-right { 271 | clear: right; 272 | float: right; 273 | margin-left: 1em; 274 | } 275 | 276 | img.align-center, .figure.align-center, object.align-center { 277 | display: block; 278 | margin-left: auto; 279 | margin-right: auto; 280 | } 281 | 282 | .align-left { 283 | text-align: left; 284 | } 285 | 286 | .align-center { 287 | text-align: center; 288 | } 289 | 290 | .align-right { 291 | text-align: right; 292 | } 293 | 294 | /* -- sidebars -------------------------------------------------------------- */ 295 | 296 | div.sidebar { 297 | margin: 0 0 0.5em 1em; 298 | border: 1px solid #ddb; 299 | padding: 7px 7px 0 7px; 300 | background-color: #ffe; 301 | width: 40%; 302 | float: right; 303 | } 304 | 305 | p.sidebar-title { 306 | font-weight: bold; 307 | } 308 | 309 | /* -- topics ---------------------------------------------------------------- */ 310 | 311 | div.topic { 312 | border: 1px solid #ccc; 313 | padding: 7px 7px 0 7px; 314 | margin: 10px 0 10px 0; 315 | } 316 | 317 | p.topic-title { 318 | font-size: 1.1em; 319 | font-weight: bold; 320 | margin-top: 10px; 321 | } 322 | 323 | /* -- admonitions ----------------------------------------------------------- */ 324 | 325 | div.admonition { 326 | margin-top: 10px; 327 | margin-bottom: 10px; 328 | padding: 7px; 329 | } 330 | 331 | div.admonition dt { 332 | font-weight: bold; 333 | } 334 | 335 | div.admonition dl { 336 | margin-bottom: 0; 337 | } 338 | 339 | p.admonition-title { 340 | margin: 0px 10px 5px 0px; 341 | font-weight: bold; 342 | } 343 | 344 | div.body p.centered { 345 | text-align: center; 346 | margin-top: 25px; 347 | } 348 | 349 | /* -- tables ---------------------------------------------------------------- */ 350 | 351 | table.docutils { 352 | border: 0; 353 | border-collapse: collapse; 354 | } 355 | 356 | table.align-center { 357 | margin-left: auto; 358 | margin-right: auto; 359 | } 360 | 361 | table caption span.caption-number { 362 | font-style: italic; 363 | } 364 | 365 | table caption span.caption-text { 366 | } 367 | 368 | table.docutils td, table.docutils th { 369 | padding: 1px 8px 1px 5px; 370 | border-top: 0; 371 | border-left: 0; 372 | border-right: 0; 373 | border-bottom: 1px solid #aaa; 374 | } 375 | 376 | table.footnote td, table.footnote th { 377 | border: 0 !important; 378 | } 379 | 380 | th { 381 | text-align: left; 382 | padding-right: 5px; 383 | } 384 | 385 | table.citation { 386 | border-left: solid 1px gray; 387 | margin-left: 1px; 388 | } 389 | 390 | table.citation td { 391 | border-bottom: none; 392 | } 393 | 394 | /* -- figures --------------------------------------------------------------- */ 395 | 396 | div.figure { 397 | margin: 0.5em; 398 | padding: 0.5em; 399 | } 400 | 401 | div.figure p.caption { 402 | padding: 0.3em; 403 | } 404 | 405 | div.figure p.caption span.caption-number { 406 | font-style: italic; 407 | } 408 | 409 | div.figure p.caption span.caption-text { 410 | } 411 | 412 | /* -- field list styles ----------------------------------------------------- */ 413 | 414 | table.field-list td, table.field-list th { 415 | border: 0 !important; 416 | } 417 | 418 | .field-list ul { 419 | margin: 0; 420 | padding-left: 1em; 421 | } 422 | 423 | .field-list p { 424 | margin: 0; 425 | } 426 | 427 | .field-name { 428 | -moz-hyphens: manual; 429 | -ms-hyphens: manual; 430 | -webkit-hyphens: manual; 431 | hyphens: manual; 432 | } 433 | 434 | /* -- hlist styles ---------------------------------------------------------- */ 435 | 436 | table.hlist td { 437 | vertical-align: top; 438 | } 439 | 440 | 441 | /* -- other body styles ----------------------------------------------------- */ 442 | 443 | ol.arabic { 444 | list-style: decimal; 445 | } 446 | 447 | ol.loweralpha { 448 | list-style: lower-alpha; 449 | } 450 | 451 | ol.upperalpha { 452 | list-style: upper-alpha; 453 | } 454 | 455 | ol.lowerroman { 456 | list-style: lower-roman; 457 | } 458 | 459 | ol.upperroman { 460 | list-style: upper-roman; 461 | } 462 | 463 | dl { 464 | margin-bottom: 15px; 465 | } 466 | 467 | dd p { 468 | margin-top: 0px; 469 | } 470 | 471 | dd ul, dd table { 472 | margin-bottom: 10px; 473 | } 474 | 475 | dd { 476 | margin-top: 3px; 477 | margin-bottom: 10px; 478 | margin-left: 30px; 479 | } 480 | 481 | dt:target, span.highlighted { 482 | background-color: #fbe54e; 483 | } 484 | 485 | rect.highlighted { 486 | fill: #fbe54e; 487 | } 488 | 489 | dl.glossary dt { 490 | font-weight: bold; 491 | font-size: 1.1em; 492 | } 493 | 494 | .optional { 495 | font-size: 1.3em; 496 | } 497 | 498 | .sig-paren { 499 | font-size: larger; 500 | } 501 | 502 | .versionmodified { 503 | font-style: italic; 504 | } 505 | 506 | .system-message { 507 | background-color: #fda; 508 | padding: 5px; 509 | border: 3px solid red; 510 | } 511 | 512 | .footnote:target { 513 | background-color: #ffa; 514 | } 515 | 516 | .line-block { 517 | display: block; 518 | margin-top: 1em; 519 | margin-bottom: 1em; 520 | } 521 | 522 | .line-block .line-block { 523 | margin-top: 0; 524 | margin-bottom: 0; 525 | margin-left: 1.5em; 526 | } 527 | 528 | .guilabel, .menuselection { 529 | font-family: sans-serif; 530 | } 531 | 532 | .accelerator { 533 | text-decoration: underline; 534 | } 535 | 536 | .classifier { 537 | font-style: oblique; 538 | } 539 | 540 | abbr, acronym { 541 | border-bottom: dotted 1px; 542 | cursor: help; 543 | } 544 | 545 | /* -- code displays --------------------------------------------------------- */ 546 | 547 | pre { 548 | overflow: auto; 549 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 550 | } 551 | 552 | span.pre { 553 | -moz-hyphens: none; 554 | -ms-hyphens: none; 555 | -webkit-hyphens: none; 556 | hyphens: none; 557 | } 558 | 559 | td.linenos pre { 560 | padding: 5px 0px; 561 | border: 0; 562 | background-color: transparent; 563 | color: #aaa; 564 | } 565 | 566 | table.highlighttable { 567 | margin-left: 0.5em; 568 | } 569 | 570 | table.highlighttable td { 571 | padding: 0 0.5em 0 0.5em; 572 | } 573 | 574 | div.code-block-caption { 575 | padding: 2px 5px; 576 | font-size: small; 577 | } 578 | 579 | div.code-block-caption code { 580 | background-color: transparent; 581 | } 582 | 583 | div.code-block-caption + div > div.highlight > pre { 584 | margin-top: 0; 585 | } 586 | 587 | div.code-block-caption span.caption-number { 588 | padding: 0.1em 0.3em; 589 | font-style: italic; 590 | } 591 | 592 | div.code-block-caption span.caption-text { 593 | } 594 | 595 | div.literal-block-wrapper { 596 | padding: 1em 1em 0; 597 | } 598 | 599 | div.literal-block-wrapper div.highlight { 600 | margin: 0; 601 | } 602 | 603 | code.descname { 604 | background-color: transparent; 605 | font-weight: bold; 606 | font-size: 1.2em; 607 | } 608 | 609 | code.descclassname { 610 | background-color: transparent; 611 | } 612 | 613 | code.xref, a code { 614 | background-color: transparent; 615 | font-weight: bold; 616 | } 617 | 618 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 619 | background-color: transparent; 620 | } 621 | 622 | .viewcode-link { 623 | float: right; 624 | } 625 | 626 | .viewcode-back { 627 | float: right; 628 | font-family: sans-serif; 629 | } 630 | 631 | div.viewcode-block:target { 632 | margin: -1px -10px; 633 | padding: 0 10px; 634 | } 635 | 636 | /* -- math display ---------------------------------------------------------- */ 637 | 638 | img.math { 639 | vertical-align: middle; 640 | } 641 | 642 | div.body div.math p { 643 | text-align: center; 644 | } 645 | 646 | span.eqno { 647 | float: right; 648 | } 649 | 650 | span.eqno a.headerlink { 651 | position: relative; 652 | left: 0px; 653 | z-index: 1; 654 | } 655 | 656 | div.math:hover a.headerlink { 657 | visibility: visible; 658 | } 659 | 660 | /* -- printout stylesheet --------------------------------------------------- */ 661 | 662 | @media print { 663 | div.document, 664 | div.documentwrapper, 665 | div.bodywrapper { 666 | margin: 0 !important; 667 | width: 100%; 668 | } 669 | 670 | div.sphinxsidebar, 671 | div.related, 672 | div.footer, 673 | #top-link { 674 | display: none; 675 | } 676 | } -------------------------------------------------------------------------------- /docs/_static/js/modernizr.min.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Index — Optimización PSO 0.0.1 documentation 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 99 | 100 |
101 | 102 | 103 | 109 | 110 | 111 |
112 | 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
132 | 133 |
    134 | 135 |
  • Docs »
  • 136 | 137 |
  • Index
  • 138 | 139 | 140 |
  • 141 | 142 | 143 | 144 |
  • 145 | 146 |
147 | 148 | 149 |
150 |
151 |
152 |
153 | 154 | 155 |

Index

156 | 157 |
158 | D 159 | | E 160 | | H 161 | | I 162 | | L 163 | | M 164 | | N 165 | | O 166 | | P 167 | | R 168 | | V 169 | 170 |
171 |

D

172 | 173 | 177 |
178 | 179 |

E

180 | 181 | 185 | 191 |
192 | 193 |

H

194 | 195 | 199 | 205 |
206 | 207 |

I

208 | 209 | 213 |
214 | 215 |

L

216 | 217 | 225 | 233 |
234 | 235 |

M

236 | 237 | 249 | 257 |
258 | 259 |

N

260 | 261 | 265 | 273 |
274 | 275 |

O

276 | 277 | 281 | 285 |
286 | 287 |

P

288 | 289 | 297 | 305 |
306 | 307 |

R

308 | 309 | 313 |
314 | 315 |

V

316 | 317 | 321 | 327 |
328 | 329 | 330 | 331 |
332 | 333 |
334 |
335 | 336 | 337 |
338 | 339 |
340 |

341 | © Copyright 2019, Joaquín Amat Rodrigo 342 | 343 |

344 |
345 | Built with Sphinx using a theme provided by Read the Docs. 346 | 347 |
348 | 349 |
350 |
351 | 352 |
353 | 354 |
355 | 356 | 357 | 358 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | -------------------------------------------------------------------------------- /docs/_static/searchtools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * searchtools.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for the full-text search. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | if (!Scorer) { 13 | /** 14 | * Simple result scoring code. 15 | */ 16 | var Scorer = { 17 | // Implement the following function to further tweak the score for each result 18 | // The function takes a result array [filename, title, anchor, descr, score] 19 | // and returns the new score. 20 | /* 21 | score: function(result) { 22 | return result[4]; 23 | }, 24 | */ 25 | 26 | // query matches the full name of an object 27 | objNameMatch: 11, 28 | // or matches in the last dotted part of the object name 29 | objPartialMatch: 6, 30 | // Additive scores depending on the priority of the object 31 | objPrio: {0: 15, // used to be importantResults 32 | 1: 5, // used to be objectResults 33 | 2: -5}, // used to be unimportantResults 34 | // Used when the priority is not in the mapping. 35 | objPrioDefault: 0, 36 | 37 | // query found in title 38 | title: 15, 39 | // query found in terms 40 | term: 5 41 | }; 42 | } 43 | 44 | if (!splitQuery) { 45 | function splitQuery(query) { 46 | return query.split(/\s+/); 47 | } 48 | } 49 | 50 | /** 51 | * Search Module 52 | */ 53 | var Search = { 54 | 55 | _index : null, 56 | _queued_query : null, 57 | _pulse_status : -1, 58 | 59 | init : function() { 60 | var params = $.getQueryParameters(); 61 | if (params.q) { 62 | var query = params.q[0]; 63 | $('input[name="q"]')[0].value = query; 64 | this.performSearch(query); 65 | } 66 | }, 67 | 68 | loadIndex : function(url) { 69 | $.ajax({type: "GET", url: url, data: null, 70 | dataType: "script", cache: true, 71 | complete: function(jqxhr, textstatus) { 72 | if (textstatus != "success") { 73 | document.getElementById("searchindexloader").src = url; 74 | } 75 | }}); 76 | }, 77 | 78 | setIndex : function(index) { 79 | var q; 80 | this._index = index; 81 | if ((q = this._queued_query) !== null) { 82 | this._queued_query = null; 83 | Search.query(q); 84 | } 85 | }, 86 | 87 | hasIndex : function() { 88 | return this._index !== null; 89 | }, 90 | 91 | deferQuery : function(query) { 92 | this._queued_query = query; 93 | }, 94 | 95 | stopPulse : function() { 96 | this._pulse_status = 0; 97 | }, 98 | 99 | startPulse : function() { 100 | if (this._pulse_status >= 0) 101 | return; 102 | function pulse() { 103 | var i; 104 | Search._pulse_status = (Search._pulse_status + 1) % 4; 105 | var dotString = ''; 106 | for (i = 0; i < Search._pulse_status; i++) 107 | dotString += '.'; 108 | Search.dots.text(dotString); 109 | if (Search._pulse_status > -1) 110 | window.setTimeout(pulse, 500); 111 | } 112 | pulse(); 113 | }, 114 | 115 | /** 116 | * perform a search for something (or wait until index is loaded) 117 | */ 118 | performSearch : function(query) { 119 | // create the required interface elements 120 | this.out = $('#search-results'); 121 | this.title = $('

' + _('Searching') + '

').appendTo(this.out); 122 | this.dots = $('').appendTo(this.title); 123 | this.status = $('

').appendTo(this.out); 124 | this.output = $('