intelligence
Version:
Machine learning library written in javascript
1,051 lines (350 loc) • 16.1 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: LinearFunctionNode</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: LinearFunctionNode</h1>
<section>
<header>
<h2>
LinearFunctionNode
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="LinearFunctionNode"><span class="type-signature"></span>new LinearFunctionNode<span class="signature">(func, registerSet)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Linear genetic programming function node</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>func</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>A function that this node will represent</p></td>
</tr>
<tr>
<td class="name"><code>registerSet</code></td>
<td class="type">
<span class="param-type"><a href="RegisterSet.html">RegisterSet</a></span>
</td>
<td class="description last"><p>A register set instance</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>targetRegister</code></td>
<td class="type">
<span class="param-type"><a href="RegisterReference.html">RegisterReference</a></span>
</td>
<td class="description last"><p>A target register reference</p></td>
</tr>
</tbody>
</table></dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearFunctionNode.js.html">genetic/linear/linearFunctionNode.js</a>, <a href="linearFunctionNode.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="LinearGPNode.html">LinearGPNode</a></li>
</ul>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="execute"><span class="type-signature"></span>execute<span class="signature">(registerSet)</span><span class="type-signature"> → {<a href="LinearFunctionNode.html">LinearFunctionNode</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Sets the target register value based on the return value of the function from the given register set</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>registerSet</code></td>
<td class="type">
<span class="param-type"><a href="RegisterSet.html">RegisterSet</a></span>
</td>
<td class="description last"><p>A register set instance</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearFunctionNode.js.html">genetic/linear/linearFunctionNode.js</a>, <a href="linearFunctionNode.js.html#line42">line 42</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Reference to current object for chaining</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="LinearFunctionNode.html">LinearFunctionNode</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getArgumentsString"><span class="type-signature"></span>getArgumentsString<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns a comma seperated string of input registers</p>
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="LinearGPNode.html#getArgumentsString">LinearGPNode#getArgumentsString</a>
</li></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearGPNode.js.html">genetic/linear/linearGPNode.js</a>, <a href="linearGPNode.js.html#line56">line 56</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A comma seperated string of input registers</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getFuncReturnValue"><span class="type-signature"></span>getFuncReturnValue<span class="signature">(registerSet)</span><span class="type-signature"> → {*}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns the value returned by the nodes function based on the input values from a given register set</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>registerSet</code></td>
<td class="type">
<span class="param-type"><a href="RegisterSet.html">RegisterSet</a></span>
</td>
<td class="description last"><p>A register set instance</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="LinearGPNode.html#getFuncReturnValue">LinearGPNode#getFuncReturnValue</a>
</li></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearGPNode.js.html">genetic/linear/linearGPNode.js</a>, <a href="linearGPNode.js.html#line44">line 44</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Functon return value</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setInputRegisters"><span class="type-signature"></span>setInputRegisters<span class="signature">(registerSet)</span><span class="type-signature"> → {<a href="LinearGPNode.html">LinearGPNode</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Randomly sets two input registers based on the provided register set</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>registerSet</code></td>
<td class="type">
<span class="param-type"><a href="RegisterSet.html">RegisterSet</a></span>
</td>
<td class="description last"><p>A register set instance</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="LinearGPNode.html#setInputRegisters">LinearGPNode#setInputRegisters</a>
</li></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearGPNode.js.html">genetic/linear/linearGPNode.js</a>, <a href="linearGPNode.js.html#line23">line 23</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Reference to current object for chaining</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="LinearGPNode.html">LinearGPNode</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="setTargetRegister"><span class="type-signature"></span>setTargetRegister<span class="signature">(registerSet)</span><span class="type-signature"> → {<a href="LinearFunctionNode.html">LinearFunctionNode</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Randomly sets the target register based on the provided register set</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>registerSet</code></td>
<td class="type">
<span class="param-type"><a href="RegisterSet.html">RegisterSet</a></span>
</td>
<td class="description last"><p>A register set instance</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearFunctionNode.js.html">genetic/linear/linearFunctionNode.js</a>, <a href="linearFunctionNode.js.html#line27">line 27</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Reference to current object for chaining</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="LinearFunctionNode.html">LinearFunctionNode</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Returns a string representation of the linear function node</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="linearFunctionNode.js.html">genetic/linear/linearFunctionNode.js</a>, <a href="linearFunctionNode.js.html#line51">line 51</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>A string representation of the linear function node</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Individual.html">Individual</a></li><li><a href="LinearConditionalNode.html">LinearConditionalNode</a></li><li><a href="LinearFunctionNode.html">LinearFunctionNode</a></li><li><a href="LinearGPNode.html">LinearGPNode</a></li><li><a href="LinearIndividual.html">LinearIndividual</a></li><li><a href="Population.html">Population</a></li><li><a href="RegisterReference.html">RegisterReference</a></li><li><a href="RegisterSet.html">RegisterSet</a></li></ul><h3>Global</h3><ul><li><a href="global.html#alphabet">alphabet</a></li><li><a href="global.html#arrayEqual">arrayEqual</a></li><li><a href="global.html#binaryNumber">binaryNumber</a></li><li><a href="global.html#binaryString">binaryString</a></li><li><a href="global.html#createCalculation">createCalculation</a></li><li><a href="global.html#createConstant">createConstant</a></li><li><a href="global.html#createInput">createInput</a></li><li><a href="global.html#createOutput">createOutput</a></li><li><a href="global.html#formatString">formatString</a></li><li><a href="global.html#fpEqual">fpEqual</a></li><li><a href="global.html#inherits">inherits</a></li><li><a href="global.html#linearNode">linearNode</a></li><li><a href="global.html#onePointFixed">onePointFixed</a></li><li><a href="global.html#onePointVariable">onePointVariable</a></li><li><a href="global.html#randBetween">randBetween</a></li><li><a href="global.html#random">random</a></li><li><a href="global.html#randomNumber">randomNumber</a></li><li><a href="global.html#rank">rank</a></li><li><a href="global.html#rouletteWheel">rouletteWheel</a></li><li><a href="global.html#selectRandom">selectRandom</a></li><li><a href="global.html#swapGenes">swapGenes</a></li><li><a href="global.html#tournament">tournament</a></li><li><a href="global.html#twoPointFixed">twoPointFixed</a></li><li><a href="global.html#twoPointVariable">twoPointVariable</a></li><li><a href="global.html#uniform">uniform</a></li><li><a href="global.html#validateFixedLength">validateFixedLength</a></li><li><a href="global.html#validateMinimumLength">validateMinimumLength</a></li><li><a href="global.html#validateVariableLength">validateVariableLength</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Sat Aug 16 2014 23:33:39 GMT+0100 (GMT Summer Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>