<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=“www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>

Class: NEAT::Neuron

  &mdash; Documentation by YARD 0.8.7.3

</title>

<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type=“text/javascript” charset=“utf-8”>

hasFrames = window.top.frames.main ? true : false;
relpath = '../';
framesUrl = "../frames.html#!" + escape(window.location.href);

</script>

<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>

</head>
<body>
  <div id="header">
    <div id="menu">

  <a href="../_index.html">Index (N)</a> &raquo;
  <span class='title'><span class='object_link'><a href="../NEAT.html" title="NEAT (module)">NEAT</a></span></span>
   &raquo; 
  <span class="title">Neuron</span>

<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>

</div>

  <div id="search">

<a class="full_list_link" id="class_list_link"
    href="../class_list.html">
  Class List
</a>

<a class="full_list_link" id="method_list_link"
    href="../method_list.html">
  Method List
</a>

<a class="full_list_link" id="file_list_link"
    href="../file_list.html">
  File List
</a>

</div>

  <div class="clear"></div>
</div>

<iframe id="search_frame"></iframe>

<div id="content"><h1>Class: NEAT::Neuron

</h1>

<dl class=“box”>

<dt class="r1">Inherits:</dt>
<dd class="r1">
  <span class="inheritName"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></span>

    <ul class="fullTree">
      <li>Object</li>

        <li class="next"><span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></li>

        <li class="next">NEAT::Neuron</li>

    </ul>
    <a href="#" class="inheritanceTree">show all</a>

  </dd>

  <dt class="r2">Includes:</dt>
  <dd class="r2">Math, <span class='object_link'><a href="Graph.html" title="NEAT::Graph (module)">Graph</a></span></dd>

<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">lib/rubyneat/neuron.rb</dd>

</dl> <div class=“clear”></div>

<h2>Overview</h2><div class=“docstring”>

<div class="discussion">

<h1 id=“label-Neuron+–+Basis+of+all+Neat+Neuron+types.”>Neuron – Basis of all Neat Neuron types.</h1>

<p>Normally contains primatives which aids in its own expression, but the details of this remains to be worked out.</p>

</div>

</div> <div class=“tags”>

</div><div id=“subclasses”>

<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="BasicNeuronTypes/CosineNeuron.html" title="NEAT::BasicNeuronTypes::CosineNeuron (class)">BasicNeuronTypes::CosineNeuron</a></span>, <span class='object_link'><a href="BasicNeuronTypes/InputNeuron.html" title="NEAT::BasicNeuronTypes::InputNeuron (class)">BasicNeuronTypes::InputNeuron</a></span>, <span class='object_link'><a href="BasicNeuronTypes/SigmoidNeuron.html" title="NEAT::BasicNeuronTypes::SigmoidNeuron (class)">BasicNeuronTypes::SigmoidNeuron</a></span>, <span class='object_link'><a href="BasicNeuronTypes/SineNeuron.html" title="NEAT::BasicNeuronTypes::SineNeuron (class)">BasicNeuronTypes::SineNeuron</a></span>, <span class='object_link'><a href="BasicNeuronTypes/TanhNeuron.html" title="NEAT::BasicNeuronTypes::TanhNeuron (class)">BasicNeuronTypes::TanhNeuron</a></span></p>

</div>

<h2>Constant Summary</h2>

  <dl class="constants">

      <dt id="neuron_types-classvariable" class="">@@neuron_types =
        <div class="docstring">
<div class="discussion">

<p>List of neuron types defined.</p>

</div>

</div> <div class=“tags”>

</div>

      </dt>
      <dd><pre class="code"><span class='lbracket'>[</span><span class='rbracket'>]</span></pre></dd>

  </dl>

<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">

    <li class="public ">
<span class="summary_signature">

    <a href="#genotype-instance_method" title="#genotype (instance method)">- (Object) <strong>genotype</strong> </a>

</span>

    <span class="note title readonly">readonly</span>

  <span class="summary_desc"><div class='inline'>

<p>Genotype to which we belong.</p> </div></span>

</li>

    <li class="public ">
<span class="summary_signature">

    <a href="#heirarchy_number-instance_method" title="#heirarchy_number (instance method)">- (Object) <strong>heirarchy_number</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>(assigned by wire!) Heirarchy number in the Genome / Critter We need this to assure we add genes in the proper order.</p> </div></span>

</li>

    <li class="public ">
<span class="summary_signature">

    <a href="#output-instance_method" title="#output (instance method)">- (Object) <strong>output</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>This is true if this is an output neuron.</p> </div></span>

</li>

    <li class="public ">
<span class="summary_signature">

    <a href="#trait-instance_method" title="#trait (instance method)">- (Object) <strong>trait</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>Returns the value of attribute trait.</p> </div></span>

</li>

</ul>

<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></h3>
<p class="inherited"><span class='object_link'><a href="NeatOb.html#controller-instance_method" title="NEAT::NeatOb#controller (method)">#controller</a></span>, <span class='object_link'><a href="NeatOb.html#name-instance_method" title="NEAT::NeatOb#name (method)">#name</a></span></p>

  <h2>
    Class Method Summary
    <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
  </h2>

  <ul class="summary">

      <li class="public ">
<span class="summary_signature">

    <a href="#bias%3F-class_method" title="bias? (class method)">+ (Boolean) <strong>bias?</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'></div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#inherited-class_method" title="inherited (class method)">+ (Object) <strong>inherited</strong>(clazz) </a>

</span>

  <span class="summary_desc"><div class='inline'></div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#input%3F-class_method" title="input? (class method)">+ (Boolean) <strong>input?</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>Class is is of Input type?.</p> </div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#neuron_types-class_method" title="neuron_types (class method)">+ (Object) <strong>neuron_types</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>List of distinct neuron types (classes).</p> </div></span>

</li>

  </ul>

  <h2>
    Instance Method Summary
    <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
  </h2>

  <ul class="summary">

      <li class="public ">
<span class="summary_signature">

    <a href="#bias%3F-instance_method" title="#bias? (instance method)">- (Boolean) <strong>bias?</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'></div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#express-instance_method" title="#express (instance method)">- (Object) <strong>express</strong>(instance) </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>Function must be implemented by subclasses for phenotype generation.</p> </div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#input%3F-instance_method" title="#input? (instance method)">- (Boolean) <strong>input?</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'></div></span>

</li>

      <li class="public ">
<span class="summary_signature">

    <a href="#output%3F-instance_method" title="#output? (instance method)">- (Boolean) <strong>output?</strong> </a>

</span>

  <span class="summary_desc"><div class='inline'>

<p>Instantiation is of outout type?.</p> </div></span>

</li>

  </ul>

<h3 class="inherited">Methods included from <span class='object_link'><a href="Graph.html" title="NEAT::Graph (module)">Graph</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Graph.html#%3C%3C-instance_method" title="NEAT::Graph#&lt;&lt; (method)">#<<</a></span>, <span class='object_link'><a href="Graph.html#add-instance_method" title="NEAT::Graph#add (method)">#add</a></span>, <span class='object_link'><a href="Graph.html#clear_graph-instance_method" title="NEAT::Graph#clear_graph (method)">#clear_graph</a></span>, <span class='object_link'><a href="Graph.html#inputs-instance_method" title="NEAT::Graph#inputs (method)">#inputs</a></span></p>

<h3 class="inherited">Methods inherited from <span class='object_link'><a href="NeatOb.html" title="NEAT::NeatOb (class)">NeatOb</a></span></h3>
<p class="inherited"><span class='object_link'><a href="NeatOb.html#initialize-instance_method" title="NEAT::NeatOb#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="NeatOb.html#log-instance_method" title="NEAT::NeatOb#log (method)">#log</a></span>, <span class='object_link'><a href="NeatOb.html#log-class_method" title="NEAT::NeatOb.log (method)">log</a></span>, <span class='object_link'><a href="NeatOb.html#to_s-instance_method" title="NEAT::NeatOb#to_s (method)">#to_s</a></span></p>

<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>

  <p class="notice">This class inherits a constructor from <span class='object_link'><a href="NeatOb.html#initialize-instance_method" title="NEAT::NeatOb#initialize (method)">NEAT::NeatOb</a></span></p>

</div>

<div id="instance_attr_details" class="attr_details">
  <h2>Instance Attribute Details</h2>

    <span id=""></span>
    <div class="method_details first">
<h3 class="signature first" id="genotype-instance_method">

  - (<tt>Object</tt>) <strong>genotype</strong>  <span class="extras">(readonly)</span>

</h3><div class=“docstring”>

<div class="discussion">

<p>Genotype to which we belong</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

19 20 21</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 19</span>

<span class='kw'>def</span> <span class='id identifier rubyid_genotype'>genotype</span>

<span class='ivar'>@genotype</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <span id="heirarchy_number=-instance_method"></span>
    <div class="method_details ">
<h3 class="signature " id="heirarchy_number-instance_method">

  - (<tt>Object</tt>) <strong>heirarchy_number</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>(assigned by wire!) Heirarchy number in the Genome / Critter We need this to assure we add genes in the proper order. This will be recalculated every time a new neuron is added.</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

25 26 27</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 25</span>

<span class='kw'>def</span> <span class='id identifier rubyid_heirarchy_number'>heirarchy_number</span>

<span class='ivar'>@heirarchy_number</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <span id="output=-instance_method"></span>
    <div class="method_details ">
<h3 class="signature " id="output-instance_method">

  - (<tt>Object</tt>) <strong>output</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>This is true if this is an output neuron.</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

28 29 30</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 28</span>

<span class='kw'>def</span> <span class='id identifier rubyid_output'>output</span>

<span class='ivar'>@output</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <span id="trait=-instance_method"></span>
    <div class="method_details ">
<h3 class="signature " id="trait-instance_method">

  - (<tt>Object</tt>) <strong>trait</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>Returns the value of attribute trait</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

20 21 22</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 20</span>

<span class='kw'>def</span> <span class='id identifier rubyid_trait'>trait</span>

<span class='ivar'>@trait</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

</div>

<div id="class_method_details" class="method_details_list">
  <h2>Class Method Details</h2>

    <div class="method_details first">
<h3 class="signature first" id="bias?-class_method">

  + (<tt>Boolean</tt>) <strong>bias?</strong>

</h3><div class=“docstring”>

<div class="discussion">

</div>

</div> <div class=“tags”>

<p class=“tag_title”>Returns:</p> <ul class=“return”>

<li>

    <span class='type'>(<tt>Boolean</tt>)</span>

</li>

</ul>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

37</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 37</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_bias?'>bias?</span> <span class='semicolon'>;</span> <span class='kw'>false</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="inherited-class_method">

  + (<tt>Object</tt>) <strong>inherited</strong>(clazz)

</h3><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

43 44 45</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 43</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inherited'>inherited</span><span class='lparen'>(</span><span class='id identifier rubyid_clazz'>clazz</span><span class='rparen'>)</span>

<span class='cvar'>@@neuron_types</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_clazz'>clazz</span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="input?-class_method">

  + (<tt>Boolean</tt>) <strong>input?</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>Class is is of Input type?</p>

</div>

</div> <div class=“tags”>

<p class=“tag_title”>Returns:</p> <ul class=“return”>

<li>

    <span class='type'>(<tt>Boolean</tt>)</span>

</li>

</ul>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

34</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 34</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_input?'>input?</span> <span class='semicolon'>;</span> <span class='kw'>false</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="neuron_types-class_method">

  + (<tt>Object</tt>) <strong>neuron_types</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>List of distinct neuron types (classes)</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

48</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 48</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_neuron_types'>neuron_types</span><span class='semicolon'>;</span> <span class='cvar'>@@neuron_types</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

</div>

<div id="instance_method_details" class="method_details_list">
  <h2>Instance Method Details</h2>

    <div class="method_details first">
<h3 class="signature first" id="bias?-instance_method">

  - (<tt>Boolean</tt>) <strong>bias?</strong>

</h3><div class=“docstring”>

<div class="discussion">

</div>

</div> <div class=“tags”>

<p class=“tag_title”>Returns:</p> <ul class=“return”>

<li>

    <span class='type'>(<tt>Boolean</tt>)</span>

</li>

</ul>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

38</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 38</span>

<span class='kw'>def</span> <span class='id identifier rubyid_bias?'>bias?</span> <span class='semicolon'>;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_bias?'>bias?</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="express-instance_method">

  - (<tt>Object</tt>) <strong>express</strong>(instance)

</h3><div class=“docstring”>

<div class="discussion">

<p>Function must be implemented by subclasses for phenotype generation. Basically, an instance is passed to this function and it will add a function to sum all inputs and a apply an operator to the sum.</p>

</div>

</div> <div class=“tags”>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

54 55 56</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 54</span>

<span class='kw'>def</span> <span class='id identifier rubyid_express'>express</span><span class='lparen'>(</span><span class='id identifier rubyid_instance'>instance</span><span class='rparen'>)</span>

<span class='id identifier rubyid_raise'>raise</span> <span class='const'>NeatException</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>express() must be implemented by subclass.</span><span class='tstring_end'>&quot;</span></span>

<span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="input?-instance_method">

  - (<tt>Boolean</tt>) <strong>input?</strong>

</h3><div class=“docstring”>

<div class="discussion">

</div>

</div> <div class=“tags”>

<p class=“tag_title”>Returns:</p> <ul class=“return”>

<li>

    <span class='type'>(<tt>Boolean</tt>)</span>

</li>

</ul>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

35</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 35</span>

<span class='kw'>def</span> <span class='id identifier rubyid_input?'>input?</span> <span class='semicolon'>;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_input?'>input?</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

    <div class="method_details ">
<h3 class="signature " id="output?-instance_method">

  - (<tt>Boolean</tt>) <strong>output?</strong>

</h3><div class=“docstring”>

<div class="discussion">

<p>Instantiation is of outout type?</p>

</div>

</div> <div class=“tags”>

<p class=“tag_title”>Returns:</p> <ul class=“return”>

<li>

    <span class='type'>(<tt>Boolean</tt>)</span>

</li>

</ul>

</div><table class=“source_code”>

<tr>
  <td>
    <pre class="lines">

41</pre>

</td>
<td>
  <pre class="code"><span class="info file"># File 'lib/rubyneat/neuron.rb', line 41</span>

<span class='kw'>def</span> <span class='id identifier rubyid_output?'>output?</span> <span class='semicolon'>;</span> <span class='op'>!</span><span class='op'>!</span><span class='ivar'>@output</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>

  </td>
</tr>

</table> </div>

</div>

</div>

  <div id="footer">
Generated on Sun Mar 16 16:36:51 2014 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.3 (ruby-2.1.1).

</div>

</body>

</html>