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

Genetic Algorithm Library

, 7 Apr 2012 GPL3
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::GaFitnessComparator 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_fitness_comparator.html">GaFitnessComparator</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::GaFitnessComparator Class Reference</h1><!-- doxytag: class="Chromosome::GaFitnessComparator" --><!-- doxytag: inherits="Common::GaOperation" --><code><a class="el" href="class_chromosome_1_1_ga_fitness_comparator.html" title="GaFitnessComparator class is base for fitness comparators.">GaFitnessComparator</a></code> class is base for fitness comparators.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/ChromosomeOperations.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_chromosome_1_1_fitness_comparators_1_1_ga_max_fitness_comparator.html">Chromosome::FitnessComparators::GaMaxFitnessComparator</a>, and <a class="el" href="class_chromosome_1_1_fitness_comparators_1_1_ga_min_fitness_comparator.html">Chromosome::FitnessComparators::GaMinFitnessComparator</a>.
<p>

<p>
<a href="class_chromosome_1_1_ga_fitness_comparator-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 int GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_fitness_comparator.html#a3e5cc28c5318e0a90da438d065d5d4a">operator()</a> (float fitness1, float fitness2) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This operator compares fitness values. NOTE: Comparison doesn't have to be arithmetical comparison.  <a href="#a3e5cc28c5318e0a90da438d065d5d4a"></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_fitness_comparator.html#b411938cfd870bcc56a8bf2930483fca">MakeParameters</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method just overrides GaOperation::MakeParameters method and has no functionality.  <a href="#b411938cfd870bcc56a8bf2930483fca"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_ga_fitness_comparator.html#a49da1aee4c580d2859dda2dfc8a3d92">CheckParameters</a> (const <a class="el" href="class_common_1_1_ga_parameters.html">GaParameters</a> &amp;parameters) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method just overrides GaOperation::CheckParameters method and has no functionality.  <a href="#a49da1aee4c580d2859dda2dfc8a3d92"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<code><a class="el" href="class_chromosome_1_1_ga_fitness_comparator.html" title="GaFitnessComparator class is base for fitness comparators.">GaFitnessComparator</a></code> class is base for fitness comparators. 
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3e5cc28c5318e0a90da438d065d5d4a"></a><!-- doxytag: member="Chromosome::GaFitnessComparator::operator()" ref="a3e5cc28c5318e0a90da438d065d5d4a" args="(float fitness1, float fitness2) const =0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int GACALL Chromosome::GaFitnessComparator::operator()           </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>fitness1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>fitness2</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>
This operator compares fitness values. NOTE: Comparison doesn't have to be arithmetical comparison. 
<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>fitness1</em>&nbsp;</td><td>fitness value of the first chromosome.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fitness2</em>&nbsp;</td><td>fitness value of the second chromosome.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a. -1 if the first fitness value lower then the second. <br>
b. 0 if the fitness values are equal. <br>
c. 1 if the first fitness value is greater then the second.</dd></dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_fitness_comparators_1_1_ga_min_fitness_comparator.html#b4f246fab8762ccf3196d018a9706185">Chromosome::FitnessComparators::GaMinFitnessComparator</a>, and <a class="el" href="class_chromosome_1_1_fitness_comparators_1_1_ga_max_fitness_comparator.html#c3b2280081b25e3d37785504141fcacd">Chromosome::FitnessComparators::GaMaxFitnessComparator</a>.</p>

</div>
</div><p>
<a class="anchor" name="b411938cfd870bcc56a8bf2930483fca"></a><!-- doxytag: member="Chromosome::GaFitnessComparator::MakeParameters" ref="b411938cfd870bcc56a8bf2930483fca" 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::GaFitnessComparator::MakeParameters           </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>
This method just overrides GaOperation::MakeParameters method and has no functionality. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method always returns <code>NULL</code>.</dd></dl>

<p>Implements <a class="el" href="class_common_1_1_ga_operation.html#7da19e41bc86254ea540a55a09384023">Common::GaOperation</a>.</p>

</div>
</div><p>
<a class="anchor" name="a49da1aee4c580d2859dda2dfc8a3d92"></a><!-- doxytag: member="Chromosome::GaFitnessComparator::CheckParameters" ref="a49da1aee4c580d2859dda2dfc8a3d92" args="(const GaParameters &amp;parameters) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool GACALL Chromosome::GaFitnessComparator::CheckParameters           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_common_1_1_ga_parameters.html">GaParameters</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parameters</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method just overrides GaOperation::CheckParameters method and has no functionality. 
<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>parameters</em>&nbsp;</td><td>parameter is igonred.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method always returns <code>true</code>.</dd></dl>

<p>Implements <a class="el" href="class_common_1_1_ga_operation.html#43b1b5c6a68418b09ec1ac04663d02b6">Common::GaOperation</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>source/<a class="el" href="_chromosome_operations_8h.html">ChromosomeOperations.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 | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 7 Apr 2012
Article Copyright 2008 by Mladen Janković
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid