Click here to Skip to main content
15,895,829 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::GaUnboundValueSet&lt; T &gt; Class Template 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_unbound_value_set.html">GaUnboundValueSet</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::Representation::GaUnboundValueSet&lt; T &gt; Class Template Reference</h1><!-- doxytag: class="Chromosome::Representation::GaUnboundValueSet" --><!-- doxytag: inherits="Chromosome::Representation::GaValueSet" -->This template represents value set with no additional limitations, except limitation introduced by the type and random generator used to generate values.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/ValueSets.h&gt;</code>
<p>
Inherits <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet&lt; T &gt;&lt; T &gt;</a>.
<p>

<p>
<a href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set-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_representation_1_1_ga_unbound_value_set.html#0d223ffbf8364b288e04cdbd39471db5">GaUnboundValueSet</a> (GaRandom&lt; T &gt; *randomGenerator)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes value set with random generator.  <a href="#0d223ffbf8364b288e04cdbd39471db5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual T&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#65a6e4005f362681c83c8e4058739376">GenerateRandom</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">More details are given in specification of <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#ac7d424cc9f006b8711f5ec67586d3e0" title="This method returns randomly chosen value from the set.">GaValueSet::GenerateRandom</a> method.  <a href="#65a6e4005f362681c83c8e4058739376"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#699903bb7b50b81f53e864c96c5ea615">Inverse</a> (const T &amp;value, T &amp;inverted) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">More details are given in specification of <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#125b4fed155bc9aa4bfb83ceafeaafd2" title="Inverse method finds inverted value and stores it into inverted.">GaValueSet::Inverse</a> method.  <a href="#699903bb7b50b81f53e864c96c5ea615"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#cc9ffd0b3abc043e48cd1bdb98ad53eb">Belongs</a> (const T &amp;value) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">More details are given in specification of <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18" title="ClosestValue method returns nearest value which can be found in value set to specified...">GaValueSet::ClosestValue</a> method.  <a href="#cc9ffd0b3abc043e48cd1bdb98ad53eb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const T &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#d3c88a782532665a57219e1ab4fd3fc3">ClosestValue</a> (const T &amp;value) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">More details are given in specification of <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18" title="ClosestValue method returns nearest value which can be found in value set to specified...">GaValueSet::ClosestValue</a> method.  <a href="#d3c88a782532665a57219e1ab4fd3fc3"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GaRandom&lt; T &gt; *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#dcced34ea55c207f91319516c8afb1a2">_randomGenerator</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pointer to random generator which is used for generating of random values.  <a href="#dcced34ea55c207f91319516c8afb1a2"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename T&gt;<br>
 class Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</h3>

This template represents value set with no additional limitations, except limitation introduced by the type and random generator used to generate values. 
<p>
This class has built-in synchronizator so it is allowed to use <code>LOCK_OBJECT</code> and <code>LOCK_THIS_OBJECT</code> macros with instances of this class, but no public or private methods are 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>T</em>&nbsp;</td><td>type of data in value set. This type must support unary <code>operators -</code>.</td></tr>
  </table>
</dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="0d223ffbf8364b288e04cdbd39471db5"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::GaUnboundValueSet" ref="0d223ffbf8364b288e04cdbd39471db5" args="(GaRandom&lt; T &gt; *randomGenerator)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">GaUnboundValueSet</a>           </td>
          <td>(</td>
          <td class="paramtype">GaRandom&lt; T &gt; *&nbsp;</td>
          <td class="paramname"> <em>randomGenerator</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes value set with random generator. 
<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>randomGenerator</em>&nbsp;</td><td>pointer to random generator.</td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="65a6e4005f362681c83c8e4058739376"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::GenerateRandom" ref="65a6e4005f362681c83c8e4058739376" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual T <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::GenerateRandom           </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 <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#ac7d424cc9f006b8711f5ec67586d3e0" title="This method returns randomly chosen value from the set.">GaValueSet::GenerateRandom</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#ac7d424cc9f006b8711f5ec67586d3e0">Chromosome::Representation::GaValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="699903bb7b50b81f53e864c96c5ea615"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::Inverse" ref="699903bb7b50b81f53e864c96c5ea615" args="(const T &amp;value, T &amp;inverted) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual bool <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::Inverse           </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T &amp;&nbsp;</td>
          <td class="paramname"> <em>inverted</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
More details are given in specification of <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#125b4fed155bc9aa4bfb83ceafeaafd2" title="Inverse method finds inverted value and stores it into inverted.">GaValueSet::Inverse</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#125b4fed155bc9aa4bfb83ceafeaafd2">Chromosome::Representation::GaValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="cc9ffd0b3abc043e48cd1bdb98ad53eb"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::Belongs" ref="cc9ffd0b3abc043e48cd1bdb98ad53eb" args="(const T &amp;value) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual bool <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::Belongs           </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em>          </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 <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18" title="ClosestValue method returns nearest value which can be found in value set to specified...">GaValueSet::ClosestValue</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#5653e2fb35820ba8f4d6c8caada47e4a">Chromosome::Representation::GaValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="d3c88a782532665a57219e1ab4fd3fc3"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::ClosestValue" ref="d3c88a782532665a57219e1ab4fd3fc3" args="(const T &amp;value) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual const T&amp; <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::ClosestValue           </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em>          </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 <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18" title="ClosestValue method returns nearest value which can be found in value set to specified...">GaValueSet::ClosestValue</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18">Chromosome::Representation::GaValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="dcced34ea55c207f91319516c8afb1a2"></a><!-- doxytag: member="Chromosome::Representation::GaUnboundValueSet::_randomGenerator" ref="dcced34ea55c207f91319516c8afb1a2" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">GaRandom&lt;T&gt;* <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#dcced34ea55c207f91319516c8afb1a2">_randomGenerator</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Pointer to random generator which is used for generating of random values. 
<p>

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