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::Representation::GaDomainChromosome&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_domain_chromosome.html">GaDomainChromosome</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::Representation::GaDomainChromosome&lt; T &gt; Class Template Reference</h1><!-- doxytag: class="Chromosome::Representation::GaDomainChromosome" --><!-- doxytag: inherits="Chromosome::GaDynamicOperationChromosome" --><code><a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html" title="GaDomainChromosome class should be base for chromosomes which have codes with values...">GaDomainChromosome</a></code> class should be base for chromosomes which have codes with values which must bi in defined domain.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/DomainChromosome.h&gt;</code>
<p>
Inherits <a class="el" href="class_chromosome_1_1_ga_dynamic_operation_chromosome.html">Chromosome::GaDynamicOperationChromosome</a>.
<p>

<p>
<a href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome-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_domain_chromosome.html#2c41f7bec1165e412d1c87cdb97f51ca">GaDomainChromosome</a> (<a class="el" href="class_chromosome_1_1_representation_1_1_ga_chromosome_domain_block.html">GaChromosomeDomainBlock</a>&lt; T &gt; *configBlock)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes chromosome with CCB.  <a href="#2c41f7bec1165e412d1c87cdb97f51ca"></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_domain_chromosome.html#3a305f37395995cba7fdf42ea515b2e2">GaDomainChromosome</a> (const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html">GaDomainChromosome</a>&lt; T &gt; &amp;c, bool setupOnly)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This is copy constructor.  <a href="#3a305f37395995cba7fdf42ea515b2e2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const T &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html#34d5cf97b7d26b99b1d25604d80bb9dc">GetClosestValue</a> (const T &amp;value, int pos) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetClosestValue</code> method returns nearest value which can be found in value set to specified value.  <a href="#34d5cf97b7d26b99b1d25604d80bb9dc"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename T&gt;<br>
 class Chromosome::Representation::GaDomainChromosome&lt; T &gt;</h3>

<code><a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html" title="GaDomainChromosome class should be base for chromosomes which have codes with values...">GaDomainChromosome</a></code> class should be base for chromosomes which have codes with values which must bi in defined domain. 
<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. <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 used by value set.</td></tr>
  </table>
</dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="2c41f7bec1165e412d1c87cdb97f51ca"></a><!-- doxytag: member="Chromosome::Representation::GaDomainChromosome::GaDomainChromosome" ref="2c41f7bec1165e412d1c87cdb97f51ca" args="(GaChromosomeDomainBlock&lt; T &gt; *configBlock)" -->
<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_domain_chromosome.html">Chromosome::Representation::GaDomainChromosome</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html">GaDomainChromosome</a>           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_chromosome_domain_block.html">GaChromosomeDomainBlock</a>&lt; T &gt; *&nbsp;</td>
          <td class="paramname"> <em>configBlock</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes chromosome with CCB. 
<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>configBlock</em>&nbsp;</td><td>pointer to CCB.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="3a305f37395995cba7fdf42ea515b2e2"></a><!-- doxytag: member="Chromosome::Representation::GaDomainChromosome::GaDomainChromosome" ref="3a305f37395995cba7fdf42ea515b2e2" args="(const GaDomainChromosome&lt; T &gt; &amp;c, bool setupOnly)" -->
<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_domain_chromosome.html">Chromosome::Representation::GaDomainChromosome</a>&lt; T &gt;::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html">GaDomainChromosome</a>           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html">GaDomainChromosome</a>&lt; T &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>setupOnly</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This is copy constructor. 
<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>c</em>&nbsp;</td><td>reference to chromosome which is copied.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>setupOnly</em>&nbsp;</td><td>if this parameter is <code>true</code>, only pointer to CCB is copied. If this parameter is <code>false</code>, chromosome's data and CCB is copied.</td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="34d5cf97b7d26b99b1d25604d80bb9dc"></a><!-- doxytag: member="Chromosome::Representation::GaDomainChromosome::GetClosestValue" ref="34d5cf97b7d26b99b1d25604d80bb9dc" args="(const T &amp;value, int pos) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const T&amp; <a class="el" href="class_chromosome_1_1_representation_1_1_ga_domain_chromosome.html">Chromosome::Representation::GaDomainChromosome</a>&lt; T &gt;::GetClosestValue           </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">int&nbsp;</td>
          <td class="paramname"> <em>pos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetClosestValue</code> method returns nearest value which can be found in value set to specified value. 
<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>value</em>&nbsp;</td><td>value which nearest neighbor should be found.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>position of the value in the chromosome's code.</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>

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