Click here to Skip to main content
15,896,118 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 439.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: Chromosome::Representation::GaSwapableCode 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="namespace_chromosome_1_1_representation.html">Representation</a>::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html">GaSwapableCode</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::Representation::GaSwapableCode Class Reference</h1><!-- doxytag: class="Chromosome::Representation::GaSwapableCode" --><code><a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html" title="GaSwapableCode interface should be implemented by chromosomes&#39; classes which...">GaSwapableCode</a></code> interface should be implemented by chromosomes' classes which code supports swapping of positions of its positions.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/RepresentationInterfaces.h&gt;</code>
<p>
Inherited by <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html">Chromosome::Representation::GaBinaryChromosome</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_chromosome.html">Chromosome::Representation::GaMultiValueChromosome&lt; TYPE &gt;</a>.
<p>

<p>
<a href="class_chromosome_1_1_representation_1_1_ga_swapable_code-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">virtual void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html#13c33d3f4210faa8abd708dd138426e0">Swap</a> (int start1, int size1, int start2, int size2)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method swaps positions of parts of chromosome's code.  <a href="#13c33d3f4210faa8abd708dd138426e0"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<code><a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html" title="GaSwapableCode interface should be implemented by chromosomes&#39; classes which...">GaSwapableCode</a></code> interface should be implemented by chromosomes' classes which code supports swapping of positions of its positions. 
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="13c33d3f4210faa8abd708dd138426e0"></a><!-- doxytag: member="Chromosome::Representation::GaSwapableCode::Swap" ref="13c33d3f4210faa8abd708dd138426e0" args="(int start1, int size1, int start2, int size2)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void GACALL Chromosome::Representation::GaSwapableCode::Swap           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method swaps positions of parts of chromosome's code. 
<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>start1</em>&nbsp;</td><td>position of the first part of code.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size1</em>&nbsp;</td><td>number of values of first part which is going to be swapped.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start2</em>&nbsp;</td><td>position of the second part of code.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size2</em>&nbsp;</td><td>number of values of second part which is going to be swapped.</td></tr>
  </table>
</dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#a5cc0abaeec717c18500821d8726e31c">Chromosome::Representation::GaBinaryChromosome</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_chromosome.html#7f169ea383101427221120e6c11131b0">Chromosome::Representation::GaMultiValueChromosome&lt; TYPE &gt;</a>.</p>

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


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