Click here to Skip to main content
15,885,366 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::GaCouplingOperation 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_coupling_operation.html">GaCouplingOperation</a>
  </div>
</div>
<div class="contents">
<h1>Population::GaCouplingOperation Class Reference</h1><!-- doxytag: class="Population::GaCouplingOperation" --><!-- doxytag: inherits="Common::GaOperation" -->This class is interface for coupling operations which produce offspring from selected chromosomes.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/PopulationOperations.h&gt;</code>
<p>
Inherits <a class="el" href="class_common_1_1_ga_operation.html">Common::GaOperation</a>.
<p>
Inherited by <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_best_always_coupling.html">Population::CouplingOperations::GaBestAlwaysCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_cross_coupling.html">Population::CouplingOperations::GaCrossCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_inverse_coupling.html">Population::CouplingOperations::GaInverseCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_random_coupling.html">Population::CouplingOperations::GaRandomCoupling</a>, and <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_simple_coupling.html">Population::CouplingOperations::GaSimpleCoupling</a>.
<p>

<p>
<a href="class_population_1_1_ga_coupling_operation-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_population_1_1_ga_coupling_operation.html#4277d5ddf98ec358a9c2666954041eda">operator()</a> (const <a class="el" href="class_population_1_1_ga_population.html">GaPopulation</a> &amp;population, <a class="el" href="class_population_1_1_ga_coupling_result_set.html">GaCouplingResultSet</a> &amp;output, const <a class="el" href="class_population_1_1_ga_coupling_params.html">GaCouplingParams</a> &amp;parameters, int workerId, int numberOfWorkers) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>operator ()</code> performs coupling operation. Because this operation is parallelized, caller must specify ID its working thread, and total number of working threads which are used.  <a href="#4277d5ddf98ec358a9c2666954041eda"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class is interface for coupling operations which produce offspring from selected chromosomes. 
<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>Member Function Documentation</h2>
<a class="anchor" name="4277d5ddf98ec358a9c2666954041eda"></a><!-- doxytag: member="Population::GaCouplingOperation::operator()" ref="4277d5ddf98ec358a9c2666954041eda" args="(const GaPopulation &amp;population, GaCouplingResultSet &amp;output, const GaCouplingParams &amp;parameters, int workerId, int numberOfWorkers) const =0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void GACALL Population::GaCouplingOperation::operator()           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_population_1_1_ga_population.html">GaPopulation</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>population</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_population_1_1_ga_coupling_result_set.html">GaCouplingResultSet</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_population_1_1_ga_coupling_params.html">GaCouplingParams</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parameters</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>workerId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>numberOfWorkers</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const<code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>operator ()</code> performs coupling operation. Because this operation is parallelized, caller must specify ID its working thread, and total number of working threads which are used. 
<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>population</em>&nbsp;</td><td>reference to population which hosts selected chromosomes.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>output</em>&nbsp;</td><td>reference to coupling result set which will store produced offspring.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>parameters</em>&nbsp;</td><td>reference to parameters of replacement operation.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>workerId</em>&nbsp;</td><td>ID of the worker (working thread) which called this operator.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>numberOfWorkers</em>&nbsp;</td><td>number of workers (working threads).</td></tr>
  </table>
</dl>

<p>Implemented in <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_simple_coupling.html#1233ada4cbcb4eaaf9329c617967dc20">Population::CouplingOperations::GaSimpleCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_cross_coupling.html#ff8fc5c62fc176868af1e3362ba98342">Population::CouplingOperations::GaCrossCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_inverse_coupling.html#86c94b757bb58f62dce401209eb653a8">Population::CouplingOperations::GaInverseCoupling</a>, <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_random_coupling.html#404e70a81290a00b4084c81306bbb9a0">Population::CouplingOperations::GaRandomCoupling</a>, and <a class="el" href="class_population_1_1_coupling_operations_1_1_ga_best_always_coupling.html#7763e5c1f096381ccb9afd3ee4cf921b">Population::CouplingOperations::GaBestAlwaysCoupling</a>.</p>

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