-
Notifications
You must be signed in to change notification settings - Fork 2
/
overview.html
199 lines (189 loc) · 11.8 KB
/
overview.html
1
2
3
4
5
6
7
8
9
10
11
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview — inspyred 1.0.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="inspyred 1.0.1 documentation" href="index.html" />
<link rel="next" title="Tutorial" href="tutorial.html" />
<link rel="prev" title="inspyred: Bio-inspired Algorithms in Python" href="index.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tutorial.html" title="Tutorial"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="inspyred: Bio-inspired Algorithms in Python"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">inspyred 1.0.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="overview">
<h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h1>
<p>This chapter presents an overview of the inspyred library.</p>
<div class="section" id="bio-inspired-computation">
<h2>Bio-inspired Computation<a class="headerlink" href="#bio-inspired-computation" title="Permalink to this headline">¶</a></h2>
<p>Biologically-inspired computation encompasses a broad range of algorithms including evolutionary computation, swarm intelligence, and neural networks. These concepts are sometimes grouped together under a similar umbrella term – “computational intelligence” – which is a subfield of artificial intelligence. The common theme among all such algorithms is a decentralized, bottom-up approach which often leads to emergent properties or behaviors.</p>
</div>
<div class="section" id="design-methodology">
<h2>Design Methodology<a class="headerlink" href="#design-methodology" title="Permalink to this headline">¶</a></h2>
<p>The inspyred library grew out of insights from Ken de Jong’s book “Evolutionary Computation: A Unified Approach.” The goal of the library is to separate problem-specific computation from algorithm-specific computation. Any bio-inspired algorithm has at least two aspects that are entirely problem-specific: what solutions to the problem look like and how such solutions are evaluated. These components will certainly change from problem to problem. For instance, a problem dealing with optimizing the volume of a box might represent solutions as a three-element list of real values for the length, width, and height, respectively. In contrast, a problem dealing with optimizing a set of rules for escaping a maze might represent solutions as a list of pair of elements, where each pair contains the two-dimensional neighborhood and the action to take in such a case.</p>
<p>On the other hand, there are algorithm-specific components that may make no (or only modest) assumptions about the type of solutions upon which they operate. These components include the mechanism by which parents are selected, the way offspring are generated, and the way individuals are replaced in succeeding generations. For example, the ever-popular tournament selection scheme makes no assumptions whatsoever about the type of solutions it is selecting. The <em>n</em>-point crossover operator, on the other hand, does make an assumption that the solutions will be linear lists that can be “sliced up,” but it makes no assumptions about the contents of such lists. They could be lists of numbers, strings, other lists, or something even more exotic.</p>
<p>The central design principle for inspyred is to separate problem-specific components from algorithm-specific components in a clean way so as to make algorithms as general as possible across a range of different problems.</p>
<p>For instance, the inspyred library views evolutionary computations as being composed of the following parts:</p>
<ul class="simple">
<li>Problem-specific components<ul>
<li>A generator that defines how solutions are created</li>
<li>An evaluator that defines how fitness values are calculated for solutions</li>
</ul>
</li>
<li>Algorithm-specific evolutionary operators<ul>
<li>An observer that defines how the user can monitor the state of the evolution</li>
<li>A terminator that determines whether the evolution should end</li>
<li>A selector that determines which individuals should become parents</li>
<li>A variator that determines how offspring are created from existing individuals</li>
<li>A replacer that determines which individuals should survive into the next generation</li>
<li>A migrator that defines how solutions are transferred among different populations</li>
<li>An archiver that defines how existing solutions are stored outside of the current population</li>
</ul>
</li>
</ul>
<p>Each of these components is specified by a function (or function-like) callback that the user can supply. The general flow of the <code class="docutils literal"><span class="pre">evolve</span></code> method in inspyred is as follows, where user-supplied callback functions are in ALL-CAPS:</p>
<div class="highlight-python"><div class="highlight"><pre>Create the initial population using the specified candidate seeds and the GENERATOR
Evaluate the initial population using the EVALUATOR
Set the number of evaluations to the size of the initial population
Set the number of generations to 0
Call the OBSERVER on the initial population
While the TERMINATOR is not true Loop
Choose parents via the SELECTOR
Initialize offspring to the parents
For each VARIATOR Loop
Set offspring to the output of the VARIATOR on the offspring
Evaluate offspring using the EVALUATOR
Update the number of evaluations
Replace individuals in the current population using the REPLACER
Migrate individuals in the current population using the MIGRATOR
Archive individuals in the current population using the ARCHIVER
Increment the number of generations
Call the OBSERVER on the current population
</pre></div>
</div>
<p>The observer, terminator, and variator callbacks may be lists or tuples of functions, rather
than just a single function. In each case, the functions are called sequentially in the order
listed. Unlike the other two, however, the variator behaves like a pipeline, where the output
from one call is used as the input for the subsequent call.</p>
</div>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>The easiest way to install inspyred is to use <a class="reference external" href="http://www.pip-installer.org/en/latest/index.html">pip</a> as follows:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install inspyred
</pre></div>
</div>
<p>The Python Package Index page for inspyred is <a class="reference external" href="http://pypi.python.org/pypi/inspyred">http://pypi.python.org/pypi/inspyred</a>.</p>
<p>The source code git repository can be found at <a class="reference external" href="https://github.com/inspyred/inspyred">https://github.com/inspyred/inspyred</a>.</p>
</div>
<div class="section" id="getting-help">
<h2>Getting Help<a class="headerlink" href="#getting-help" title="Permalink to this headline">¶</a></h2>
<p>Any questions about the library and its use can be posted to the inspyred Google group at
<a class="reference external" href="https://groups.google.com/forum/#!forum/inspyred">https://groups.google.com/forum/#!forum/inspyred</a>. If a forum posting is not appropriate or desired,
questions can also be emailed directly to <a class="reference external" href="mailto:aaron.lee.garrett%40gmail.com">aaron<span>.</span>lee<span>.</span>garrett<span>@</span>gmail<span>.</span>com</a>. Feedback is always appreciated.
Please let us know how you’re using the library and any ideas you might have for enhancements.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Overview</a><ul>
<li><a class="reference internal" href="#bio-inspired-computation">Bio-inspired Computation</a></li>
<li><a class="reference internal" href="#design-methodology">Design Methodology</a></li>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#getting-help">Getting Help</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">inspyred: Bio-inspired Algorithms in Python</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="tutorial.html"
title="next chapter">Tutorial</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/overview.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tutorial.html" title="Tutorial"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="inspyred: Bio-inspired Algorithms in Python"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">inspyred 1.0.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2012, Aaron Garrett.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>