AI-SimulatedAnnealing
view release on metacpan or search on metacpan
lib/AI/SimulatedAnnealing.htm view on Meta::CPAN
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AI::SimulatedAnnealing – optimize a list of numbers
according to a specified cost function.</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link href="mailto:" rev="made"/>
</head>
<body style="background-color: white">
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#prerequisites">PREREQUISITES</a></li>
<li><a href="#methods">METHODS</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<hr/>
<h1><a name="name">NAME</a></h1>
<p>AI::SimulatedAnnealing – optimize a list of numbers according
to a specified cost function.</p>
<hr/>
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
<span class="keyword">use</span> <span class="variable">AI::SimulatedAnnealing</span><span class="operator">;</span>
</pre>
<pre>
<span class="variable">$optimized_list</span> <span class="operator">=</span> <span class="variable">anneal</span><span class="operator">(</span><span class="variable">$number_specs</span><span class="operator">,</span> <span class="variable">$cost...
</pre>
<hr/>
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module provides a single public function, <a
href="#anneal"><code>anneal()</code></a>, that optimizes a list of
numbers according to a specified cost function.</p>
<p>Each number to be optimized has a lower bound, an upper bound, and a
precision, where the precision is an integer in the range 0–4
that specifies the number of decimal places to which all instances of
the number will be rounded. The upper bound must be greater than the
lower bound but not greater than 10 to the power of
<code>(4 - p)</code>, where <code>p</code> is the precision.
lib/AI/SimulatedAnnealing.htm view on Meta::CPAN
testing every possible combination of numbers within the subranges
determined by the new temperature) would produce a number of tests
that is less than or equal to the specified cycles per temperature.
In that case, the <code>anneal()</code> function performs the
brute-force optimization to complete the annealing process.</p>
<p>After a temperature reduction, the <code>anneal()</code> function
determines each new subrange such that the current optimal integer
from the total range is as close as possible to the center of the new
subrange. When there is a tie between two possible positions for the
subrange within the total range, a "coin flip" decides.</p>
<hr/>
<h1><a name="prerequisites">PREREQUISITES</a></h1>
<p>This module requires Perl 5, version 5.10.1 or later.</p>
<hr/>
<h1><a name="methods">METHODS</a></h1>
<dl>
<dt><strong><a class="item" name="anneal">anneal($number_specs,
$cost_function, $cycles_per_temperature);</a></strong></dt>
<dd>
<p>The <code>anneal()</code> function takes a reference to an array
of number specifications (which are references to hashes
containing <code>"LowerBound"</code>,
<code>"UpperBound"</code>, and
<code>"Precision"</code> fields), a code reference
pointing to a cost function (which takes a list of numbers
matching the specifications and returns a number representing a
cost to be minimized), and a positive integer specifying the
number of randomization cycles to perform at each temperature.</p>
<p>The function returns a reference to an array containing the
optimized list of numbers.</p>
</dd>
</dl>
<hr/>
<h1><a name="author">AUTHOR</a></h1>
<p>Benjamin Fitch, <<a
href="mailto:blernflerkl@yahoo.com">blernflerkl@yahoo.com</a>></p>
<hr/>
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
<p>Copyright 2010 by Benjamin Fitch.</p>
<p>This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.</p>
</body>
</html>
( run in 0.948 second using v1.01-cache-2.11-cpan-e1769b4cff6 )