view libs/commons-math-2.1/docs/apidocs/org/apache/commons/math/genetics/GeneticAlgorithm.html @ 32:d7a43156a79b default tip

new tabs
author dwinter
date Mon, 10 Oct 2011 17:52:22 +0200
parents 878723cc40fb
children
line wrap: on
line source

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_17) on Sat Mar 27 22:46:11 EDT 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
GeneticAlgorithm (Commons Math 2.1 API)
</TITLE>

<META NAME="date" CONTENT="2010-03-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="GeneticAlgorithm (Commons Math 2.1 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/GeneticAlgorithm.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/FixedGenerationCount.html" title="class in org.apache.commons.math.genetics"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math.genetics"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math/genetics/GeneticAlgorithm.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="GeneticAlgorithm.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math.genetics</FONT>
<BR>
Class GeneticAlgorithm</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math.genetics.GeneticAlgorithm</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.29"><B>GeneticAlgorithm</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Implementation of a genetic algorithm. All factors that govern the operation
 of the algorithm can be configured for a specific problem.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>2.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $</DD>
</DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#GeneticAlgorithm(org.apache.commons.math.genetics.CrossoverPolicy, double, org.apache.commons.math.genetics.MutationPolicy, double, org.apache.commons.math.genetics.SelectionPolicy)">GeneticAlgorithm</A></B>(<A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics">CrossoverPolicy</A>&nbsp;crossoverPolicy,
                                 double&nbsp;crossoverRate,
                                 <A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics">MutationPolicy</A>&nbsp;mutationPolicy,
                                 double&nbsp;mutationRate,
                                 <A HREF="../../../../../org/apache/commons/math/genetics/SelectionPolicy.html" title="interface in org.apache.commons.math.genetics">SelectionPolicy</A>&nbsp;selectionPolicy)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#evolve(org.apache.commons.math.genetics.Population, org.apache.commons.math.genetics.StoppingCondition)">evolve</A></B>(<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A>&nbsp;initial,
             <A HREF="../../../../../org/apache/commons/math/genetics/StoppingCondition.html" title="interface in org.apache.commons.math.genetics">StoppingCondition</A>&nbsp;condition)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evolve the given population.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics">CrossoverPolicy</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getCrossoverPolicy()">getCrossoverPolicy</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the crossover policy.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getCrossoverRate()">getCrossoverRate</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the crossover rate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getGenerationsEvolved()">getGenerationsEvolved</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of generations evolved to
 reach <A HREF="../../../../../org/apache/commons/math/genetics/StoppingCondition.html" title="interface in org.apache.commons.math.genetics"><CODE>StoppingCondition</CODE></A> in the last run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics">MutationPolicy</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getMutationPolicy()">getMutationPolicy</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the mutation policy.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getMutationRate()">getMutationRate</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the mutation rate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getRandomGenerator()">getRandomGenerator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the (static) random generator.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/SelectionPolicy.html" title="interface in org.apache.commons.math.genetics">SelectionPolicy</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getSelectionPolicy()">getSelectionPolicy</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the selection policy.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#nextGeneration(org.apache.commons.math.genetics.Population)">nextGeneration</A></B>(<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A>&nbsp;current)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evolve the given population into the next generation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#setRandomGenerator(org.apache.commons.math.random.RandomGenerator)">setRandomGenerator</A></B>(<A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A>&nbsp;random)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the (static) random generator.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="GeneticAlgorithm(org.apache.commons.math.genetics.CrossoverPolicy, double, org.apache.commons.math.genetics.MutationPolicy, double, org.apache.commons.math.genetics.SelectionPolicy)"><!-- --></A><H3>
GeneticAlgorithm</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.65"><B>GeneticAlgorithm</B></A>(<A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics">CrossoverPolicy</A>&nbsp;crossoverPolicy,
                        double&nbsp;crossoverRate,
                        <A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics">MutationPolicy</A>&nbsp;mutationPolicy,
                        double&nbsp;mutationRate,
                        <A HREF="../../../../../org/apache/commons/math/genetics/SelectionPolicy.html" title="interface in org.apache.commons.math.genetics">SelectionPolicy</A>&nbsp;selectionPolicy)</PRE>
<DL>
<DL>
<DT><B>Parameters:</B><DD><CODE>crossoverPolicy</CODE> - The <A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics"><CODE>CrossoverPolicy</CODE></A><DD><CODE>crossoverRate</CODE> - The crossover rate as a percentage (0-1 inclusive)<DD><CODE>mutationPolicy</CODE> - The <A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics"><CODE>MutationPolicy</CODE></A><DD><CODE>mutationRate</CODE> - The mutation rate as a percentage (0-1 inclusive)<DD><CODE>selectionPolicy</CODE> - The <A HREF="../../../../../org/apache/commons/math/genetics/SelectionPolicy.html" title="interface in org.apache.commons.math.genetics"><CODE>SelectionPolicy</CODE></A></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="setRandomGenerator(org.apache.commons.math.random.RandomGenerator)"><!-- --></A><H3>
setRandomGenerator</H3>
<PRE>
public static void <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.87"><B>setRandomGenerator</B></A>(<A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A>&nbsp;random)</PRE>
<DL>
<DD>Set the (static) random generator.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>random</CODE> - random generator</DL>
</DD>
</DL>
<HR>

<A NAME="getRandomGenerator()"><!-- --></A><H3>
getRandomGenerator</H3>
<PRE>
public static <A HREF="../../../../../org/apache/commons/math/random/RandomGenerator.html" title="interface in org.apache.commons.math.random">RandomGenerator</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.96"><B>getRandomGenerator</B></A>()</PRE>
<DL>
<DD>Returns the (static) random generator.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the static random generator shared by GA implementation classes</DL>
</DD>
</DL>
<HR>

<A NAME="evolve(org.apache.commons.math.genetics.Population, org.apache.commons.math.genetics.StoppingCondition)"><!-- --></A><H3>
evolve</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.110"><B>evolve</B></A>(<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A>&nbsp;initial,
                         <A HREF="../../../../../org/apache/commons/math/genetics/StoppingCondition.html" title="interface in org.apache.commons.math.genetics">StoppingCondition</A>&nbsp;condition)</PRE>
<DL>
<DD>Evolve the given population. Evolution stops when the stopping condition
 is satisfied. Updates the <A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getGenerationsEvolved()"><CODE>generationsEvolved</CODE></A>
 property with the number of generations evolved before the StoppingCondition
 is satisfied.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>initial</CODE> - the initial, seed population.<DD><CODE>condition</CODE> - the stopping condition used to stop evolution.
<DT><B>Returns:</B><DD>the population that satisfies the stopping condition.</DL>
</DD>
</DL>
<HR>

<A NAME="nextGeneration(org.apache.commons.math.genetics.Population)"><!-- --></A><H3>
nextGeneration</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.142"><B>nextGeneration</B></A>(<A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics">Population</A>&nbsp;current)</PRE>
<DL>
<DD><p>Evolve the given population into the next generation.</p>
 <p><ol>
    <li>Get nextGeneration population to fill from <code>current</code>
        generation, using its nextGeneration method</li>
    <li>Loop until new generation is filled:</li>
    <ul><li>Apply configured SelectionPolicy to select a pair of parents
            from <code>current</code></li>
        <li>With probability = <A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getCrossoverRate()"><CODE>getCrossoverRate()</CODE></A>, apply
            configured <A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics"><CODE>CrossoverPolicy</CODE></A> to parents</li>
        <li>With probability = <A HREF="../../../../../org/apache/commons/math/genetics/GeneticAlgorithm.html#getMutationRate()"><CODE>getMutationRate()</CODE></A>, apply
            configured <A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics"><CODE>MutationPolicy</CODE></A> to each of the offspring</li>
        <li>Add offspring individually to nextGeneration,
            space permitting</li>
    </ul>
    <li>Return nextGeneration</li>
    </ol>
 </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>current</CODE> - the current population.
<DT><B>Returns:</B><DD>the population for the next generation.</DL>
</DD>
</DL>
<HR>

<A NAME="getCrossoverPolicy()"><!-- --></A><H3>
getCrossoverPolicy</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math/genetics/CrossoverPolicy.html" title="interface in org.apache.commons.math.genetics">CrossoverPolicy</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.181"><B>getCrossoverPolicy</B></A>()</PRE>
<DL>
<DD>Returns the crossover policy.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>crossover policy</DL>
</DD>
</DL>
<HR>

<A NAME="getCrossoverRate()"><!-- --></A><H3>
getCrossoverRate</H3>
<PRE>
public double <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.189"><B>getCrossoverRate</B></A>()</PRE>
<DL>
<DD>Returns the crossover rate.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>crossover rate</DL>
</DD>
</DL>
<HR>

<A NAME="getMutationPolicy()"><!-- --></A><H3>
getMutationPolicy</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math/genetics/MutationPolicy.html" title="interface in org.apache.commons.math.genetics">MutationPolicy</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.197"><B>getMutationPolicy</B></A>()</PRE>
<DL>
<DD>Returns the mutation policy.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>mutation policy</DL>
</DD>
</DL>
<HR>

<A NAME="getMutationRate()"><!-- --></A><H3>
getMutationRate</H3>
<PRE>
public double <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.205"><B>getMutationRate</B></A>()</PRE>
<DL>
<DD>Returns the mutation rate.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>mutation rate</DL>
</DD>
</DL>
<HR>

<A NAME="getSelectionPolicy()"><!-- --></A><H3>
getSelectionPolicy</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math/genetics/SelectionPolicy.html" title="interface in org.apache.commons.math.genetics">SelectionPolicy</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.213"><B>getSelectionPolicy</B></A>()</PRE>
<DL>
<DD>Returns the selection policy.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>selection policy</DL>
</DD>
</DL>
<HR>

<A NAME="getGenerationsEvolved()"><!-- --></A><H3>
getGenerationsEvolved</H3>
<PRE>
public int <A HREF="../../../../../src-html/org/apache/commons/math/genetics/GeneticAlgorithm.html#line.224"><B>getGenerationsEvolved</B></A>()</PRE>
<DL>
<DD>Returns the number of generations evolved to
 reach <A HREF="../../../../../org/apache/commons/math/genetics/StoppingCondition.html" title="interface in org.apache.commons.math.genetics"><CODE>StoppingCondition</CODE></A> in the last run.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>number of generations evolved<DT><B>Since:</B></DT>
  <DD>2.1</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/GeneticAlgorithm.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/FixedGenerationCount.html" title="class in org.apache.commons.math.genetics"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math.genetics"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math/genetics/GeneticAlgorithm.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="GeneticAlgorithm.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2010 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>