Math-Evol
view release on metacpan or search on metacpan
lua/Evol.html view on Meta::CPAN
<HTML><HEAD><TITLE>Evol.lua</TITLE>
<LINK rel=stylesheet type="text/css"
href="http://www.pjb.com.au/comp/styles.css" title="PJB Computing Styles">
<META HTTP-EQUIV="Keywords"
CONTENT="Optimisation, Evolutionary search, Lua, Perl, Evol">
</HEAD>
<BODY LINK="#000066" VLINK="#000066" ALINK="#000066">
<DIV>
<H1><IMG SRC="http://www.pjb.com.au/comp/logo.jpg" ALT=" " WIDTH=126 HEIGHT=52>
<FONT COLOR="#800000"><I>Evol.lua</I></FONT>
</H1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<TABLE ALIGN="center" WIDTH="85%" BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left">
<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="#functions">FUNCTIONS</a></li>
<li><a href="#step_sizes">STEP SIZES</a></li>
<li><a href="#caller_supplied_subroutines">CALLER-SUPPLIED SUBROUTINES</a></li>
</ul>
</TD><TD ALIGN="left">
<ul>
<li><a href="#convergence_criteria">CONVERGENCE CRITERIA</a></li>
<li><a href="#installation">INSTALLATION</a></li>
<li><a href="#perl">PERL</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#credits">CREDITS</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
</ul>
</TD></TR>
</TABLE>
<!-- INDEX END -->
<p>
</p>
<hr />
<h2><a name="name">NAME</a></h2>
<p>Evol - Evolution search optimisation</p>
<p>
</p>
<hr />
<h2><a name="synopsis">SYNOPSIS</a></h2>
<pre>
local EV = require 'Evol'
xb, sm, fb, lf = evol(xb, sm, function, constrain, tm)
-- or
xb, sm = select_evol(xb, sm, choose_best, constrain)</pre>
<pre>
-- not yet implemented:
-- new_text = text_evol(text, choose_best_text, nchoices );</pre>
<p>
</p>
<hr />
<h2><a name="description">DESCRIPTION</a></h2>
<p>This module implements the evolution search strategy. Derivatives of
the objective function are not required. Constraints can be incorporated.
The caller must supply initial values for the variables and for the
initial step sizes.</p>
<p>This evolution strategy is a random strategy, and as such is
particularly robust and will cope well with large numbers of variables,
or rugged objective funtions.</p>
<p>Evol.pm works either automatically (evol) with an objective function to
be minimised, or interactively (select_evol) with a (suitably patient)
human who at each step will choose the better of two possibilities.
Another subroutine (text_evol) allows the evolution of numeric parameters
in a text file, the parameters to be varied being identified in the text
by means of special comments. A script <em>ps_evol</em> which uses that is
included for human-judgement-based fine-tuning of drawings in PostScript.</p>
<p>Version 1.12</p>
<p>
</p>
<hr />
<h2><a name="functions">FUNCTIONS</a></h2>
<dl>
<dt><strong><a name="evol" class="item"><em>evol</em>( xb, sm, minimise, constrain, tm);</a></strong></dt>
<dd>
<p>Where the arguments are:
<em>xb</em> the initial values of variables,
<em>sm</em> the initial values of step sizes,
<em>minimise</em> the function to be minimised,
<em>constrain</em> a function constraining the values,
<em>tm</em> the max allowable cpu time in seconds</p>
<p>The step sizes and the caller-supplied functions
<em>function</em> and <em>constrain</em> are discussed below.
The default value of <em>tm</em> is 10 seconds.</p>
<p><em>evol</em> returns a list of four things:
<em>xb</em> the best values of the variables,
<em>sm</em> the final values of step sizes,
<em>fb</em> the best value of objective function,
<em>lf</em> a success parameter</p>
<p><em>lf</em> is set false if the search ran out of cpu time before converging.
For more control over the convergence criteria, see the
CONVERGENCE CRITERIA section below.</p>
</dd>
<dt><strong><a name="select_evol" class="item"><em>select_evol</em>( xb, sm, choose_best, constrain, nchoices);</a></strong></dt>
<dd>
<p>Where the arguments are:
<em>xb</em> the initial values of variables,
<em>sm</em> the initial values of step sizes,
<em>choose_best</em> the function allowing the user to select the best,
<em>constrain</em> a function constraining the values,
<em>choices</em> the number of choices <em>select_evol</em> generates</p>
( run in 1.813 second using v1.01-cache-2.11-cpan-39bf76dae61 )