You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<divclass='caption'>Unit Tests for the Genetic Algorithm in Ruby</div>
181
-
<divclass='download_src'>Download: <ahref='tc_genetic_algorithm.rb'>tc_genetic_algorithm.rb</a>. Unit test available in the <%=natureinspired_dev_url("github project")%></div>
@@ -75,7 +75,7 @@ <h3><a name='continuous_function_optimization'>Continuous Function Optimization<
75
75
<p>
76
76
Figure (below) provides an example of the Basin function in one dimension. The Basin function is a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$. The optimal solution for this function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. Listing (below) provides the Gnuplot script used to prepare the plot ($["n=1"]$).
77
77
</p>
78
-
<imgsrc='/images/basin1.png' align='middle' alt='Plot of the Basin function in one-dimension.' class='book_image'>
78
+
<imgsrc='basin1.png' align='middle' alt='Plot of the Basin function in one-dimension.' class='book_image'>
79
79
<br/>
80
80
<divclass='caption'>Plot of the Basin function in one-dimension.</div>
81
81
@@ -88,7 +88,7 @@ <h3><a name='continuous_function_optimization'>Continuous Function Optimization<
88
88
<p>
89
89
Figure (below) provides an example of the basin function in two-dimensions as a three-dimensional surface plot. Listing (below) provides the Gnuplot script used to prepare the surface plot.
90
90
</p>
91
-
<imgsrc='/images/basin2.png' align='middle' alt='Plot of the Basin function in two-dimensions.' class='book_image'>
91
+
<imgsrc='basin2.png' align='middle' alt='Plot of the Basin function in two-dimensions.' class='book_image'>
92
92
<br/>
93
93
<divclass='caption'>Plot of the Basin function in two-dimensions.</div>
Figure (below) provides a scatter plot of the Berlin52 TSP used through out the algorithm descriptions in this book. The Berlin52 problem seeks a permutation of the order to visit cities (called a tour) that minimize the total distance traveled. The optimal tour distance for Berlin52 is 7542 units.
117
117
</p>
118
-
<imgsrc='/images/tsp1.png' align='middle' alt='Plot of the cities of the Berlin52 TSP.' class='book_image'>
118
+
<imgsrc='tsp1.png' align='middle' alt='Plot of the cities of the Berlin52 TSP.' class='book_image'>
119
119
<br/>
120
120
<divclass='caption'>Plot of the cities of the Berlin52 TSP.</div>
Figure (below) provides an example line graph, showing the quality of the best candidate solution located by the Genetic Algorithm each generation for a single run applied to a 64-bit OneMax problem. Listing (below) provides the Gnuplot script used to prepare the plot, where <code>ga1.txt</code> is a text file that provides the fitness of the best solution each algorithm iteration on a new line. Listing (below) provides a snippet of the first five lines of the <code>ga1.txt</code> file.
162
162
</p>
163
-
<imgsrc='/images/ga1.png' align='middle' alt='Line graph of the best solution found by the Genetic Algorithm.' class='book_image'>
163
+
<imgsrc='ga1.png' align='middle' alt='Line graph of the best solution found by the Genetic Algorithm.' class='book_image'>
164
164
<br/>
165
165
<divclass='caption'>Line graph of the best solution found by the Genetic Algorithm.</div>
Figure (below) provides a histogram plot showing the best solutions found and the number of times they were located by Genetic Algorithm over 100 runs on a 300-bit OneMax function.
191
191
</p>
192
-
<imgsrc='/images/ga2.png' align='middle' alt='Histogram of the best solutions found by a Genetic Algorithm.' class='book_image'>
192
+
<imgsrc='ga2.png' align='middle' alt='Histogram of the best solutions found by a Genetic Algorithm.' class='book_image'>
193
193
<br/>
194
194
<divclass='caption'>Histogram of the best solutions found by a Genetic Algorithm.</div>
195
195
@@ -228,7 +228,7 @@ <h3><a name='multiple_distributions_of_algorithm_runs'>Multiple Distributions of
228
228
<p>
229
229
Figure (below) provides box-and-whisker plots of the best score distribution of 100 runs for the Genetic Algorithm applied to a 300-bit OneMax problem with three different mutation configurations. The measure collected from each run was the quality of the best candidate solution found.
230
230
</p>
231
-
<imgsrc='/images/ga3.png' align='middle' alt='Box-and-whisker plots of the Genetic Algorithm'sperformance.' class='book_image'>
231
+
<imgsrc='ga3.png' align='middle' alt='Box-and-whisker plots of the Genetic Algorithm'sperformance.' class='book_image'>
232
232
<br/>
233
233
<divclass='caption'>Box-and-whisker plots of the Genetic Algorithm's performance.</div>
234
234
@@ -266,7 +266,7 @@ <h3><a name='continuous_function_optimization'>Continuous Function Optimization<
266
266
Listing (below) provides the Gnuplot script used to prepare the plot, where <code>pso1.txt</code> is a file that contains the coordinates of the best solution found by the algorithm, with one coordinate per line separated by a space.
267
267
Listing (below) provides a snippet of the first five lines of the <code>pso1.txt</code> file.
268
268
</p>
269
-
<imgsrc='/images/pso1.png' align='middle' alt='Heat map plot showing selected samples in the domain.' class='book_image'>
269
+
<imgsrc='pso1.png' align='middle' alt='Heat map plot showing selected samples in the domain.' class='book_image'>
270
270
<br/>
271
271
<divclass='caption'>Heat map plot showing selected samples in the domain.</div>
Figure (below) provides a plot of an example Nearest-Neighbor solution for the Berlin52 TSP. A Nearest-Neighbor solution is constructed by randomly selecting the first city in the tour then selecting the next city in the tour with the minimum distance to the current city until a complete tour is created.
306
306
</p>
307
-
<imgsrc='/images/tsp3.png' align='middle' alt='Plot of a Nearest-Neighbor tour for the Berlin52 TSP.' class='book_image'>
307
+
<imgsrc='tsp3.png' align='middle' alt='Plot of a Nearest-Neighbor tour for the Berlin52 TSP.' class='book_image'>
308
308
<br/>
309
309
<divclass='caption'>Plot of a Nearest-Neighbor tour for the Berlin52 TSP.</div>
0 commit comments