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 &#8211; 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 &#8211; 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&#8211;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&#160;-&#160;p)</code>, where <code>p</code> is the precision.
      The lower bound must be not less than <code>-1</code> times the result
      of taking 10 to the power of <code>(4&#160;-&#160;p)</code>.</p>
    <p>A bound that has a higher degree of precision than that specified for
      the number to which the bound applies is rounded inward (that is,
      downward for an upper bound and upward for a lower bound) to the
      nearest instance of the specified precision.</p>
    <p>The attributes of a number (bounds and precision) are encapsulated
      within a number specification, which is a reference to a hash
      containing <code>&quot;LowerBound&quot;</code>,
      <code>&quot;UpperBound&quot;</code>, and
      <code>&quot;Precision&quot;</code> fields.</p>
    <p>The <a href="#anneal"><code>anneal()</code></a> function takes a
      reference to an array of number specifications, a cost function, and a
      positive integer specifying the number of randomization cycles per
      temperature to perform. The <code>anneal()</code> function returns a
      reference to an array having the same length as the array of number
      specifications. The returned list represents the optimal list of
      numbers matching the specified attributes, where &quot;optimal&quot;
      means producing the lowest cost.</p>



( run in 1.227 second using v1.01-cache-2.11-cpan-754626df90b )