Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Genetic Algorithm Library

, 7 Apr 2012
A framework for genetic algorithms
galdemoapps.zip
TSP.exe
GeneticLibrary.dll
TestApp1.exe
TestApp2.exe
GaSchedule.exe
GaSchedule.cfg
GalDemoSource.zip
TestApp1
TestApp1.vcxproj.filters
TestApp2
TestApp2.vcxproj.filters
TSP
res
.svn
entries
prop-base
Toolbar.bmp.svn-base
TSP.ico.svn-base
props
text-base
Toolbar.bmp.svn-base
TSP.ico.svn-base
TSP.rc2.svn-base
tmp
prop-base
props
text-base
Toolbar.bmp
TSP.ico
TSP.vcxproj.filters
GaSchedule
Algorithm
GaSchedule.cfg
GaSchedule.vcxproj.filters
res
GaSchedule.ico
galdocumentation.zip
doxygen.png
Graphic
ab_cp.png
alg_st.png
a_cr.png
c_cp.png
i_cp.png
mp_cr.png
mv_cr.png
r_cp.png
s_cp.png
s_cr.png
galsource.zip
GeneticLibrary
build
release
gcc_bsd
gcc_linux
gcc_macos
gcc_solaris
icc_linux
icc_macos
icc_win
mingw
msvc
scc_solaris
makefiles
gcc_bsd_debug
gcc_bsd_release
gcc_linux_debug
gcc_linux_release
gcc_macos_debug
gcc_macos_release
gcc_solaris_debug
gcc_solaris_release
icc_linux_debug
icc_linux_release
icc_macos_debug
icc_macos_release
scc_solaris_debug
scc_solaris_release
source
vs
<!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: Chromosome::GaChromosomeParams 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_chromosome.html">Chromosome</a>::<a class="el" href="class_chromosome_1_1_ga_chromosome_params.html">GaChromosomeParams</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::GaChromosomeParams Class Reference</h1><!-- doxytag: class="Chromosome::GaChromosomeParams" --><!-- doxytag: inherits="Common::GaParameters" -->This class is base class for all chromosomes' parameters. Built-in genetic operations (crossover, mutation, fitness function and comparator) share their parameters with chromosomes parameters.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/Chromosome.h&gt;</code>
<p>
Inherits <a class="el" href="class_common_1_1_ga_parameters.html">Common::GaParameters</a>.
<p>
Inherited by <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome_params.html">Chromosome::Representation::GaBinaryChromosomeParams</a>.
<p>

<p>
<a href="class_chromosome_1_1_ga_chromosome_params-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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#6f1016e3788075d59217e1e83ab81746">GaChromosomeParams</a> (float mutationProbability, int mutationSize, bool improvingOnlyMutations, float crossoverProbability, int numberOfCrossoverPoints)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes parameters with user-defined values.  <a href="#6f1016e3788075d59217e1e83ab81746"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#06e2b7ababc6065018fa0613aeb0890e">GaChromosomeParams</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes parameters with default values. <br>
1. mutation probability: 3% <br>
2. mutation size: 1 (only one value is mutated) <br>
3. only improving mutations are accepted: yes <br>
4. crossover probability: 80% <br>
5. number of crossover points: 1.  <a href="#06e2b7ababc6065018fa0613aeb0890e"></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_chromosome_1_1_ga_chromosome_params.html#bf3eb4b4e46d99f978be00da75ef03b3">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="#bf3eb4b4e46d99f978be00da75ef03b3"></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_chromosome_1_1_ga_chromosome_params.html#43b38e7e686085413b0ac28aa44487a2">SetMutationProbability</a> (float probability)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SetMutationProbability method sets probability of mutation operation being performed during coupling of selected parents.  <a href="#43b38e7e686085413b0ac28aa44487a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#3a72f2af04cf29f23015c44e247bb543">GetMutationProbability</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#3a72f2af04cf29f23015c44e247bb543"></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_chromosome_1_1_ga_chromosome_params.html#3a72a2b2347f96c5ac054db67b319c0d">SetMutationSize</a> (int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetMutationSize</code> method sets maximal number of affected values in chromosome's code by mutation operation.  <a href="#3a72a2b2347f96c5ac054db67b319c0d"></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_chromosome_1_1_ga_chromosome_params.html#ef2d07d54db5127e8739544e1fac628e">GetMutationSize</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#ef2d07d54db5127e8739544e1fac628e"></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_chromosome_1_1_ga_chromosome_params.html#f23dc414d9aac569352fb672a7738605">SetImprovingMutationsFlag</a> (bool improvingOnly)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetImprovingMutationsFlag</code> method sets improving-mutation flag.  <a href="#f23dc414d9aac569352fb672a7738605"></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_chromosome_1_1_ga_chromosome_params.html#a73e79e0fca6ee0cd558f3522d012bcd">GetImprovingMutationsFlag</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#a73e79e0fca6ee0cd558f3522d012bcd"></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_chromosome_1_1_ga_chromosome_params.html#764ab2dde7157c2d63385a2e6991befe">SetCrossoverProbability</a> (float probability)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetCrossoverProbability</code> method sets probability of crossover operation being performed during coupling of selected parents.  <a href="#764ab2dde7157c2d63385a2e6991befe"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#f4555a893e36d7adff544d2eaeb255cd">GetCrossoverProbability</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#f4555a893e36d7adff544d2eaeb255cd"></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_chromosome_1_1_ga_chromosome_params.html#99d807903a486a6eeefb1da2945d8e51">SetNumberOfCrossoverPoints</a> (int numberOfPoints)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetNumberOfCrossoverPoints</code> method sets number of crossover points.  <a href="#99d807903a486a6eeefb1da2945d8e51"></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_chromosome_1_1_ga_chromosome_params.html#e8d2a0c00f20119c430772943aa9b968">GetNumberOfCrossoverPoints</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#e8d2a0c00f20119c430772943aa9b968"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#8dde28be289819e2cf610643ea646458">_mutationProbability</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mutation probability in interval (0, 1) of mutation operation being performed during coupling of selected parents.  <a href="#8dde28be289819e2cf610643ea646458"></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_chromosome_1_1_ga_chromosome_params.html#cc81304f799cf2667c2066a28424abdb">_mutationSize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maximal number of affected values in chromosome�s code by mutation operation.  <a href="#cc81304f799cf2667c2066a28424abdb"></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_chromosome_1_1_ga_chromosome_params.html#148835317dc225a835cd5dd9464400d5">_improvingOnlyMutations</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This flag if set, instructs that only mutations which lead to improvement of fitness value should be accepted. If it isn't set, then all mutation should be accepted.  <a href="#148835317dc225a835cd5dd9464400d5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#93b6a8879d4d438d533dc91c18713ef1">_crossoverProbability</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">probability in interval (0, 1) of crossover operation being performed during coupling of selected parents.  <a href="#93b6a8879d4d438d533dc91c18713ef1"></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_chromosome_1_1_ga_chromosome_params.html#ca9dc8702df9124a73d846cd33773629">_numberOfCrossoverPoints</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of crossover points between two parents when crossover operation is performed.  <a href="#ca9dc8702df9124a73d846cd33773629"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class is base class for all chromosomes' parameters. Built-in genetic operations (crossover, mutation, fitness function and comparator) share their parameters with chromosomes parameters. 
<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="6f1016e3788075d59217e1e83ab81746"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GaChromosomeParams" ref="6f1016e3788075d59217e1e83ab81746" args="(float mutationProbability, int mutationSize, bool improvingOnlyMutations, float crossoverProbability, int numberOfCrossoverPoints)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::GaChromosomeParams::GaChromosomeParams           </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>mutationProbability</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mutationSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>improvingOnlyMutations</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>crossoverProbability</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>numberOfCrossoverPoints</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes 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>mutationProbability</em>&nbsp;</td><td>mutation probability in interval (0, 1).</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mutationSize</em>&nbsp;</td><td>maximal number of affected values in chromosome's code by mutation operation.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>improvingOnlyMutations</em>&nbsp;</td><td>state of improving only mutation flag.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>crossoverProbability</em>&nbsp;</td><td>crossover probability in interval (0, 1).</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>numberOfCrossoverPoints</em>&nbsp;</td><td>number of crossover points.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="06e2b7ababc6065018fa0613aeb0890e"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GaChromosomeParams" ref="06e2b7ababc6065018fa0613aeb0890e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::GaChromosomeParams::GaChromosomeParams           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes parameters with default values. <br>
1. mutation probability: 3% <br>
2. mutation size: 1 (only one value is mutated) <br>
3. only improving mutations are accepted: yes <br>
4. crossover probability: 80% <br>
5. number of crossover points: 1. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="bf3eb4b4e46d99f978be00da75ef03b3"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::Clone" ref="bf3eb4b4e46d99f978be00da75ef03b3" 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 Chromosome::GaChromosomeParams::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="43b38e7e686085413b0ac28aa44487a2"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::SetMutationProbability" ref="43b38e7e686085413b0ac28aa44487a2" args="(float probability)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Chromosome::GaChromosomeParams::SetMutationProbability           </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>probability</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
SetMutationProbability method sets probability of mutation operation being performed during coupling of selected parents. 
<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>probability</em>&nbsp;</td><td>new probability of mutation operation. Value is in interval (0, 1).</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="3a72f2af04cf29f23015c44e247bb543"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GetMutationProbability" ref="3a72f2af04cf29f23015c44e247bb543" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float GACALL Chromosome::GaChromosomeParams::GetMutationProbability           </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 probability of mutation operation being performed during coupling of selected parents.</dd></dl>

</div>
</div><p>
<a class="anchor" name="3a72a2b2347f96c5ac054db67b319c0d"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::SetMutationSize" ref="3a72a2b2347f96c5ac054db67b319c0d" args="(int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Chromosome::GaChromosomeParams::SetMutationSize           </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>SetMutationSize</code> method sets maximal number of affected values in chromosome's code by mutation operation. 
<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>maximal number of affected values in chromosome's code.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="ef2d07d54db5127e8739544e1fac628e"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GetMutationSize" ref="ef2d07d54db5127e8739544e1fac628e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Chromosome::GaChromosomeParams::GetMutationSize           </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 number of affected values in chromosome's code by mutation operation. </dd></dl>

</div>
</div><p>
<a class="anchor" name="f23dc414d9aac569352fb672a7738605"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::SetImprovingMutationsFlag" ref="f23dc414d9aac569352fb672a7738605" args="(bool improvingOnly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Chromosome::GaChromosomeParams::SetImprovingMutationsFlag           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>improvingOnly</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetImprovingMutationsFlag</code> method sets improving-mutation flag. 
<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>improvingOnly</em>&nbsp;</td><td>if this parameter is set to <code>true</code>, then only the mutations which lead to improvement of fitness value should be accepted. If this parameter is set to <code>false</code>, all mutations are accepted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="a73e79e0fca6ee0cd558f3522d012bcd"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GetImprovingMutationsFlag" ref="a73e79e0fca6ee0cd558f3522d012bcd" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool GACALL Chromosome::GaChromosomeParams::GetImprovingMutationsFlag           </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 only the mutations which lead to improvement of fitness value should be accepted. If all mutation should be accepted, then this method return <code>false</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="764ab2dde7157c2d63385a2e6991befe"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::SetCrossoverProbability" ref="764ab2dde7157c2d63385a2e6991befe" args="(float probability)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Chromosome::GaChromosomeParams::SetCrossoverProbability           </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>probability</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetCrossoverProbability</code> method sets probability of crossover operation being performed during coupling of selected parents. 
<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>probability</em>&nbsp;</td><td>new probability of crossover operation. Value is in interval (0, 1).</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="f4555a893e36d7adff544d2eaeb255cd"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GetCrossoverProbability" ref="f4555a893e36d7adff544d2eaeb255cd" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float GACALL Chromosome::GaChromosomeParams::GetCrossoverProbability           </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 probability of crossover operation being performed during coupling of selected parents.</dd></dl>

</div>
</div><p>
<a class="anchor" name="99d807903a486a6eeefb1da2945d8e51"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::SetNumberOfCrossoverPoints" ref="99d807903a486a6eeefb1da2945d8e51" args="(int numberOfPoints)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Chromosome::GaChromosomeParams::SetNumberOfCrossoverPoints           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>numberOfPoints</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetNumberOfCrossoverPoints</code> method sets number of crossover points. 
<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>numberOfPoints</em>&nbsp;</td><td>new number of crossover points.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="e8d2a0c00f20119c430772943aa9b968"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::GetNumberOfCrossoverPoints" ref="e8d2a0c00f20119c430772943aa9b968" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GACALL Chromosome::GaChromosomeParams::GetNumberOfCrossoverPoints           </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 crossover points.</dd></dl>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="8dde28be289819e2cf610643ea646458"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::_mutationProbability" ref="8dde28be289819e2cf610643ea646458" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float <a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#8dde28be289819e2cf610643ea646458">Chromosome::GaChromosomeParams::_mutationProbability</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mutation probability in interval (0, 1) of mutation operation being performed during coupling of selected parents. 
<p>

</div>
</div><p>
<a class="anchor" name="cc81304f799cf2667c2066a28424abdb"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::_mutationSize" ref="cc81304f799cf2667c2066a28424abdb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#cc81304f799cf2667c2066a28424abdb">Chromosome::GaChromosomeParams::_mutationSize</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Maximal number of affected values in chromosome�s code by mutation operation. 
<p>

</div>
</div><p>
<a class="anchor" name="148835317dc225a835cd5dd9464400d5"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::_improvingOnlyMutations" ref="148835317dc225a835cd5dd9464400d5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#148835317dc225a835cd5dd9464400d5">Chromosome::GaChromosomeParams::_improvingOnlyMutations</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This flag if set, instructs that only mutations which lead to improvement of fitness value should be accepted. If it isn't set, then all mutation should be accepted. 
<p>

</div>
</div><p>
<a class="anchor" name="93b6a8879d4d438d533dc91c18713ef1"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::_crossoverProbability" ref="93b6a8879d4d438d533dc91c18713ef1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float <a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#93b6a8879d4d438d533dc91c18713ef1">Chromosome::GaChromosomeParams::_crossoverProbability</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
probability in interval (0, 1) of crossover operation being performed during coupling of selected parents. 
<p>

</div>
</div><p>
<a class="anchor" name="ca9dc8702df9124a73d846cd33773629"></a><!-- doxytag: member="Chromosome::GaChromosomeParams::_numberOfCrossoverPoints" ref="ca9dc8702df9124a73d846cd33773629" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_chromosome_1_1_ga_chromosome_params.html#ca9dc8702df9124a73d846cd33773629">Chromosome::GaChromosomeParams::_numberOfCrossoverPoints</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Number of crossover points between two parents when crossover operation is performed. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>source/<a class="el" href="_chromosome_8h.html">Chromosome.h</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)

Share

About the Author

Mladen Janković
Software Developer
Serbia Serbia
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 7 Apr 2012
Article Copyright 2008 by Mladen Janković
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid