Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / MFC

Genetic Algorithm Library

Rate me:
Please Sign up or sign in to vote.
4.93/5 (175 votes)
7 Apr 2012GPL358 min read 437.6K   34.7K   555  
A framework for genetic algorithms
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Genetic Algorithm Library: Population::GaPopulationParameters Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespace_population.html">Population</a>::<a class="el" href="class_population_1_1_ga_population_parameters.html">GaPopulationParameters</a>
  </div>
</div>
<div class="contents">
<h1>Population::GaPopulationParameters Class Reference</h1><!-- doxytag: class="Population::GaPopulationParameters" --><!-- doxytag: inherits="Common::GaParameters" --><code><a class="el" href="class_population_1_1_ga_population_parameters.html" title="GaPopulationParameters class represents parameters of population.">GaPopulationParameters</a></code> class represents parameters of population.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/Population.h&gt;</code>
<p>
Inherits <a class="el" href="class_common_1_1_ga_parameters.html">Common::GaParameters</a>.
<p>

<p>
<a href="class_population_1_1_ga_population_parameters-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#7dc2174189eaed9c5edac0c963da17ca">GaPopulationParameters</a> (int populationSize, bool resizable, bool sorting, bool useScaldeFitness, int bestTrackCount, int worstTrackCount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes population parameters with user-defined values.  <a href="#7dc2174189eaed9c5edac0c963da17ca"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="class_common_1_1_ga_parameters.html">GaParameters</a> *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#c9ef44eb986234fcf4fa57d3de3ffb0a">Clone</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">More details are given in specification of GaParameters::Clone method.  <a href="#c9ef44eb986234fcf4fa57d3de3ffb0a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#8a875fbd15206add2dbaf3e858577457">GetPopulationSize</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#8a875fbd15206add2dbaf3e858577457"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#bcbad486d8cfe6830bd3c0d69f449dc5">SetPopulationSize</a> (int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetPopulationSize</code> method sets maximal population size.  <a href="#bcbad486d8cfe6830bd3c0d69f449dc5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#22c1d4dfe8b65fe194182a38f110abda">GetResizable</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#22c1d4dfe8b65fe194182a38f110abda"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#4f9296be999d7424f7a18dee5e3931d5">SetResizable</a> (bool resizable)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetResizable</code> method sets capability of population to accept changes of number of chromosomes in it.  <a href="#4f9296be999d7424f7a18dee5e3931d5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#608fa076654ee2895ee5e3a143d3474a">GetSorting</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#608fa076654ee2895ee5e3a143d3474a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#1c369832cef62ae94885504eb99531ec">SetSorting</a> (bool sorting)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetSorting</code> method sets capability of population to sort chromosomes by their fitness value.  <a href="#1c369832cef62ae94885504eb99531ec"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#af7c39349bba11011261d25c5c8f3d1a">GetUsingScaledFitness</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#af7c39349bba11011261d25c5c8f3d1a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#4965aa41215e03f8c2dc4afb1a4a5603">SetUsingScaledFitness</a> (bool useScaledFitness)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetUseScaledFitness</code> method sets capability of population to use scaled fitness values of chromosomes for sorting them.  <a href="#4965aa41215e03f8c2dc4afb1a4a5603"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#8042426734faafb07d3101c700386abe">GetBestTrackCount</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#8042426734faafb07d3101c700386abe"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#9d49d2098b17351392803ebcfbc87ce1">SetBestTrackCount</a> (int count)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetBestTrackCount</code> method sets number of best chromosomes of which population keeps track  <a href="#9d49d2098b17351392803ebcfbc87ce1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#4e198d712950a791ef6ef4b20afa49c2">GetWorstTrackCount</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#4e198d712950a791ef6ef4b20afa49c2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#fc109032763f6301f85a2c50dedf5cc0">SetWorstTrackCount</a> (int count)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetWorstTrackCount</code> method sets number of worst chromosomes of which population keeps track.  <a href="#fc109032763f6301f85a2c50dedf5cc0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#4369c371f0bdf73addb10e29be0881ba">_populationSize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maximal population size (number of chromosomes in population).  <a href="#4369c371f0bdf73addb10e29be0881ba"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#cb8c2fdbc56dfcd0693557395972149d">_resizable</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This attribute indicate if number of chromosomes in population can change. If it is set to <code>true</code> number of chromosomes can vary. If this attribute is set to <code>false</code>, number of chromosomes in population is equal to maximal number.  <a href="#cb8c2fdbc56dfcd0693557395972149d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#7eb2ed84ba65091a8a1db8b0a38fe09a">_sorting</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If this attribute is set to <code>true</code>, chromosomes in population is sorted by their fitness value (original or scaled).  <a href="#7eb2ed84ba65091a8a1db8b0a38fe09a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#eedb57d16aa88fb5e6d0eca66aa2c9dd">_usingScaledFitness</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If this attribute is set to <code>true</code>, scaled fitness values are used for sorting chromosomes in population. If it is set to <code>false</code>, original (non-scaled) fitness values are used.  <a href="#eedb57d16aa88fb5e6d0eca66aa2c9dd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#7ace70696689ea0f501d676e4baa4435">_bestTrackCount</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This attribute stores number of best chromosomes of which population keeps track. This attribute is ignored if population is sorted.  <a href="#7ace70696689ea0f501d676e4baa4435"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_population_1_1_ga_population_parameters.html#a586bc83c1e28d4707030fa3f6473bd7">_worstTrackCount</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This attribute stores number of worst chromosomes of which population keeps track. This attribute is ignored if population is sorted.  <a href="#a586bc83c1e28d4707030fa3f6473bd7"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<code><a class="el" href="class_population_1_1_ga_population_parameters.html" title="GaPopulationParameters class represents parameters of population.">GaPopulationParameters</a></code> class represents parameters of population. 
<p>
This class has no built-in synchronizator, so <code>LOCK_OBJECT</code> and <code>LOCK_THIS_OBJECT</code> macros cannot be used with instances of this class. No public or private methods are thread-safe. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="7dc2174189eaed9c5edac0c963da17ca"></a><!-- doxytag: member="Population::GaPopulationParameters::GaPopulationParameters" ref="7dc2174189eaed9c5edac0c963da17ca" args="(int populationSize, bool resizable, bool sorting, bool useScaldeFitness, int bestTrackCount, int worstTrackCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Population::GaPopulationParameters::GaPopulationParameters           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>populationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>resizable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>sorting</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>useScaldeFitness</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>bestTrackCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>worstTrackCount</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes population parameters with user-defined values. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>populationSize</em>&nbsp;</td><td>size of population (maximal number of chromosomes in population).</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>resizable</em>&nbsp;</td><td>instructs population that number of chromosomes can change.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sorting</em>&nbsp;</td><td>instructs population to sort chromosomes according to their fitness values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>useScaldeFitness</em>&nbsp;</td><td>instructs population to use scaled (transformed) fitness value for sorting chromosomes.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bestTrackCount</em>&nbsp;</td><td>number of best chromosomes of which track is being kept.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>worstTrackCount</em>&nbsp;</td><td>number of worst chromosomes of which track is being kept.</td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="c9ef44eb986234fcf4fa57d3de3ffb0a"></a><!-- doxytag: member="Population::GaPopulationParameters::Clone" ref="c9ef44eb986234fcf4fa57d3de3ffb0a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="class_common_1_1_ga_parameters.html">GaParameters</a>* GACALL Population::GaPopulationParameters::Clone           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
More details are given in specification of GaParameters::Clone method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_common_1_1_ga_parameters.html#34bbac22569d859ba80aa3fd8501c02a">Common::GaParameters</a>.</p>

</div>
</div><p>
<a class="anchor" name="8a875fbd15206add2dbaf3e858577457"></a><!-- doxytag: member="Population::GaPopulationParameters::GetPopulationSize" ref="8a875fbd15206add2dbaf3e858577457" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GACALL Population::GaPopulationParameters::GetPopulationSize           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns maximal population size (number of chromosomes in population).</dd></dl>

</div>
</div><p>
<a class="anchor" name="bcbad486d8cfe6830bd3c0d69f449dc5"></a><!-- doxytag: member="Population::GaPopulationParameters::SetPopulationSize" ref="bcbad486d8cfe6830bd3c0d69f449dc5" args="(int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Population::GaPopulationParameters::SetPopulationSize           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetPopulationSize</code> method sets maximal population size. 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>size of population.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="22c1d4dfe8b65fe194182a38f110abda"></a><!-- doxytag: member="Population::GaPopulationParameters::GetResizable" ref="22c1d4dfe8b65fe194182a38f110abda" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool GACALL Population::GaPopulationParameters::GetResizable           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns <code>true</code> if number of chromosomes can change, otherwise it returns <code>false</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="4f9296be999d7424f7a18dee5e3931d5"></a><!-- doxytag: member="Population::GaPopulationParameters::SetResizable" ref="4f9296be999d7424f7a18dee5e3931d5" args="(bool resizable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Population::GaPopulationParameters::SetResizable           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>resizable</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetResizable</code> method sets capability of population to accept changes of number of chromosomes in it. 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>resizable</em>&nbsp;</td><td>instructs population that number of chromosomes can change.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="608fa076654ee2895ee5e3a143d3474a"></a><!-- doxytag: member="Population::GaPopulationParameters::GetSorting" ref="608fa076654ee2895ee5e3a143d3474a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool GACALL Population::GaPopulationParameters::GetSorting           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns <code>true</code> if chromosomes in population is sorted by their fitness value (original or scaled), otherwise it returns <code>false</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="1c369832cef62ae94885504eb99531ec"></a><!-- doxytag: member="Population::GaPopulationParameters::SetSorting" ref="1c369832cef62ae94885504eb99531ec" args="(bool sorting)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Population::GaPopulationParameters::SetSorting           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>sorting</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetSorting</code> method sets capability of population to sort chromosomes by their fitness value. 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sorting</em>&nbsp;</td><td>instructs population to sort chromosomes according to their fitness values.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="af7c39349bba11011261d25c5c8f3d1a"></a><!-- doxytag: member="Population::GaPopulationParameters::GetUsingScaledFitness" ref="af7c39349bba11011261d25c5c8f3d1a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool GACALL Population::GaPopulationParameters::GetUsingScaledFitness           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns <code>true</code> if population use scaled fitness value to sort chromosomes, otherwise if non-scaled fitness values are used it returns <code>false</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="4965aa41215e03f8c2dc4afb1a4a5603"></a><!-- doxytag: member="Population::GaPopulationParameters::SetUsingScaledFitness" ref="4965aa41215e03f8c2dc4afb1a4a5603" args="(bool useScaledFitness)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Population::GaPopulationParameters::SetUsingScaledFitness           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>useScaledFitness</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetUseScaledFitness</code> method sets capability of population to use scaled fitness values of chromosomes for sorting them. 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>useScaledFitness</em>&nbsp;</td><td>instructs population to use scaled (transformed) fitness value for sorting chromosomes.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="8042426734faafb07d3101c700386abe"></a><!-- doxytag: member="Population::GaPopulationParameters::GetBestTrackCount" ref="8042426734faafb07d3101c700386abe" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GACALL Population::GaPopulationParameters::GetBestTrackCount           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns number of best chromosomes of which population keeps track.</dd></dl>

</div>
</div><p>
<a class="anchor" name="9d49d2098b17351392803ebcfbc87ce1"></a><!-- doxytag: member="Population::GaPopulationParameters::SetBestTrackCount" ref="9d49d2098b17351392803ebcfbc87ce1" args="(int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Population::GaPopulationParameters::SetBestTrackCount           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetBestTrackCount</code> method sets number of best chromosomes of which population keeps track 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of best chromosomes of which track is being kept.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="4e198d712950a791ef6ef4b20afa49c2"></a><!-- doxytag: member="Population::GaPopulationParameters::GetWorstTrackCount" ref="4e198d712950a791ef6ef4b20afa49c2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GACALL Population::GaPopulationParameters::GetWorstTrackCount           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns number of best chromosomes of which population keeps track.</dd></dl>

</div>
</div><p>
<a class="anchor" name="fc109032763f6301f85a2c50dedf5cc0"></a><!-- doxytag: member="Population::GaPopulationParameters::SetWorstTrackCount" ref="fc109032763f6301f85a2c50dedf5cc0" args="(int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Population::GaPopulationParameters::SetWorstTrackCount           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetWorstTrackCount</code> method sets number of worst chromosomes of which population keeps track. 
<p>
This method is not thread-safe. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of worst chromosomes of which track is being kept.</td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="4369c371f0bdf73addb10e29be0881ba"></a><!-- doxytag: member="Population::GaPopulationParameters::_populationSize" ref="4369c371f0bdf73addb10e29be0881ba" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_population_1_1_ga_population_parameters.html#4369c371f0bdf73addb10e29be0881ba">Population::GaPopulationParameters::_populationSize</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Maximal population size (number of chromosomes in population). 
<p>

</div>
</div><p>
<a class="anchor" name="cb8c2fdbc56dfcd0693557395972149d"></a><!-- doxytag: member="Population::GaPopulationParameters::_resizable" ref="cb8c2fdbc56dfcd0693557395972149d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_population_1_1_ga_population_parameters.html#cb8c2fdbc56dfcd0693557395972149d">Population::GaPopulationParameters::_resizable</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This attribute indicate if number of chromosomes in population can change. If it is set to <code>true</code> number of chromosomes can vary. If this attribute is set to <code>false</code>, number of chromosomes in population is equal to maximal number. 
<p>

</div>
</div><p>
<a class="anchor" name="7eb2ed84ba65091a8a1db8b0a38fe09a"></a><!-- doxytag: member="Population::GaPopulationParameters::_sorting" ref="7eb2ed84ba65091a8a1db8b0a38fe09a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_population_1_1_ga_population_parameters.html#7eb2ed84ba65091a8a1db8b0a38fe09a">Population::GaPopulationParameters::_sorting</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
If this attribute is set to <code>true</code>, chromosomes in population is sorted by their fitness value (original or scaled). 
<p>

</div>
</div><p>
<a class="anchor" name="eedb57d16aa88fb5e6d0eca66aa2c9dd"></a><!-- doxytag: member="Population::GaPopulationParameters::_usingScaledFitness" ref="eedb57d16aa88fb5e6d0eca66aa2c9dd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_population_1_1_ga_population_parameters.html#eedb57d16aa88fb5e6d0eca66aa2c9dd">Population::GaPopulationParameters::_usingScaledFitness</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
If this attribute is set to <code>true</code>, scaled fitness values are used for sorting chromosomes in population. If it is set to <code>false</code>, original (non-scaled) fitness values are used. 
<p>

</div>
</div><p>
<a class="anchor" name="7ace70696689ea0f501d676e4baa4435"></a><!-- doxytag: member="Population::GaPopulationParameters::_bestTrackCount" ref="7ace70696689ea0f501d676e4baa4435" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_population_1_1_ga_population_parameters.html#7ace70696689ea0f501d676e4baa4435">Population::GaPopulationParameters::_bestTrackCount</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This attribute stores number of best chromosomes of which population keeps track. This attribute is ignored if population is sorted. 
<p>

</div>
</div><p>
<a class="anchor" name="a586bc83c1e28d4707030fa3f6473bd7"></a><!-- doxytag: member="Population::GaPopulationParameters::_worstTrackCount" ref="a586bc83c1e28d4707030fa3f6473bd7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_population_1_1_ga_population_parameters.html#a586bc83c1e28d4707030fa3f6473bd7">Population::GaPopulationParameters::_worstTrackCount</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This attribute stores number of worst chromosomes of which population keeps track. This attribute is ignored if population is sorted. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>source/<a class="el" href="_population_8h.html">Population.h</a><li>source/<a class="el" href="_population_8cpp.html">Population.cpp</a></ul>
</div>
<br/><a href="http://www.coolsoft-sd.com/ProductVersion.aspx?vid=9">Genetic Algorithm Library</a><br/><a href="http://www.coolsoft-sd.com/">Coolsoft Software Development</a>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
Serbia Serbia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions