Click here to Skip to main content
15,881,882 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.7K   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::GaBinaryChromosome 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="namespace_chromosome_1_1_representation.html">Representation</a>::<a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html">GaBinaryChromosome</a>
  </div>
</div>
<div class="contents">
<h1>Chromosome::Representation::GaBinaryChromosome Class Reference</h1><!-- doxytag: class="Chromosome::Representation::GaBinaryChromosome" --><!-- doxytag: inherits="Chromosome::GaDynamicOperationChromosome,Chromosome::Representation::GaSwapableCode,Chromosome::Representation::GaSizableCode,Chromosome::Representation::GaMutableCode,Chromosome::Representation::GaMultiValueCode" -->This class can be used for solutions of problems which can be encoded as array of bits.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/BinaryChromosome.h&gt;</code>
<p>
Inherits <a class="el" href="class_chromosome_1_1_ga_dynamic_operation_chromosome.html">Chromosome::GaDynamicOperationChromosome</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html">Chromosome::Representation::GaSwapableCode</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_sizable_code.html">Chromosome::Representation::GaSizableCode</a>, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_mutable_code.html">Chromosome::Representation::GaMutableCode</a>, and <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_code.html">Chromosome::Representation::GaMultiValueCode</a>.
<p>

<p>
<a href="class_chromosome_1_1_representation_1_1_ga_binary_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">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#1763488716bd943a28a95eb3806660f7">Remove</a> (int start, int size)</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_sizable_code.html#7560c4c9abe76b1874552315fff94c57" title="This method removes values start position to start + size position.">GaSizableCode::Remove</a> method.  <a href="#1763488716bd943a28a95eb3806660f7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#e3d7767c1ca7f63e9cbb6fc20a2bbe47">Insert</a> (int start, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_value.html">GaCodeValue</a> *data, int size)</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_sizable_code.html#7d984c1fd6766ab74f99333e1aefba0e" title="This method inserts new values into chromosome&#39;s code.">GaSizableCode::Insert</a> method.  <a href="#e3d7767c1ca7f63e9cbb6fc20a2bbe47"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#a5cc0abaeec717c18500821d8726e31c">Swap</a> (int start1, int size1, int start2, int size2)</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_swapable_code.html#13c33d3f4210faa8abd708dd138426e0" title="This method swaps positions of parts of chromosome&#39;s code.">GaSwapableCode::Swap</a> method.  <a href="#a5cc0abaeec717c18500821d8726e31c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#240d494dec5ab04b4dc59585d067b0df">Flip</a> (int start, int size)</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_mutable_code.html#40f02a83ade23f05533c98ac946e7e99" title="This method changes values of chromosome&#39;s code randomly from start position...">GaMutableCode::Flip</a> method.  <a href="#240d494dec5ab04b4dc59585d067b0df"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#4c1b99042f66521b9d70400b58153fd1">Invert</a> (int start, int size)</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_mutable_code.html#fddd1f03bf92ebeda31df41bae361998" title="This method inverts values of chromosome&#39;s code from start position to start...">GaMutableCode::Invert</a> method.  <a href="#4c1b99042f66521b9d70400b58153fd1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API <br>
<a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#95070ae6669214c0bfc84080eea4997c">MakeBuffer</a> (int size) 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_multi_value_code.html#8e554f190a1da395e44b06b90d8a6812" title="This method makes new buffer for storing values of chromosomes&#39; codes but doesn&#39;t...">GaMultiValueCode::MakeBuffer</a> method.  <a href="#95070ae6669214c0bfc84080eea4997c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#b3468c04e6f0e2c107c7993b4c8b9540">FillBuffer</a> (int pos, int size, <a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> &amp;buffer) 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_multi_value_code.html#9187ee510ff40f35d2af01fa23ca955d" title="This method copies values of chromosome&#39;s code from pos to pos + size into buffer...">GaMultiValueCode::FillBuffer</a> method.  <a href="#b3468c04e6f0e2c107c7993b4c8b9540"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#d96ad76f0669cda45bcb76f273ca5e96">FromBuffer</a> (const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> &amp;buffer)</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_multi_value_code.html#d2ec1f984b96c30e3c93f80325c2c899" title="This method makes chromosome&#39;s code and stores it in chromosome form buffer of...">GaMultiValueCode::FromBuffer</a> method.  <a href="#d96ad76f0669cda45bcb76f273ca5e96"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#5bf0f57dc3103945e0f6ce2072b63eaf">GaBinaryChromosome</a> (<a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *configBlock)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes chromosome with CCB.  <a href="#5bf0f57dc3103945e0f6ce2072b63eaf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#f4ed0d045327f10b26c3f6b835930871">GaBinaryChromosome</a> (int size, <a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *configBlock)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes chromosome with CCB and makes random chromosome's code with defined size.  <a href="#f4ed0d045327f10b26c3f6b835930871"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#d9cfacb93caee563be73c77313943ac8">GaBinaryChromosome</a> (bool *code, int size, <a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *configBlock)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This constructor initializes chromosome with CCB and its code.  <a href="#d9cfacb93caee563be73c77313943ac8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#93d45e4d6064c4ff68d489e22ad545b3">GaBinaryChromosome</a> (const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html">GaBinaryChromosome</a> &amp;c, bool setupOnly)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This is copy constructor.  <a href="#93d45e4d6064c4ff68d489e22ad545b3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7374c48d40ffb98e075ef8e049396a79">~GaBinaryChromosome</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor frees memory used by chromosome's code and backup code.  <a href="#7374c48d40ffb98e075ef8e049396a79"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API <br>
<a class="el" href="class_common_1_1_ga_smart_ptr.html">GaChromosomePtr</a> GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7d0ec3f89fb005e82292a091f8bf65d1">MakeCopy</a> (bool setupOnly) 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_ga_chromosome.html#bbae73891fe34a13f0882b729ca08495" title="This method produces copy of chromosome. It can create exact copy or it can create...">GaChromosome::MakeCopy</a> method.  <a href="#7d0ec3f89fb005e82292a091f8bf65d1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API <br>
<a class="el" href="class_common_1_1_ga_smart_ptr.html">GaChromosomePtr</a> GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#59717cfb379b34282ee067bd0ebbbc14">MakeNewFromPrototype</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method uses <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7d0ec3f89fb005e82292a091f8bf65d1" title="More details are given in specification of GaChromosome::MakeCopy method.">MakeCopy</a> method to create chromosome's object, so if additional steps are not needed for creating chromosome from prototype, classes which inherits this class don't have to override this method.  <a href="#59717cfb379b34282ee067bd0ebbbc14"></a><br></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_representation_1_1_ga_binary_chromosome.html#a1b818f50c5dd36baa497d86bcbaa3a5">GetCodeSize</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#a1b818f50c5dd36baa497d86bcbaa3a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#d818ed5d202c723d4516dc02949c55ae">SetBitState</a> (int bit, bool state)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>SetBitState</code> method sets state of bit at specified position.  <a href="#d818ed5d202c723d4516dc02949c55ae"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#00a991f804f7fd3c8f7b1badaf186c83">GetBit</a> (int bit)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetBit</code> method returns state of specified bit.  <a href="#00a991f804f7fd3c8f7b1badaf186c83"></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_binary_chromosome.html#26ee3909d2c028f833b7036cddd65992">GetCode</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method is not thread-safe.  <a href="#26ee3909d2c028f833b7036cddd65992"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API <a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> <br>
&amp;GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#03ab91762cf082aa6f69781fa93faf6f">operator=</a> (const <a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> &amp;rhs)</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_ga_chromosome.html#8870128357483be066e06f8ea36d0a8a" title="This operator copies setup and chromosome&#39;s code from rhs.">GaChromosome::operator =</a>.  <a href="#03ab91762cf082aa6f69781fa93faf6f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API bool GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#40a6f316d0d4b677dffea8d4e563b28a">operator==</a> (const <a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> &amp;c) 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_ga_chromosome.html#4ae6d5bdcc745d7c730db3d3b687e751" title="This operator compares chromosomes&#39; codes.">GaChromosome::operator ==</a>.  <a href="#40a6f316d0d4b677dffea8d4e563b28a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API char GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#c2910f0e560689c34aa151153f843993">GetChar</a> (int pos=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetChar</code> method use <code>sizeof(char)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>char</code> value.  <a href="#c2910f0e560689c34aa151153f843993"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#b6762bfd58f2aa1ca78b8b95b6c4e93c">GetChar</a> (char *output, int pos=0, int size=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetChar</code> method fills array of <code>char</code> values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0.  <a href="#b6762bfd58f2aa1ca78b8b95b6c4e93c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API short GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#5769ac8c2b1aec41d348f842fafd0f1b">GetShort</a> (int pos=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetShort</code> method use <code>sizeof(short)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>short</code> value.  <a href="#5769ac8c2b1aec41d348f842fafd0f1b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#db8b20003cec5ffb2b44977cbe081492">GetShort</a> (short *output, int pos=0, int size=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetShort</code> method fills array of <code>short</code> values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0.  <a href="#db8b20003cec5ffb2b44977cbe081492"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API int GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#d717d3ba8cac04009ce8ff33a9a9273c">GetInt</a> (int pos=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetInt</code> method use <code>sizeof(int)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>int</code> value.  <a href="#d717d3ba8cac04009ce8ff33a9a9273c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#114bc379e291a0c83067f15f5103fd46">GetInt</a> (int *output, int pos=0, int size=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetInt</code> method fills array of int values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0.  <a href="#114bc379e291a0c83067f15f5103fd46"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API float GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#8745cba0619d4973e654cf50a347b275">GetFloat</a> (int pos=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetFloat</code> method use <code>sizeof(float)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>float</code> value.  <a href="#8745cba0619d4973e654cf50a347b275"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#87677d453f6b6c6b44e15dacaf423e3b">GetFloat</a> (float *output, int pos=0, int size=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetFloat</code> method fills array of float values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0.  <a href="#87677d453f6b6c6b44e15dacaf423e3b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API double GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#a6eca908fd673c9358db6346eb4785d9">GetDouble</a> (int pos=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetDouble</code> method use <code>sizeof(double)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>double</code> value.  <a href="#a6eca908fd673c9358db6346eb4785d9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#e4e8f98584f9168d0be11c65fe5952d5">GetDouble</a> (double *output, int pos=0, int size=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>GetDouble</code> method fills array of double values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0.  <a href="#e4e8f98584f9168d0be11c65fe5952d5"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static GAL_API bool *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7ffed6c5861804d685d67c5f7ab032da">FromChar</a> (char *input, int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>FromChar</code> method creates array of booleans which is equal to binary representation of array of input values of <code>char</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array.  <a href="#7ffed6c5861804d685d67c5f7ab032da"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static GAL_API bool *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#78577dd91b58e65da3b9a414ce9916b7">FromShort</a> (short *input, int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>FromShort</code> method creates array of booleans which is equal to binary representation of array of input values of <code>short</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array.  <a href="#78577dd91b58e65da3b9a414ce9916b7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static GAL_API bool *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#640c946b7f52d339798f2d0766011420">FromInt</a> (int *input, int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>FromInt</code> method creates array of booleans which is equal to binary representation of array of input values of <code>int</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array.  <a href="#640c946b7f52d339798f2d0766011420"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static GAL_API bool *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#1ac113f88abe066a5bc998ebe12f1208">FromFloat</a> (float *input, int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>FromFloat</code> method creates array of booleans which is equal to binary representation of array of input values of <code>float</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array.  <a href="#1ac113f88abe066a5bc998ebe12f1208"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static GAL_API bool *GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7d0826ec3ae51fd698e4b92e7c5f6718">FromDouble</a> (double *input, int size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>FromDouble</code> method creates array of booleans which is equal to binary representation of array of input values of <code>double</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array.  <a href="#7d0826ec3ae51fd698e4b92e7c5f6718"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#4de54540057f5ba1051c7e1ac890e728">PreapareForMutation</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>PreapareForMutation</code> method creates backup of current code and saves its size.  <a href="#4de54540057f5ba1051c7e1ac890e728"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#589fcfe04cef443c3da65aff870b7647">AcceptMutation</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This method only deletes backup copy.  <a href="#589fcfe04cef443c3da65aff870b7647"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual GAL_API void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#73736ac2cb4d8efdab732ae5b5fe0dd0">RejectMutation</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>RejectMutation</code> method deletes current chromosome's code and restores it from backup copy.  <a href="#73736ac2cb4d8efdab732ae5b5fe0dd0"></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_binary_chromosome.html#f3c40512350f8f7fd8b38b2581f905f6">_bits</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Array of booleans which represents binary code.  <a href="#f3c40512350f8f7fd8b38b2581f905f6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#088552963698afd0b677abb99f3745df">_codeSize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of bits in code.  <a href="#088552963698afd0b677abb99f3745df"></a><br></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_binary_chromosome.html#b65fdde833edc6e1b51783ca25fbc17c">_backupBits</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Array of backed-up bits of chromosome's code.  <a href="#b65fdde833edc6e1b51783ca25fbc17c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#fb0aa1d6df32e9e93a99de66aa365f23">_backupSize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of bits in backed-up code.  <a href="#fb0aa1d6df32e9e93a99de66aa365f23"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class can be used for solutions of problems which can be encoded as array of bits. 
<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>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="5bf0f57dc3103945e0f6ce2072b63eaf"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome" ref="5bf0f57dc3103945e0f6ce2072b63eaf" args="(GaChromosomeOperationsBlock *configBlock)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *&nbsp;</td>
          <td class="paramname"> <em>configBlock</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></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="f4ed0d045327f10b26c3f6b835930871"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome" ref="f4ed0d045327f10b26c3f6b835930871" args="(int size, GaChromosomeOperationsBlock *configBlock)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *&nbsp;</td>
          <td class="paramname"> <em>configBlock</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes chromosome with CCB and makes random chromosome's code with defined size. 
<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>size</em>&nbsp;</td><td>size of chromosome's code.</td></tr>
    <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="d9cfacb93caee563be73c77313943ac8"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome" ref="d9cfacb93caee563be73c77313943ac8" args="(bool *code, int size, GaChromosomeOperationsBlock *configBlock)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome           </td>
          <td>(</td>
          <td class="paramtype">bool *&nbsp;</td>
          <td class="paramname"> <em>code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_ga_chromosome_operations_block.html">GaChromosomeOperationsBlock</a> *&nbsp;</td>
          <td class="paramname"> <em>configBlock</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This constructor initializes chromosome with CCB and its code. 
<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>code</em>&nbsp;</td><td>array of bits which is copied to chromosome's code.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>size of chromosome's code.</td></tr>
    <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="93d45e4d6064c4ff68d489e22ad545b3"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome" ref="93d45e4d6064c4ff68d489e22ad545b3" args="(const GaBinaryChromosome &amp;c, bool setupOnly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::Representation::GaBinaryChromosome::GaBinaryChromosome           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html">GaBinaryChromosome</a> &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%"></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>
<a class="anchor" name="7374c48d40ffb98e075ef8e049396a79"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::~GaBinaryChromosome" ref="7374c48d40ffb98e075ef8e049396a79" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Chromosome::Representation::GaBinaryChromosome::~GaBinaryChromosome           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor frees memory used by chromosome's code and backup code. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="1763488716bd943a28a95eb3806660f7"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::Remove" ref="1763488716bd943a28a95eb3806660f7" args="(int start, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::Remove           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [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_sizable_code.html#7560c4c9abe76b1874552315fff94c57" title="This method removes values start position to start + size position.">GaSizableCode::Remove</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_sizable_code.html#7560c4c9abe76b1874552315fff94c57">Chromosome::Representation::GaSizableCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="e3d7767c1ca7f63e9cbb6fc20a2bbe47"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::Insert" ref="e3d7767c1ca7f63e9cbb6fc20a2bbe47" args="(int start, GaCodeValue *data, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::Insert           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_value.html">GaCodeValue</a> *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [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_sizable_code.html#7d984c1fd6766ab74f99333e1aefba0e" title="This method inserts new values into chromosome&#39;s code.">GaSizableCode::Insert</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_sizable_code.html#7d984c1fd6766ab74f99333e1aefba0e">Chromosome::Representation::GaSizableCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="a5cc0abaeec717c18500821d8726e31c"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::Swap" ref="a5cc0abaeec717c18500821d8726e31c" args="(int start1, int size1, int start2, int size2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::Swap           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [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_swapable_code.html#13c33d3f4210faa8abd708dd138426e0" title="This method swaps positions of parts of chromosome&#39;s code.">GaSwapableCode::Swap</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_swapable_code.html#13c33d3f4210faa8abd708dd138426e0">Chromosome::Representation::GaSwapableCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="240d494dec5ab04b4dc59585d067b0df"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::Flip" ref="240d494dec5ab04b4dc59585d067b0df" args="(int start, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::Flip           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [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_mutable_code.html#40f02a83ade23f05533c98ac946e7e99" title="This method changes values of chromosome&#39;s code randomly from start position...">GaMutableCode::Flip</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_mutable_code.html#40f02a83ade23f05533c98ac946e7e99">Chromosome::Representation::GaMutableCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="4c1b99042f66521b9d70400b58153fd1"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::Invert" ref="4c1b99042f66521b9d70400b58153fd1" args="(int start, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::Invert           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [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_mutable_code.html#fddd1f03bf92ebeda31df41bae361998" title="This method inverts values of chromosome&#39;s code from start position to start...">GaMutableCode::Invert</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_mutable_code.html#fddd1f03bf92ebeda31df41bae361998">Chromosome::Representation::GaMutableCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="95070ae6669214c0bfc84080eea4997c"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::MakeBuffer" ref="95070ae6669214c0bfc84080eea4997c" args="(int size) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> * Chromosome::Representation::GaBinaryChromosome::MakeBuffer           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [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_multi_value_code.html#8e554f190a1da395e44b06b90d8a6812" title="This method makes new buffer for storing values of chromosomes&#39; codes but doesn&#39;t...">GaMultiValueCode::MakeBuffer</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_code.html#8e554f190a1da395e44b06b90d8a6812">Chromosome::Representation::GaMultiValueCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="b3468c04e6f0e2c107c7993b4c8b9540"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FillBuffer" ref="b3468c04e6f0e2c107c7993b4c8b9540" args="(int pos, int size, GaCodeValuesBuffer &amp;buffer) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::FillBuffer           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>buffer</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const<code> [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_multi_value_code.html#9187ee510ff40f35d2af01fa23ca955d" title="This method copies values of chromosome&#39;s code from pos to pos + size into buffer...">GaMultiValueCode::FillBuffer</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_code.html#9187ee510ff40f35d2af01fa23ca955d">Chromosome::Representation::GaMultiValueCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="d96ad76f0669cda45bcb76f273ca5e96"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromBuffer" ref="d96ad76f0669cda45bcb76f273ca5e96" args="(const GaCodeValuesBuffer &amp;buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::FromBuffer           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_chromosome_1_1_representation_1_1_ga_code_values_buffer.html">GaCodeValuesBuffer</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>buffer</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [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_multi_value_code.html#d2ec1f984b96c30e3c93f80325c2c899" title="This method makes chromosome&#39;s code and stores it in chromosome form buffer of...">GaMultiValueCode::FromBuffer</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_representation_1_1_ga_multi_value_code.html#d2ec1f984b96c30e3c93f80325c2c899">Chromosome::Representation::GaMultiValueCode</a>.</p>

</div>
</div><p>
<a class="anchor" name="7d0ec3f89fb005e82292a091f8bf65d1"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::MakeCopy" ref="7d0ec3f89fb005e82292a091f8bf65d1" args="(bool setupOnly) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual GAL_API <a class="el" href="class_common_1_1_ga_smart_ptr.html">GaChromosomePtr</a> GACALL Chromosome::Representation::GaBinaryChromosome::MakeCopy           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>setupOnly</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_ga_chromosome.html#bbae73891fe34a13f0882b729ca08495" title="This method produces copy of chromosome. It can create exact copy or it can create...">GaChromosome::MakeCopy</a> method. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_chromosome.html#bbae73891fe34a13f0882b729ca08495">Chromosome::GaChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="59717cfb379b34282ee067bd0ebbbc14"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::MakeNewFromPrototype" ref="59717cfb379b34282ee067bd0ebbbc14" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_common_1_1_ga_smart_ptr.html">GaChromosomePtr</a> Chromosome::Representation::GaBinaryChromosome::MakeNewFromPrototype           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method uses <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#7d0ec3f89fb005e82292a091f8bf65d1" title="More details are given in specification of GaChromosome::MakeCopy method.">MakeCopy</a> method to create chromosome's object, so if additional steps are not needed for creating chromosome from prototype, classes which inherits this class don't have to override this method. 
<p>
More details are given in specification of <a class="el" href="class_chromosome_1_1_ga_chromosome.html#1baa2a0dcb133a07606aacbbfa66b655" title="This method creates new chromosome with exact setup (parameters, operations, etc)...">GaChromosome::MakeNewFromPrototype</a> method. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_chromosome.html#1baa2a0dcb133a07606aacbbfa66b655">Chromosome::GaChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="a1b818f50c5dd36baa497d86bcbaa3a5"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetCodeSize" ref="a1b818f50c5dd36baa497d86bcbaa3a5" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int GACALL Chromosome::Representation::GaBinaryChromosome::GetCodeSize           </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 is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns number of bits in chromosome's code.</dd></dl>

<p>Implements <a class="el" href="class_chromosome_1_1_ga_chromosome.html#881d9437f305d04af112364a164eb40f">Chromosome::GaChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="d818ed5d202c723d4516dc02949c55ae"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::SetBitState" ref="d818ed5d202c723d4516dc02949c55ae" args="(int bit, bool state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::SetBitState           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>bit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>state</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>SetBitState</code> method sets state of bit at specified position. 
<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>bit</em>&nbsp;</td><td>position of bit.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>new state of the bit.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="00a991f804f7fd3c8f7b1badaf186c83"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetBit" ref="00a991f804f7fd3c8f7b1badaf186c83" args="(int bit)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Chromosome::Representation::GaBinaryChromosome::GetBit           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>bit</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetBit</code> method returns state of specified bit. 
<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>bit</em>&nbsp;</td><td>position of bit which state is queried.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns state of specified bit.</dd></dl>

</div>
</div><p>
<a class="anchor" name="26ee3909d2c028f833b7036cddd65992"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetCode" ref="26ee3909d2c028f833b7036cddd65992" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool* GACALL Chromosome::Representation::GaBinaryChromosome::GetCode           </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 method is not thread-safe. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to array of booleans which represent binary code of chromosome.</dd></dl>

</div>
</div><p>
<a class="anchor" name="03ab91762cf082aa6f69781fa93faf6f"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::operator=" ref="03ab91762cf082aa6f69781fa93faf6f" args="(const GaChromosome &amp;rhs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> &amp; Chromosome::Representation::GaBinaryChromosome::operator=           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>rhs</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [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_ga_chromosome.html#8870128357483be066e06f8ea36d0a8a" title="This operator copies setup and chromosome&#39;s code from rhs.">GaChromosome::operator =</a>. 
<p>
This method is not thread-safe. 
<p>Reimplemented from <a class="el" href="class_chromosome_1_1_ga_default_chromosome.html#c9ef0b443788b8636ddbc7bd9d7dffb3">Chromosome::GaDefaultChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="40a6f316d0d4b677dffea8d4e563b28a"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::operator==" ref="40a6f316d0d4b677dffea8d4e563b28a" args="(const GaChromosome &amp;c) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Chromosome::Representation::GaBinaryChromosome::operator==           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_chromosome_1_1_ga_chromosome.html">GaChromosome</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>c</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [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_ga_chromosome.html#4ae6d5bdcc745d7c730db3d3b687e751" title="This operator compares chromosomes&#39; codes.">GaChromosome::operator ==</a>. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_chromosome.html#4ae6d5bdcc745d7c730db3d3b687e751">Chromosome::GaChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="c2910f0e560689c34aa151153f843993"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetChar" ref="c2910f0e560689c34aa151153f843993" args="(int pos=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char Chromosome::Representation::GaBinaryChromosome::GetChar           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetChar</code> method use <code>sizeof(char)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>char</code> 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>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Methods returns created value from array of bits.</dd></dl>

</div>
</div><p>
<a class="anchor" name="b6762bfd58f2aa1ca78b8b95b6c4e93c"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetChar" ref="b6762bfd58f2aa1ca78b8b95b6c4e93c" args="(char *output, int pos=0, int size=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::GetChar           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetChar</code> method fills array of <code>char</code> values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0. 
<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>output</em>&nbsp;</td><td>output array of values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values which should be extracted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="5769ac8c2b1aec41d348f842fafd0f1b"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetShort" ref="5769ac8c2b1aec41d348f842fafd0f1b" args="(int pos=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">short Chromosome::Representation::GaBinaryChromosome::GetShort           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetShort</code> method use <code>sizeof(short)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>short</code> 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>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Methods returns created value from array of bits.</dd></dl>

</div>
</div><p>
<a class="anchor" name="db8b20003cec5ffb2b44977cbe081492"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetShort" ref="db8b20003cec5ffb2b44977cbe081492" args="(short *output, int pos=0, int size=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::GetShort           </td>
          <td>(</td>
          <td class="paramtype">short *&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetShort</code> method fills array of <code>short</code> values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0. 
<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>output</em>&nbsp;</td><td>output array of values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values which should be extracted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="d717d3ba8cac04009ce8ff33a9a9273c"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetInt" ref="d717d3ba8cac04009ce8ff33a9a9273c" args="(int pos=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Chromosome::Representation::GaBinaryChromosome::GetInt           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetInt</code> method use <code>sizeof(int)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>int</code> 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>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Methods returns created value from array of bits.</dd></dl>

</div>
</div><p>
<a class="anchor" name="114bc379e291a0c83067f15f5103fd46"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetInt" ref="114bc379e291a0c83067f15f5103fd46" args="(int *output, int pos=0, int size=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::GetInt           </td>
          <td>(</td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetInt</code> method fills array of int values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0. 
<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>output</em>&nbsp;</td><td>output array of values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values which should be extracted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="8745cba0619d4973e654cf50a347b275"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetFloat" ref="8745cba0619d4973e654cf50a347b275" args="(int pos=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float Chromosome::Representation::GaBinaryChromosome::GetFloat           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetFloat</code> method use <code>sizeof(float)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>float</code> 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>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Methods returns created value from array of bits.</dd></dl>

</div>
</div><p>
<a class="anchor" name="87677d453f6b6c6b44e15dacaf423e3b"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetFloat" ref="87677d453f6b6c6b44e15dacaf423e3b" args="(float *output, int pos=0, int size=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::GetFloat           </td>
          <td>(</td>
          <td class="paramtype">float *&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetFloat</code> method fills array of float values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0. 
<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>output</em>&nbsp;</td><td>output array of values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values which should be extracted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="a6eca908fd673c9358db6346eb4785d9"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetDouble" ref="a6eca908fd673c9358db6346eb4785d9" args="(int pos=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double Chromosome::Representation::GaBinaryChromosome::GetDouble           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetDouble</code> method use <code>sizeof(double)*8</code> number of bits from <code>pos</code> position of chromosome's code to create <code>double</code> 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>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Methods returns created value from array of bits.</dd></dl>

</div>
</div><p>
<a class="anchor" name="e4e8f98584f9168d0be11c65fe5952d5"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::GetDouble" ref="e4e8f98584f9168d0be11c65fe5952d5" args="(double *output, int pos=0, int size=0) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::GetDouble           </td>
          <td>(</td>
          <td class="paramtype">double *&nbsp;</td>
          <td class="paramname"> <em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>GetDouble</code> method fills array of double values by extracting them from chromosome's code. If output array is bigger then chromosome's code, remaining values in output are set to 0. 
<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>output</em>&nbsp;</td><td>output array of values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>starting position in chromosome's code array of bits.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values which should be extracted.</td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="7ffed6c5861804d685d67c5f7ab032da"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromChar" ref="7ffed6c5861804d685d67c5f7ab032da" args="(char *input, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool * Chromosome::Representation::GaBinaryChromosome::FromChar           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>FromChar</code> method creates array of booleans which is equal to binary representation of array of input values of <code>char</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array. 
<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>input</em>&nbsp;</td><td>pointer to array of input values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values in input array.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to output array. Size of output array is <code>sizeof(char)*8</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="78577dd91b58e65da3b9a414ce9916b7"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromShort" ref="78577dd91b58e65da3b9a414ce9916b7" args="(short *input, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool * Chromosome::Representation::GaBinaryChromosome::FromShort           </td>
          <td>(</td>
          <td class="paramtype">short *&nbsp;</td>
          <td class="paramname"> <em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>FromShort</code> method creates array of booleans which is equal to binary representation of array of input values of <code>short</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array. 
<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>input</em>&nbsp;</td><td>pointer to array of input values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values in input array.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to output array. Size of output array is <code>sizeof(short)*8</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="640c946b7f52d339798f2d0766011420"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromInt" ref="640c946b7f52d339798f2d0766011420" args="(int *input, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool * Chromosome::Representation::GaBinaryChromosome::FromInt           </td>
          <td>(</td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>FromInt</code> method creates array of booleans which is equal to binary representation of array of input values of <code>int</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array. 
<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>input</em>&nbsp;</td><td>pointer to array of input values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values in input array.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to output array. Size of output array is <code>sizeof(int)*8</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="1ac113f88abe066a5bc998ebe12f1208"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromFloat" ref="1ac113f88abe066a5bc998ebe12f1208" args="(float *input, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool * Chromosome::Representation::GaBinaryChromosome::FromFloat           </td>
          <td>(</td>
          <td class="paramtype">float *&nbsp;</td>
          <td class="paramname"> <em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>FromFloat</code> method creates array of booleans which is equal to binary representation of array of input values of <code>float</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array. 
<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>input</em>&nbsp;</td><td>pointer to array of input values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values in input array.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to output array. Size of output array is <code>sizeof(float)*8</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="7d0826ec3ae51fd698e4b92e7c5f6718"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::FromDouble" ref="7d0826ec3ae51fd698e4b92e7c5f6718" args="(double *input, int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool * Chromosome::Representation::GaBinaryChromosome::FromDouble           </td>
          <td>(</td>
          <td class="paramtype">double *&nbsp;</td>
          <td class="paramname"> <em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>FromDouble</code> method creates array of booleans which is equal to binary representation of array of input values of <code>double</code> type. Produced array can be used as chromosome's code of binary chromosome. Caller is responsible for memory allocated by this method for output array. 
<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>input</em>&nbsp;</td><td>pointer to array of input values.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>number of values in input array.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Method returns pointer to output array. Size of output array is <code>sizeof(double)*8</code>.</dd></dl>

</div>
</div><p>
<a class="anchor" name="4de54540057f5ba1051c7e1ac890e728"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::PreapareForMutation" ref="4de54540057f5ba1051c7e1ac890e728" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::PreapareForMutation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>PreapareForMutation</code> method creates backup of current code and saves its size. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_default_chromosome.html#06f5db9c612501ef15e26b269898a3c4">Chromosome::GaDefaultChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="589fcfe04cef443c3da65aff870b7647"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::AcceptMutation" ref="589fcfe04cef443c3da65aff870b7647" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::AcceptMutation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This method only deletes backup copy. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_default_chromosome.html#ca9543fe2ed696be3b935945766c9f7c">Chromosome::GaDefaultChromosome</a>.</p>

</div>
</div><p>
<a class="anchor" name="73736ac2cb4d8efdab732ae5b5fe0dd0"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::RejectMutation" ref="73736ac2cb4d8efdab732ae5b5fe0dd0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Chromosome::Representation::GaBinaryChromosome::RejectMutation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>RejectMutation</code> method deletes current chromosome's code and restores it from backup copy. 
<p>
This method is not thread-safe. 
<p>Implements <a class="el" href="class_chromosome_1_1_ga_default_chromosome.html#6d83d4d58c36bdd153268002753f2623">Chromosome::GaDefaultChromosome</a>.</p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="f3c40512350f8f7fd8b38b2581f905f6"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::_bits" ref="f3c40512350f8f7fd8b38b2581f905f6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool* <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#f3c40512350f8f7fd8b38b2581f905f6">Chromosome::Representation::GaBinaryChromosome::_bits</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Array of booleans which represents binary code. 
<p>

</div>
</div><p>
<a class="anchor" name="088552963698afd0b677abb99f3745df"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::_codeSize" ref="088552963698afd0b677abb99f3745df" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#088552963698afd0b677abb99f3745df">Chromosome::Representation::GaBinaryChromosome::_codeSize</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Number of bits in code. 
<p>

</div>
</div><p>
<a class="anchor" name="b65fdde833edc6e1b51783ca25fbc17c"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::_backupBits" ref="b65fdde833edc6e1b51783ca25fbc17c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool* <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#b65fdde833edc6e1b51783ca25fbc17c">Chromosome::Representation::GaBinaryChromosome::_backupBits</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Array of backed-up bits of chromosome's code. 
<p>

</div>
</div><p>
<a class="anchor" name="fb0aa1d6df32e9e93a99de66aa365f23"></a><!-- doxytag: member="Chromosome::Representation::GaBinaryChromosome::_backupSize" ref="fb0aa1d6df32e9e93a99de66aa365f23" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_chromosome_1_1_representation_1_1_ga_binary_chromosome.html#fb0aa1d6df32e9e93a99de66aa365f23">Chromosome::Representation::GaBinaryChromosome::_backupSize</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Number of bits in backed-up code. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>source/<a class="el" href="_binary_chromosome_8h.html">BinaryChromosome.h</a><li>source/<a class="el" href="_binary_chromosome_8cpp.html">BinaryChromosome.cpp</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