Click here to Skip to main content
15,881,089 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 435.5K   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::GaValueSet&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_value_set.html">GaValueSet</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::Representation::GaValueSet&lt; T &gt; Class Template Reference</h1><!-- doxytag: class="Chromosome::Representation::GaValueSet" -->This template class is base class for all value set. Value sets store values which can be found in chromosomes' codes.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/ValueSets.h&gt;</code>
<p>
Inherited by <a class="el" href="class_chromosome_1_1_representation_1_1_ga_combined_value_set.html">Chromosome::Representation::GaCombinedValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_interval_value_set.html">Chromosome::Representation::GaIntervalValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_set.html">Chromosome::Representation::GaMultiValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_single_value_set.html">Chromosome::Representation::GaSingleValueSet&lt; T &gt;</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html">Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</a>.
<p>

<p>
<a href="class_chromosome_1_1_representation_1_1_ga_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_value_set.html#ca22b979a69889db01104c4cac6dcbd5">GaValueSet</a> (bool viceVersa)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes value set with user-defined treatment of inverted values.  <a href="#ca22b979a69889db01104c4cac6dcbd5"></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_representation_1_1_ga_value_set.html#781fb83b2993d2f752f573be334455de">GaValueSet</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes value set with inverted values as members of the set.  <a href="#781fb83b2993d2f752f573be334455de"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#188272b95b1492a2fb52df76232daae0">~GaValueSet</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Because this is base class, virtual destructor must be defined in order to enable calling of right destructor (destructor of inheriting class).  <a href="#188272b95b1492a2fb52df76232daae0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual T GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#ac7d424cc9f006b8711f5ec67586d3e0">GenerateRandom</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method returns randomly chosen value from the set.  <a href="#ac7d424cc9f006b8711f5ec67586d3e0"></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_representation_1_1_ga_value_set.html#125b4fed155bc9aa4bfb83ceafeaafd2">Inverse</a> (const T &amp;value, T &amp;inverted) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>Inverse</code> method finds inverted value and stores it into inverted.  <a href="#125b4fed155bc9aa4bfb83ceafeaafd2"></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_representation_1_1_ga_value_set.html#5653e2fb35820ba8f4d6c8caada47e4a">Belongs</a> (const T &amp;value) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>Belongs</code> method checks membership of the value in this value set.  <a href="#5653e2fb35820ba8f4d6c8caada47e4a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const T &amp;GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#67fd1d9f93c41af9897019d720b8dd18">ClosestValue</a> (const T &amp;value) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>ClosestValue</code> method returns nearest value which can be found in value set to specified value.  <a href="#67fd1d9f93c41af9897019d720b8dd18"></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_representation_1_1_ga_value_set.html#8277d298204dad86cc18e8e8c6016a0a">GetViceVersa</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#8277d298204dad86cc18e8e8c6016a0a"></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_representation_1_1_ga_value_set.html#2f611d24cef0124d452e077e352ed72a">SetViceVersa</a> (bool viceVersa)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetViceVersa</code> method sets treatment of inverted values.  <a href="#2f611d24cef0124d452e077e352ed72a"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></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_representation_1_1_ga_value_set.html#81fd46c3f7a14edcc27bd8e24ffc6c69">_viceVersa</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This attribute indicates that membership of original sets of values and inverted set of values are treated equally. If this attribute is set to <code>true</code>, inverted values are treated as members of the set, if it is set to <code>false</code>, inverted values are not treated as members of the set.  <a href="#81fd46c3f7a14edcc27bd8e24ffc6c69"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename T&gt;<br>
 class Chromosome::Representation::GaValueSet&lt; T &gt;</h3>

This template class is base class for all value set. Value sets store values which can be found in chromosomes' codes. 
<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.</td></tr>
  </table>
</dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ca22b979a69889db01104c4cac6dcbd5"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::GaValueSet" ref="ca22b979a69889db01104c4cac6dcbd5" args="(bool viceVersa)" -->
<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_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">GaValueSet</a>           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>viceVersa</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 user-defined treatment of inverted 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>viceVersa</em>&nbsp;</td><td>if this parameter is set to <code>true</code>, inverted values are treated as members of the set, if it is set to <code>false</code>, inverted values are not treated as members of the set.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="781fb83b2993d2f752f573be334455de"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::GaValueSet" ref="781fb83b2993d2f752f573be334455de" args="()" -->
<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_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">GaValueSet</a>           </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 value set with inverted values as members of the set. 
<p>

</div>
</div><p>
<a class="anchor" name="188272b95b1492a2fb52df76232daae0"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::~GaValueSet" ref="188272b95b1492a2fb52df76232daae0" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::~<a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">GaValueSet</a>           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Because this is base class, virtual destructor must be defined in order to enable calling of right destructor (destructor of inheriting class). 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ac7d424cc9f006b8711f5ec67586d3e0"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::GenerateRandom" ref="ac7d424cc9f006b8711f5ec67586d3e0" args="() const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual T GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::GenerateRandom           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method returns randomly chosen value from the set. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns randomly chosen value from the set.</dd></dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_representation_1_1_ga_single_value_set.html#943ac741dfb79359eab554793e80d1f9">Chromosome::Representation::GaSingleValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_set.html#b1e01a6b17674710dbc038ba6becb579">Chromosome::Representation::GaMultiValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_interval_value_set.html#6df93d93ae3fe88152ce8d71242c64c1">Chromosome::Representation::GaIntervalValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_combined_value_set.html#18ff05430f2e35097f873bddb0007ccc">Chromosome::Representation::GaCombinedValueSet&lt; T &gt;</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#65a6e4005f362681c83c8e4058739376">Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="125b4fed155bc9aa4bfb83ceafeaafd2"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::Inverse" ref="125b4fed155bc9aa4bfb83ceafeaafd2" args="(const T &amp;value, T &amp;inverted) const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual bool GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</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> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>Inverse</code> method finds inverted value and stores it into inverted. 
<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>value</em>&nbsp;</td><td>value which should be inverted.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>inverted</em>&nbsp;</td><td>reference to variable to which inverted value is going to be stored.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns <code>true</code> if inversion is successful. If specified value is not in set or it cannot be inverted it returns <code>false</code>.</dd></dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_representation_1_1_ga_single_value_set.html#e622f23ac137189cdb43b7b0201c6599">Chromosome::Representation::GaSingleValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_set.html#bc89070bf4a3f766c64b80e4ad6506e6">Chromosome::Representation::GaMultiValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_interval_value_set.html#fa51a444b21a4da9ab7b7f1030caf445">Chromosome::Representation::GaIntervalValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_combined_value_set.html#95103646fa4e1dd3c070cbb4ef0c63a0">Chromosome::Representation::GaCombinedValueSet&lt; T &gt;</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#699903bb7b50b81f53e864c96c5ea615">Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="5653e2fb35820ba8f4d6c8caada47e4a"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::Belongs" ref="5653e2fb35820ba8f4d6c8caada47e4a" args="(const T &amp;value) const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual bool GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</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> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>Belongs</code> method checks membership of the value in this value set. 
<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>value</em>&nbsp;</td><td>value which is checked.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns <code>true</code> if the value is member of the set.</dd></dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_representation_1_1_ga_single_value_set.html#71d76cef697984df42d4162a5ab6f475">Chromosome::Representation::GaSingleValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_set.html#aa7cbc78b7bed677178d2b4a8a096543">Chromosome::Representation::GaMultiValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_interval_value_set.html#8addfcd8e67782fff83918570d83a7ca">Chromosome::Representation::GaIntervalValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_combined_value_set.html#c1eed5bf65df20ca116ba4c939f37c57">Chromosome::Representation::GaCombinedValueSet&lt; T &gt;</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#cc9ffd0b3abc043e48cd1bdb98ad53eb">Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="67fd1d9f93c41af9897019d720b8dd18"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::ClosestValue" ref="67fd1d9f93c41af9897019d720b8dd18" args="(const T &amp;value) const =0" -->
<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; GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</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> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>ClosestValue</code> method returns nearest value which can be found in value set to specified value. 
<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>value</em>&nbsp;</td><td>value which nearest neighbor should be found.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns reference to nearest value in value set to specified value.</dd></dl>

<p>Implemented in <a class="el" href="class_chromosome_1_1_representation_1_1_ga_single_value_set.html#2c21bc1834a4b804fd2edba64356348e">Chromosome::Representation::GaSingleValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_set.html#ef85f78cbcbee0dd769fd7a4634602de">Chromosome::Representation::GaMultiValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_interval_value_set.html#12046331cc876166061b4185ef685000">Chromosome::Representation::GaIntervalValueSet&lt; T &gt;</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_combined_value_set.html#c6dd9dc852e4ad34374d4e7b6b44d7f5">Chromosome::Representation::GaCombinedValueSet&lt; T &gt;</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_unbound_value_set.html#d3c88a782532665a57219e1ab4fd3fc3">Chromosome::Representation::GaUnboundValueSet&lt; T &gt;</a>.</p>

</div>
</div><p>
<a class="anchor" name="8277d298204dad86cc18e8e8c6016a0a"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::GetViceVersa" ref="8277d298204dad86cc18e8e8c6016a0a" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::GetViceVersa           </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 both, original values and inverted values, treated as members of the set, or returns <code>false</code>, if inverted values are not treated as members.</dd></dl>

</div>
</div><p>
<a class="anchor" name="2f611d24cef0124d452e077e352ed72a"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::SetViceVersa" ref="2f611d24cef0124d452e077e352ed72a" args="(bool viceVersa)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void GACALL <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::SetViceVersa           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>viceVersa</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetViceVersa</code> method sets treatment of inverted values. 
<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>viceVersa</em>&nbsp;</td><td>if this parameter is set to <code>true</code>, inverted values are treated as members of the set, if it is set to <code>false</code>, inverted values are not treated as members of the set.</td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="81fd46c3f7a14edcc27bd8e24ffc6c69"></a><!-- doxytag: member="Chromosome::Representation::GaValueSet::_viceVersa" ref="81fd46c3f7a14edcc27bd8e24ffc6c69" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html">Chromosome::Representation::GaValueSet</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_value_set.html#81fd46c3f7a14edcc27bd8e24ffc6c69">_viceVersa</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This attribute indicates that membership of original sets of values and inverted set of values are treated equally. If this attribute is set to <code>true</code>, inverted values are treated as members of the set, if it is set to <code>false</code>, inverted values are not treated as members of the set. 
<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