aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.classpath4
-rw-r--r--doc/allclasses-frame.html2
-rw-r--r--doc/allclasses-noframe.html2
-rw-r--r--doc/index-files/index-12.html4
-rw-r--r--doc/index-files/index-17.html2
-rw-r--r--doc/index-files/index-3.html6
-rw-r--r--doc/index-files/index-7.html2
-rw-r--r--doc/jcgp/backend/population/Chromosome.html12
-rw-r--r--doc/jcgp/backend/population/Input.html4
-rw-r--r--doc/jcgp/backend/population/MutableElement.html30
-rw-r--r--doc/jcgp/backend/population/Node.html24
-rw-r--r--doc/jcgp/backend/population/Output.html18
-rw-r--r--doc/jcgp/backend/population/class-use/Connection.html2
-rw-r--r--doc/jcgp/backend/population/class-use/MutableElement.html38
-rw-r--r--doc/jcgp/backend/population/package-frame.html2
-rw-r--r--doc/jcgp/backend/population/package-summary.html4
-rw-r--r--doc/jcgp/backend/population/package-tree.html6
-rw-r--r--doc/jcgp/backend/population/package-use.html4
-rw-r--r--doc/overview-tree.html6
-rw-r--r--res/README2
-rw-r--r--src/jcgp/JCGP.java171
-rw-r--r--src/jcgp/backend/modules/mutator/PointMutator.java6
-rw-r--r--src/jcgp/backend/modules/problem/BestFitness.java18
-rw-r--r--src/jcgp/backend/modules/problem/DigitalCircuitProblem.java14
-rw-r--r--src/jcgp/backend/modules/problem/Problem.java2
-rw-r--r--src/jcgp/backend/modules/problem/SymbolicRegressionProblem.java16
-rw-r--r--src/jcgp/backend/modules/problem/TestCaseProblem.java19
-rw-r--r--src/jcgp/backend/parsers/ChromosomeParser.java1
-rw-r--r--src/jcgp/backend/population/Chromosome.java4
-rw-r--r--src/jcgp/backend/population/Mutable.java (renamed from src/jcgp/backend/population/MutableElement.java)6
-rw-r--r--src/jcgp/backend/population/Node.java6
-rw-r--r--src/jcgp/backend/population/Output.java6
-rw-r--r--src/jcgp/backend/tests/ChromosomeTests.java6
33 files changed, 173 insertions, 276 deletions
diff --git a/.classpath b/.classpath
index 591a691..3e0fb27 100644
--- a/.classpath
+++ b/.classpath
@@ -3,9 +3,5 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="lib" path="/home/eddy/project/development/res/reflections-0.9.9-RC1-uberjar.jar"/>
- <classpathentry kind="lib" path="/home/eddy/project/development/res/guava-17.0.jar"/>
- <classpathentry kind="lib" path="/home/eddy/project/development/res/slf4j-1.7.7/slf4j-api-1.7.7.jar"/>
- <classpathentry kind="lib" path="/home/eddy/project/development/res/javassist-3.18.0-GA/javassist.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html
index c791e91..4d8b0d4 100644
--- a/doc/allclasses-frame.html
+++ b/doc/allclasses-frame.html
@@ -69,7 +69,7 @@
<li><a href="jcgp/backend/resources/ModifiableResources.html" title="class in jcgp.backend.resources" target="classFrame">ModifiableResources</a></li>
<li><a href="jcgp/backend/modules/Module.html" title="class in jcgp.backend.modules" target="classFrame">Module</a></li>
<li><a href="jcgp/backend/modules/es/MuPlusLambda.html" title="class in jcgp.backend.modules.es" target="classFrame">MuPlusLambda</a></li>
-<li><a href="jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population" target="classFrame"><span class="interfaceName">MutableElement</span></a></li>
+<li><a href="jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population" target="classFrame"><span class="interfaceName">Mutable</span></a></li>
<li><a href="jcgp/backend/modules/mutator/Mutator.html" title="class in jcgp.backend.modules.mutator" target="classFrame">Mutator</a></li>
<li><a href="jcgp/backend/population/Node.html" title="class in jcgp.backend.population" target="classFrame">Node</a></li>
<li><a href="jcgp/backend/population/Output.html" title="class in jcgp.backend.population" target="classFrame">Output</a></li>
diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html
index 8f35f98..c5c077a 100644
--- a/doc/allclasses-noframe.html
+++ b/doc/allclasses-noframe.html
@@ -69,7 +69,7 @@
<li><a href="jcgp/backend/resources/ModifiableResources.html" title="class in jcgp.backend.resources">ModifiableResources</a></li>
<li><a href="jcgp/backend/modules/Module.html" title="class in jcgp.backend.modules">Module</a></li>
<li><a href="jcgp/backend/modules/es/MuPlusLambda.html" title="class in jcgp.backend.modules.es">MuPlusLambda</a></li>
-<li><a href="jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="interfaceName">MutableElement</span></a></li>
+<li><a href="jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="interfaceName">Mutable</span></a></li>
<li><a href="jcgp/backend/modules/mutator/Mutator.html" title="class in jcgp.backend.modules.mutator">Mutator</a></li>
<li><a href="jcgp/backend/population/Node.html" title="class in jcgp.backend.population">Node</a></li>
<li><a href="jcgp/backend/population/Output.html" title="class in jcgp.backend.population">Output</a></li>
diff --git a/doc/index-files/index-12.html b/doc/index-files/index-12.html
index d69ad68..267c417 100644
--- a/doc/index-files/index-12.html
+++ b/doc/index-files/index-12.html
@@ -117,9 +117,9 @@
<dd>
<div class="block">Creates a new instance of MuPlusLambda.</div>
</dd>
-<dt><a href="../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">MutableElement</span></a> - Interface in <a href="../jcgp/backend/population/package-summary.html">jcgp.backend.population</a></dt>
+<dt><a href="../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Mutable</span></a> - Interface in <a href="../jcgp/backend/population/package-summary.html">jcgp.backend.population</a></dt>
<dd>
-<div class="block"><code>MutableElement</code> declares the expected behaviour of any
+<div class="block"><code>Mutable</code> declares the expected behaviour of any
part of a chromosome that is mutable, more specifically
nodes or outputs.</div>
</dd>
diff --git a/doc/index-files/index-17.html b/doc/index-files/index-17.html
index d078f88..b609fb2 100644
--- a/doc/index-files/index-17.html
+++ b/doc/index-files/index-17.html
@@ -110,7 +110,7 @@
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="../jcgp/backend/resources/ModifiableResources.html#setColumns-int-">setColumns(int)</a></span> - Method in class jcgp.backend.resources.<a href="../jcgp/backend/resources/ModifiableResources.html" title="class in jcgp.backend.resources">ModifiableResources</a></dt>
<dd>&nbsp;</dd>
-<dt><span class="memberNameLink"><a href="../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">setConnection(int, Connection)</a></span> - Method in interface jcgp.backend.population.<a href="../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></dt>
+<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">setConnection(int, Connection)</a></span> - Method in interface jcgp.backend.population.<a href="../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></dt>
<dd>
<div class="block">This method sets the indexed connection to the specified new connection.</div>
</dd>
diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html
index 2833121..7b7d4d2 100644
--- a/doc/index-files/index-3.html
+++ b/doc/index-files/index-3.html
@@ -141,7 +141,7 @@
<div class="block">Creates a deep copy of the specified chromosome in the
this instance.</div>
</dd>
-<dt><span class="memberNameLink"><a href="../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">copyOf(MutableElement)</a></span> - Method in interface jcgp.backend.population.<a href="../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></dt>
+<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">copyOf(Mutable)</a></span> - Method in interface jcgp.backend.population.<a href="../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></dt>
<dd>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
@@ -162,9 +162,9 @@
not necessarily true since it is possible that a == c.
</div>
</dd>
-<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.MutableElement-">copyOf(MutableElement)</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Node.html" title="class in jcgp.backend.population">Node</a></dt>
+<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.Mutable-">copyOf(Mutable)</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Node.html" title="class in jcgp.backend.population">Node</a></dt>
<dd>&nbsp;</dd>
-<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.MutableElement-">copyOf(MutableElement)</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Output.html" title="class in jcgp.backend.population">Output</a></dt>
+<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.Mutable-">copyOf(Mutable)</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Output.html" title="class in jcgp.backend.population">Output</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="../jcgp/backend/function/SymbolicRegressionFunctions.Cosine.html#Cosine--">Cosine()</a></span> - Constructor for class jcgp.backend.function.<a href="../jcgp/backend/function/SymbolicRegressionFunctions.Cosine.html" title="class in jcgp.backend.function">SymbolicRegressionFunctions.Cosine</a></dt>
<dd>&nbsp;</dd>
diff --git a/doc/index-files/index-7.html b/doc/index-files/index-7.html
index f92083f..30395b3 100644
--- a/doc/index-files/index-7.html
+++ b/doc/index-files/index-7.html
@@ -408,7 +408,7 @@
<div class="block">Gets the next random integer using the experiment's random
number generator.</div>
</dd>
-<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Chromosome.html#getRandomMutableElement--">getRandomMutableElement()</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Chromosome.html" title="class in jcgp.backend.population">Chromosome</a></dt>
+<dt><span class="memberNameLink"><a href="../jcgp/backend/population/Chromosome.html#getRandomMutable--">getRandomMutable()</a></span> - Method in class jcgp.backend.population.<a href="../jcgp/backend/population/Chromosome.html" title="class in jcgp.backend.population">Chromosome</a></dt>
<dd>
<div class="block">This method is useful for mutating chromosomes.</div>
</dd>
diff --git a/doc/jcgp/backend/population/Chromosome.html b/doc/jcgp/backend/population/Chromosome.html
index ffcb6f8..75ec3c1 100644
--- a/doc/jcgp/backend/population/Chromosome.html
+++ b/doc/jcgp/backend/population/Chromosome.html
@@ -274,8 +274,8 @@ implements java.lang.Comparable&lt;<a href="../../../jcgp/backend/population/Chr
</td>
</tr>
<tr id="i11" class="rowColor">
-<td class="colFirst"><code><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Chromosome.html#getRandomMutableElement--">getRandomMutableElement</a></span>()</code>
+<td class="colFirst"><code><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Chromosome.html#getRandomMutable--">getRandomMutable</a></span>()</code>
<div class="block">This method is useful for mutating chromosomes.</div>
</td>
</tr>
@@ -509,15 +509,15 @@ implements java.lang.Comparable&lt;<a href="../../../jcgp/backend/population/Chr
</dl>
</li>
</ul>
-<a name="getRandomMutableElement--">
+<a name="getRandomMutable--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
-<h4>getRandomMutableElement</h4>
-<pre>public&nbsp;<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;getRandomMutableElement()</pre>
+<h4>getRandomMutable</h4>
+<pre>public&nbsp;<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;getRandomMutable()</pre>
<div class="block">This method is useful for mutating chromosomes. It returns any
- random <code>MutableElement</code> out of the chromosome with equal
+ random <code>Mutable</code> out of the chromosome with equal
probability.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
diff --git a/doc/jcgp/backend/population/Input.html b/doc/jcgp/backend/population/Input.html
index 1ac3b97..f78663e 100644
--- a/doc/jcgp/backend/population/Input.html
+++ b/doc/jcgp/backend/population/Input.html
@@ -50,7 +50,7 @@ var activeTableTab = "activeTableTab";
<div class="subNav">
<ul class="navList">
<li><a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
-<li><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
+<li><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jcgp/backend/population/Input.html" target="_top">Frames</a></li>
@@ -317,7 +317,7 @@ implements <a href="../../../jcgp/backend/population/Connection.html" title="int
<div class="subNav">
<ul class="navList">
<li><a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
-<li><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
+<li><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jcgp/backend/population/Input.html" target="_top">Frames</a></li>
diff --git a/doc/jcgp/backend/population/MutableElement.html b/doc/jcgp/backend/population/MutableElement.html
index 4af7b7e..d3a6b6d 100644
--- a/doc/jcgp/backend/population/MutableElement.html
+++ b/doc/jcgp/backend/population/MutableElement.html
@@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_05) on Tue May 06 14:28:06 BST 2014 -->
-<title>MutableElement</title>
+<title>Mutable</title>
<meta name="date" content="2014-05-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="MutableElement";
+ parent.document.title="Mutable";
}
}
catch(err) {
@@ -40,7 +40,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
-<li><a href="class-use/MutableElement.html">Use</a></li>
+<li><a href="class-use/Mutable.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
@@ -53,8 +53,8 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
-<li><a href="../../../index.html?jcgp/backend/population/MutableElement.html" target="_top">Frames</a></li>
-<li><a href="MutableElement.html" target="_top">No&nbsp;Frames</a></li>
+<li><a href="../../../index.html?jcgp/backend/population/Mutable.html" target="_top">Frames</a></li>
+<li><a href="Mutable.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
@@ -93,7 +93,7 @@ var activeTableTab = "activeTableTab";
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">jcgp.backend.population</div>
-<h2 title="Interface MutableElement" class="title">Interface MutableElement</h2>
+<h2 title="Interface Mutable" class="title">Interface Mutable</h2>
</div>
<div class="contentContainer">
<div class="description">
@@ -105,8 +105,8 @@ var activeTableTab = "activeTableTab";
</dl>
<hr>
<br>
-<pre>public interface <span class="typeNameLabel">MutableElement</span></pre>
-<div class="block"><code>MutableElement</code> declares the expected behaviour of any
+<pre>public interface <span class="typeNameLabel">Mutable</span></pre>
+<div class="block"><code>Mutable</code> declares the expected behaviour of any
part of a chromosome that is mutable, more specifically
nodes or outputs. Inputs are not mutable since they don't have
connections or functions.
@@ -139,7 +139,7 @@ var activeTableTab = "activeTableTab";
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</code>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</code>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -162,7 +162,7 @@ var activeTableTab = "activeTableTab";
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></span>(int&nbsp;index,
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></span>(int&nbsp;index,
<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>&nbsp;newConnection)</code>
<div class="block">This method sets the indexed connection to the specified new connection.</div>
</td>
@@ -200,13 +200,13 @@ var activeTableTab = "activeTableTab";
</dl>
</li>
</ul>
-<a name="copyOf-jcgp.backend.population.MutableElement-">
+<a name="copyOf-jcgp.backend.population.Mutable-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>copyOf</h4>
-<pre>boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</pre>
+<pre>boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</pre>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -252,7 +252,7 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
-<li><a href="class-use/MutableElement.html">Use</a></li>
+<li><a href="class-use/Mutable.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
@@ -265,8 +265,8 @@ var activeTableTab = "activeTableTab";
<li><a href="../../../jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
-<li><a href="../../../index.html?jcgp/backend/population/MutableElement.html" target="_top">Frames</a></li>
-<li><a href="MutableElement.html" target="_top">No&nbsp;Frames</a></li>
+<li><a href="../../../index.html?jcgp/backend/population/Mutable.html" target="_top">Frames</a></li>
+<li><a href="Mutable.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
diff --git a/doc/jcgp/backend/population/Node.html b/doc/jcgp/backend/population/Node.html
index 9e7b9a5..ccd543a 100644
--- a/doc/jcgp/backend/population/Node.html
+++ b/doc/jcgp/backend/population/Node.html
@@ -49,7 +49,7 @@ var activeTableTab = "activeTableTab";
</div>
<div class="subNav">
<ul class="navList">
-<li><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
+<li><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
@@ -109,19 +109,19 @@ var activeTableTab = "activeTableTab";
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
-<dd><a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, <a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></dd>
+<dd><a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, <a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Node</span>
extends java.lang.Object
-implements <a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>, <a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a></pre>
+implements <a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>, <a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a></pre>
<div class="block">Nodes make up the main part of the chromosome,
where the actual functions are evolved. Each node
contains a function and a number of connections.
The node outputs the result of performing its function
on the values of its connections. Nodes therefore
- implement both <code>MutableElement</code> and <code>Connection</code>
+ implement both <code>Mutable</code> and <code>Connection</code>
since they can be mutated but also connected to.
Nodes are constructed with a fixed number of connections
(determined by the maximum arity of the function set)
@@ -174,7 +174,7 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</code>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</code>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -380,14 +380,14 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</dl>
</li>
</ul>
-<a name="copyOf-jcgp.backend.population.MutableElement-">
+<a name="copyOf-jcgp.backend.population.Mutable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyOf</h4>
-<pre>public&nbsp;boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</pre>
-<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">MutableElement</a></code></span></div>
+<pre>public&nbsp;boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</pre>
+<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">Mutable</a></code></span></div>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -408,7 +408,7 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</ul></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
-<dd><code><a href="../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></dd>
+<dd><code><a href="../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>element</code> - the mutable element to compare to.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
@@ -445,13 +445,13 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
<h4>setConnection</h4>
<pre>public&nbsp;void&nbsp;setConnection(int&nbsp;index,
<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>&nbsp;newConnection)</pre>
-<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">MutableElement</a></code></span></div>
+<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">Mutable</a></code></span></div>
<div class="block">This method sets the indexed connection to the specified new connection.
Implementing classes may choose to ignore the given index (such as in the
case of outputs, which only have one connection).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
-<dd><code><a href="../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></dd>
+<dd><code><a href="../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the connection index to set.</dd>
<dd><code>newConnection</code> - the chromosome element to connect to.</dd>
@@ -499,7 +499,7 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</div>
<div class="subNav">
<ul class="navList">
-<li><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
+<li><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
diff --git a/doc/jcgp/backend/population/Output.html b/doc/jcgp/backend/population/Output.html
index 38033e2..899b5d1 100644
--- a/doc/jcgp/backend/population/Output.html
+++ b/doc/jcgp/backend/population/Output.html
@@ -109,13 +109,13 @@ var activeTableTab = "activeTableTab";
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
-<dd><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></dd>
+<dd><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Output</span>
extends java.lang.Object
-implements <a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></pre>
+implements <a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></pre>
<div class="block">This is a chromosome output. Outputs are a special
type of mutable element with a single connection. It
returns the value of its single connection, but it
@@ -170,7 +170,7 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;m)</code>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;m)</code>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -316,23 +316,23 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
set.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
-<dd><code><a href="../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></dd>
+<dd><code><a href="../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the connection index to set.</dd>
<dd><code>newConnection</code> - the chromosome element to connect to.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
-<dd><a href="../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-"><code>MutableElement.setConnection(int, jcgp.backend.population.Connection)</code></a></dd>
+<dd><a href="../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-"><code>Mutable.setConnection(int, jcgp.backend.population.Connection)</code></a></dd>
</dl>
</li>
</ul>
-<a name="copyOf-jcgp.backend.population.MutableElement-">
+<a name="copyOf-jcgp.backend.population.Mutable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyOf</h4>
-<pre>public&nbsp;boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;m)</pre>
-<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">MutableElement</a></code></span></div>
+<pre>public&nbsp;boolean&nbsp;copyOf(<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;m)</pre>
+<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">Mutable</a></code></span></div>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -353,7 +353,7 @@ implements <a href="../../../jcgp/backend/population/MutableElement.html" title=
</ul></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
-<dd><code><a href="../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></dd>
+<dd><code><a href="../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></code>&nbsp;in interface&nbsp;<code><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>m</code> - the mutable element to compare to.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
diff --git a/doc/jcgp/backend/population/class-use/Connection.html b/doc/jcgp/backend/population/class-use/Connection.html
index 72f2fb4..ab91d1e 100644
--- a/doc/jcgp/backend/population/class-use/Connection.html
+++ b/doc/jcgp/backend/population/class-use/Connection.html
@@ -183,7 +183,7 @@
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
-<td class="colLast"><span class="typeNameLabel">MutableElement.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/MutableElement.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></span>(int&nbsp;index,
+<td class="colLast"><span class="typeNameLabel">Mutable.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Mutable.html#setConnection-int-jcgp.backend.population.Connection-">setConnection</a></span>(int&nbsp;index,
<a href="../../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>&nbsp;newConnection)</code>
<div class="block">This method sets the indexed connection to the specified new connection.</div>
</td>
diff --git a/doc/jcgp/backend/population/class-use/MutableElement.html b/doc/jcgp/backend/population/class-use/MutableElement.html
index 77bf35f..d5a2a98 100644
--- a/doc/jcgp/backend/population/class-use/MutableElement.html
+++ b/doc/jcgp/backend/population/class-use/MutableElement.html
@@ -3,7 +3,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_05) on Tue May 06 14:28:07 BST 2014 -->
-<title>Uses of Interface jcgp.backend.population.MutableElement</title>
+<title>Uses of Interface jcgp.backend.population.Mutable</title>
<meta name="date" content="2014-05-06">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Interface jcgp.backend.population.MutableElement";
+ parent.document.title="Uses of Interface jcgp.backend.population.Mutable";
}
}
catch(err) {
@@ -33,7 +33,7 @@
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
-<li><a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">Class</a></li>
+<li><a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
@@ -47,8 +47,8 @@
<li>Next</li>
</ul>
<ul class="navList">
-<li><a href="../../../../index.html?jcgp/backend/population/class-use/MutableElement.html" target="_top">Frames</a></li>
-<li><a href="MutableElement.html" target="_top">No&nbsp;Frames</a></li>
+<li><a href="../../../../index.html?jcgp/backend/population/class-use/Mutable.html" target="_top">Frames</a></li>
+<li><a href="Mutable.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
@@ -70,13 +70,13 @@
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
-<h2 title="Uses of Interface jcgp.backend.population.MutableElement" class="title">Uses of Interface<br>jcgp.backend.population.MutableElement</h2>
+<h2 title="Uses of Interface jcgp.backend.population.Mutable" class="title">Uses of Interface<br>jcgp.backend.population.Mutable</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
-<caption><span>Packages that use <a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></span><span class="tabEnd">&nbsp;</span></caption>
+<caption><span>Packages that use <a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
@@ -94,9 +94,9 @@
<li class="blockList"><a name="jcgp.backend.population">
<!-- -->
</a>
-<h3>Uses of <a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a> in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a></h3>
+<h3>Uses of <a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a> in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
-<caption><span>Classes in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> that implement <a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></span><span class="tabEnd">&nbsp;</span></caption>
+<caption><span>Classes in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> that implement <a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
@@ -118,22 +118,22 @@
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
-<caption><span>Methods in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> that return <a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></span><span class="tabEnd">&nbsp;</span></caption>
+<caption><span>Methods in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> that return <a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
-<td class="colFirst"><code><a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></code></td>
-<td class="colLast"><span class="typeNameLabel">Chromosome.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Chromosome.html#getRandomMutableElement--">getRandomMutableElement</a></span>()</code>
+<td class="colFirst"><code><a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></code></td>
+<td class="colLast"><span class="typeNameLabel">Chromosome.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Chromosome.html#getRandomMutable--">getRandomMutable</a></span>()</code>
<div class="block">This method is useful for mutating chromosomes.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
-<caption><span>Methods in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> with parameters of type <a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></span><span class="tabEnd">&nbsp;</span></caption>
+<caption><span>Methods in <a href="../../../../jcgp/backend/population/package-summary.html">jcgp.backend.population</a> with parameters of type <a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
@@ -141,15 +141,15 @@
<tbody>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><span class="typeNameLabel">Node.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</code>&nbsp;</td>
+<td class="colLast"><span class="typeNameLabel">Node.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Node.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><span class="typeNameLabel">Output.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;m)</code>&nbsp;</td>
+<td class="colLast"><span class="typeNameLabel">Output.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Output.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;m)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
-<td class="colLast"><span class="typeNameLabel">MutableElement.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/MutableElement.html#copyOf-jcgp.backend.population.MutableElement-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>&nbsp;element)</code>
+<td class="colLast"><span class="typeNameLabel">Mutable.</span><code><span class="memberNameLink"><a href="../../../../jcgp/backend/population/Mutable.html#copyOf-jcgp.backend.population.Mutable-">copyOf</a></span>(<a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>&nbsp;element)</code>
<div class="block">Asserts if the specified element is a copy of the elements
this is called on.<br>
This method returns true if and only if:
@@ -188,7 +188,7 @@
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
-<li><a href="../../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">Class</a></li>
+<li><a href="../../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
@@ -202,8 +202,8 @@
<li>Next</li>
</ul>
<ul class="navList">
-<li><a href="../../../../index.html?jcgp/backend/population/class-use/MutableElement.html" target="_top">Frames</a></li>
-<li><a href="MutableElement.html" target="_top">No&nbsp;Frames</a></li>
+<li><a href="../../../../index.html?jcgp/backend/population/class-use/Mutable.html" target="_top">Frames</a></li>
+<li><a href="Mutable.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
diff --git a/doc/jcgp/backend/population/package-frame.html b/doc/jcgp/backend/population/package-frame.html
index f000a2f..a4febde 100644
--- a/doc/jcgp/backend/population/package-frame.html
+++ b/doc/jcgp/backend/population/package-frame.html
@@ -14,7 +14,7 @@
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
<li><a href="Connection.html" title="interface in jcgp.backend.population" target="classFrame"><span class="interfaceName">Connection</span></a></li>
-<li><a href="MutableElement.html" title="interface in jcgp.backend.population" target="classFrame"><span class="interfaceName">MutableElement</span></a></li>
+<li><a href="Mutable.html" title="interface in jcgp.backend.population" target="classFrame"><span class="interfaceName">Mutable</span></a></li>
</ul>
<h2 title="Classes">Classes</h2>
<ul title="Classes">
diff --git a/doc/jcgp/backend/population/package-summary.html b/doc/jcgp/backend/population/package-summary.html
index ac0ec7b..c3ab625 100644
--- a/doc/jcgp/backend/population/package-summary.html
+++ b/doc/jcgp/backend/population/package-summary.html
@@ -91,9 +91,9 @@
</td>
</tr>
<tr class="rowColor">
-<td class="colFirst"><a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a></td>
+<td class="colFirst"><a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a></td>
<td class="colLast">
-<div class="block"><code>MutableElement</code> declares the expected behaviour of any
+<div class="block"><code>Mutable</code> declares the expected behaviour of any
part of a chromosome that is mutable, more specifically
nodes or outputs.</div>
</td>
diff --git a/doc/jcgp/backend/population/package-tree.html b/doc/jcgp/backend/population/package-tree.html
index d436925..ff3e02f 100644
--- a/doc/jcgp/backend/population/package-tree.html
+++ b/doc/jcgp/backend/population/package-tree.html
@@ -83,8 +83,8 @@
<ul>
<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Chromosome.html" title="class in jcgp.backend.population"><span class="typeNameLink">Chromosome</span></a> (implements java.lang.Comparable&lt;T&gt;)</li>
<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Input.html" title="class in jcgp.backend.population"><span class="typeNameLink">Input</span></a> (implements jcgp.backend.population.<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>)</li>
-<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Node</span></a> (implements jcgp.backend.population.<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, jcgp.backend.population.<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>)</li>
-<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Output</span></a> (implements jcgp.backend.population.<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>)</li>
+<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Node</span></a> (implements jcgp.backend.population.<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, jcgp.backend.population.<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>)</li>
+<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Output</span></a> (implements jcgp.backend.population.<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>)</li>
<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Population.html" title="class in jcgp.backend.population"><span class="typeNameLink">Population</span></a></li>
</ul>
</li>
@@ -92,7 +92,7 @@
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Connection</span></a></li>
-<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">MutableElement</span></a></li>
+<li type="circle">jcgp.backend.population.<a href="../../../jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Mutable</span></a></li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
diff --git a/doc/jcgp/backend/population/package-use.html b/doc/jcgp/backend/population/package-use.html
index 0c65c85..871296d 100644
--- a/doc/jcgp/backend/population/package-use.html
+++ b/doc/jcgp/backend/population/package-use.html
@@ -225,8 +225,8 @@
</td>
</tr>
<tr class="rowColor">
-<td class="colOne"><a href="../../../jcgp/backend/population/class-use/MutableElement.html#jcgp.backend.population">MutableElement</a>
-<div class="block"><code>MutableElement</code> declares the expected behaviour of any
+<td class="colOne"><a href="../../../jcgp/backend/population/class-use/Mutable.html#jcgp.backend.population">Mutable</a>
+<div class="block"><code>Mutable</code> declares the expected behaviour of any
part of a chromosome that is mutable, more specifically
nodes or outputs.</div>
</td>
diff --git a/doc/overview-tree.html b/doc/overview-tree.html
index 6c72b1e..715bc00 100644
--- a/doc/overview-tree.html
+++ b/doc/overview-tree.html
@@ -268,8 +268,8 @@
</li>
</ul>
</li>
-<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Node</span></a> (implements jcgp.backend.population.<a href="jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, jcgp.backend.population.<a href="jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>)</li>
-<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Output</span></a> (implements jcgp.backend.population.<a href="jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population">MutableElement</a>)</li>
+<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Node.html" title="class in jcgp.backend.population"><span class="typeNameLink">Node</span></a> (implements jcgp.backend.population.<a href="jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population">Connection</a>, jcgp.backend.population.<a href="jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>)</li>
+<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Output.html" title="class in jcgp.backend.population"><span class="typeNameLink">Output</span></a> (implements jcgp.backend.population.<a href="jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population">Mutable</a>)</li>
<li type="circle">jcgp.backend.parameters.<a href="jcgp/backend/parameters/Parameter.html" title="class in jcgp.backend.parameters"><span class="typeNameLink">Parameter</span></a>&lt;T&gt;
<ul>
<li type="circle">jcgp.backend.parameters.<a href="jcgp/backend/parameters/BooleanParameter.html" title="class in jcgp.backend.parameters"><span class="typeNameLink">BooleanParameter</span></a>
@@ -318,7 +318,7 @@
<ul>
<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Connection.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Connection</span></a></li>
<li type="circle">jcgp.backend.resources.<a href="jcgp/backend/resources/Console.html" title="interface in jcgp.backend.resources"><span class="typeNameLink">Console</span></a></li>
-<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/MutableElement.html" title="interface in jcgp.backend.population"><span class="typeNameLink">MutableElement</span></a></li>
+<li type="circle">jcgp.backend.population.<a href="jcgp/backend/population/Mutable.html" title="interface in jcgp.backend.population"><span class="typeNameLink">Mutable</span></a></li>
</ul>
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
diff --git a/res/README b/res/README
index b73e257..01d985a 100644
--- a/res/README
+++ b/res/README
@@ -124,7 +124,7 @@ Writing the test for the population copy constructor will require the production
Therefore, two new methods will be written for Chromosome: compareTo and compareActiveTo. Compare returns true if the two chromosomes
are exclusively equivalent, and compareActive returns true if the active nodes within the two chromosomes are exclusively equivalent.
-Compare methods done, including their "dependency": copyOf method in MutableElement. This method is akin to equals(), with the exception that
+Compare methods done, including their "dependency": copyOf method in Mutable. This method is akin to equals(), with the exception that
it returns false when the compared objects are pointers to a common instance.
Minor update: Node now passes only the necessary number of arguments into its function; this allows the node to compute its active
diff --git a/src/jcgp/JCGP.java b/src/jcgp/JCGP.java
index 898f229..f60fc22 100644
--- a/src/jcgp/JCGP.java
+++ b/src/jcgp/JCGP.java
@@ -1,13 +1,17 @@
package jcgp;
import java.io.File;
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Set;
import jcgp.backend.modules.es.EvolutionaryStrategy;
+import jcgp.backend.modules.es.MuPlusLambda;
+import jcgp.backend.modules.es.TournamentSelection;
+import jcgp.backend.modules.mutator.FixedPointMutator;
import jcgp.backend.modules.mutator.Mutator;
+import jcgp.backend.modules.mutator.PercentPointMutator;
+import jcgp.backend.modules.mutator.ProbabilisticMutator;
+import jcgp.backend.modules.problem.DigitalCircuitProblem;
import jcgp.backend.modules.problem.Problem;
+import jcgp.backend.modules.problem.SymbolicRegressionProblem;
import jcgp.backend.modules.problem.TestCaseProblem;
import jcgp.backend.parsers.ChromosomeParser;
import jcgp.backend.parsers.FunctionParser;
@@ -19,8 +23,6 @@ import jcgp.backend.resources.ModifiableResources;
import jcgp.backend.resources.Resources;
import jcgp.backend.statistics.StatisticsLogger;
-import org.reflections.Reflections;
-
/**
*
* Top-level JCGP class. This class is the entry point for a CGP experiment.
@@ -51,21 +53,30 @@ public class JCGP {
* module, 0 by default.
*/
// mutators
- private ArrayList<Mutator> mutators;
+ private Mutator[] mutators = new Mutator[] {
+ new PercentPointMutator(resources),
+ new FixedPointMutator(resources),
+ new ProbabilisticMutator(resources)
+ };
private Mutator mutator;
// evolutionary algorithms
- private ArrayList<EvolutionaryStrategy> evolutionaryStrategies;
+ private EvolutionaryStrategy[] evolutionaryStrategies = new EvolutionaryStrategy[] {
+ new MuPlusLambda(resources),
+ new TournamentSelection(resources)
+ };
private EvolutionaryStrategy evolutionaryStrategy;
// problem types
- private ArrayList<Problem> problems;
+ private Problem[] problems = new Problem[] {
+ new DigitalCircuitProblem(resources),
+ new SymbolicRegressionProblem(resources)
+ };
private Problem problem;
private Population population;
private StatisticsLogger statistics = new StatisticsLogger();
- private Reflections reflections;
// these record the best results found in the run, in case the runs ends before a perfect solution is found
private int lastImprovementGeneration = 0, activeNodes = 0;
@@ -104,135 +115,15 @@ public class JCGP {
* Creates a new instance of JCGP.
*/
public JCGP() {
- // prepare reflections instance
- reflections = new Reflections("jcgp");
-
- // generate module lists from all encountered valid modules
- createEvolutionaryStrategyList();
- createMutatorList();
- createProblemList();
+ // initialise modules
+ setEvolutionaryStrategy(0);
+ setMutator(0);
+ setProblem(0);
// create a new population
population = new Population(resources);
}
-
- /**
- * Iterates through all classes in the classpath and builds a list
- * of instances of all valid evolutionary strategies found. In order
- * to be included in this list, a class must implement {@code EvolutionaryStrategy}
- * and must contain a constructor with a {@code Resources} object as its only argument.
- */
- private void createEvolutionaryStrategyList() {
- Set<Class<? extends EvolutionaryStrategy>> esList = reflections.getSubTypesOf(EvolutionaryStrategy.class);
- evolutionaryStrategies = new ArrayList<EvolutionaryStrategy>();
-
- // go through all subclasses of EvolutionaryStrategy
- for (Class<? extends EvolutionaryStrategy> esType : esList) {
- Constructor<? extends EvolutionaryStrategy> constructor;
- try {
- constructor = esType.getConstructor(Resources.class);
- } catch (NoSuchMethodException | SecurityException e) {
- // constructor most likely doesnt exist, try next class
- System.out.println("Warning: could not find valid constructor for " + esType.getName() + ", skipping...");
- continue;
- }
-
- if (constructor != null) {
- EvolutionaryStrategy es;
- try {
- es = (EvolutionaryStrategy) constructor.newInstance(resources);
- } catch (Exception e) {
- // could not instantiate for some reason, keep going
- System.out.println("Warning: could not instantiate " + esType.getName() + ", skipping...");
- continue;
- }
- // add it to the list if it was instantiated properly
- evolutionaryStrategies.add(es);
- }
- }
- // choose the initial module
- evolutionaryStrategy = evolutionaryStrategies.get(0);
- }
- /**
- * Iterates through all classes in the classpath and builds a list
- * of instances of all valid mutators found. In order to be included
- * in this list, a class must implement {@code Mutator}
- * and must contain a constructor with a {@code Resources} object as its only argument.
- */
- private void createMutatorList() {
- Set<Class<? extends Mutator>> mutatorList = reflections.getSubTypesOf(Mutator.class);
- mutators = new ArrayList<Mutator>();
-
- // go through all subclasses of Mutator
- for (Class<? extends Mutator> mutatorType : mutatorList) {
- Constructor<? extends Mutator> constructor;
- try {
- constructor = mutatorType.getConstructor(Resources.class);
- } catch (NoSuchMethodException | SecurityException e) {
- // constructor most likely doesnt exist, try next class
- System.out.println("Warning: could not find valid constructor for "
- + mutatorType.getName() + ", skipping...");
- continue;
- }
-
- if (constructor != null) {
- Mutator mutator;
- try {
- mutator = (Mutator) constructor.newInstance(resources);
- } catch (Exception e) {
- // could not instantiate for some reason, keep going
- System.out.println("Warning: could not instantiate " + mutatorType.getName() + ", skipping...");
- continue;
- }
- // add it to the list if it was instantiated properly
- mutators.add(mutator);
- }
- }
- // choose the initial module
- mutator = mutators.get(0);
- }
-
- /**
- * Iterates through all classes in the classpath and builds a list
- * of instances of all valid problem types found. In order to be included
- * in this list, a class must implement {@code Problem}
- * and must contain a constructor with a {@code Resources} object as its only argument.
- */
- private void createProblemList() {
- Set<Class<? extends Problem>> problemTypes = reflections.getSubTypesOf(Problem.class);
- problems = new ArrayList<Problem>();
-
- // go through all subclasses of Problem
- for (Class<? extends Problem> problemType : problemTypes) {
-
- Constructor<? extends Problem> constructor;
- try {
- constructor = problemType.getConstructor(Resources.class);
- } catch (NoSuchMethodException | SecurityException e) {
- // constructor most likely doesnt exist, try next class
- System.out.println("Warning: could not find valid constructor for "
- + problemType.getName() + ", skipping...");
- continue;
- }
-
- if (constructor != null) {
- Problem problem;
- try {
- problem = (Problem) constructor.newInstance(resources);
- } catch (Exception e) {
- // could not instantiate for some reason, keep going
- System.out.println("Warning: could not instantiate " + problemType.getName() + ", skipping...");
- continue;
- }
- // add it to the list if it was instantiated properly
- problems.add(problem);
- }
- }
- // choose the initial module
- problem = problems.get(0);
- resources.setFunctionSet(problem.getFunctionSet());
- }
/**
* Returns a reference to the {@code ModifiableResources} used by the
@@ -256,7 +147,7 @@ public class JCGP {
/**
* @return a complete list of the experiment's mutators.
*/
- public ArrayList<Mutator> getMutators() {
+ public Mutator[] getMutators() {
return mutators;
}
@@ -272,7 +163,7 @@ public class JCGP {
/**
* @return a complete list of the experiment's evolutionary strategies.
*/
- public ArrayList<EvolutionaryStrategy> getEvolutionaryStrategies() {
+ public EvolutionaryStrategy[] getEvolutionaryStrategies() {
return evolutionaryStrategies;
}
@@ -288,7 +179,7 @@ public class JCGP {
/**
* @return a complete list of the experiment's problem types.
*/
- public ArrayList<Problem> getProblems() {
+ public Problem[] getProblems() {
return problems;
}
@@ -305,7 +196,7 @@ public class JCGP {
* @param index the index of the desired mutator.
*/
public void setMutator(int index) {
- this.mutator = mutators.get(index);
+ this.mutator = mutators[index];
resources.println("[CGP] Mutator selected: " + mutator.toString());
}
@@ -314,7 +205,7 @@ public class JCGP {
* @param index the index of the desired evolutionary strategy.
*/
public void setEvolutionaryStrategy(int index) {
- this.evolutionaryStrategy = evolutionaryStrategies.get(index);
+ this.evolutionaryStrategy = evolutionaryStrategies[index];
resources.println("[CGP] Evolutionary strategy selected: " + evolutionaryStrategy.toString());
}
@@ -323,7 +214,7 @@ public class JCGP {
* @param index the index of the desired problem type.
*/
public void setProblem(int index) {
- this.problem = problems.get(index);
+ this.problem = problems[index];
resources.setFunctionSet(problem.getFunctionSet());
resources.setFitnessOrientation(problem.getFitnessOrientation());
}
@@ -348,7 +239,7 @@ public class JCGP {
if (resources.currentGeneration() < resources.generations()) {
// we still have generations left to go
- int perfect = problem.perfectSolutionFound(population);
+ int perfect = problem.hasPerfectSolution(population);
if (perfect >= 0) {
// log results
statistics.logRun(resources.currentGeneration(), population.get(perfect).getFitness(), population.get(perfect).getActiveNodes().size(), true);
diff --git a/src/jcgp/backend/modules/mutator/PointMutator.java b/src/jcgp/backend/modules/mutator/PointMutator.java
index 9e421c2..5aba0d1 100644
--- a/src/jcgp/backend/modules/mutator/PointMutator.java
+++ b/src/jcgp/backend/modules/mutator/PointMutator.java
@@ -3,7 +3,7 @@ package jcgp.backend.modules.mutator;
import jcgp.backend.parameters.BooleanParameter;
import jcgp.backend.parameters.IntegerParameter;
import jcgp.backend.population.Chromosome;
-import jcgp.backend.population.MutableElement;
+import jcgp.backend.population.Mutable;
import jcgp.backend.population.Node;
import jcgp.backend.population.Output;
import jcgp.backend.resources.Resources;
@@ -41,7 +41,7 @@ public abstract class PointMutator extends Mutator {
// for however many genes must be mutated
for (int i = 0; i < genesMutated.get(); i++) {
- MutableElement m = chromosome.getRandomMutableElement();
+ Mutable m = chromosome.getRandomMutable();
if (report.get()) getResources().report("[Mutator] Mutation " + i + " selected " + m + ", ");
@@ -69,7 +69,7 @@ public abstract class PointMutator extends Mutator {
if (report.get()) getResources().reportln("to " + ((Node) m).getFunction());
} else {
// if we decided to mutate connection, subtract 1 from geneType so it fits into the arity range
- geneType -= 1;
+ geneType--;
if (report.get()) getResources().report("changed connection " + geneType + " from " + ((Node) m).getConnection(geneType) + " ");
m.setConnection(geneType, chromosome.getRandomConnection(((Node) m).getColumn()));
diff --git a/src/jcgp/backend/modules/problem/BestFitness.java b/src/jcgp/backend/modules/problem/BestFitness.java
new file mode 100644
index 0000000..dce9ecd
--- /dev/null
+++ b/src/jcgp/backend/modules/problem/BestFitness.java
@@ -0,0 +1,18 @@
+package jcgp.backend.modules.problem;
+
+/**
+ * Enum type to allow problems to indicate their fitness
+ * orientation.
+ * <br><br>
+ * {@code BestFitness.HIGH} means high fitness values are
+ * better than low. Conversely, {@code BestFitness.LOW}
+ * signals that low fitness values indicate better fitness
+ * than high values.
+ *
+ *
+ * @author Eduardo Pedroni
+ *
+ */
+public enum BestFitness {
+ HIGH, LOW;
+}
diff --git a/src/jcgp/backend/modules/problem/DigitalCircuitProblem.java b/src/jcgp/backend/modules/problem/DigitalCircuitProblem.java
index 0071ed5..b615675 100644
--- a/src/jcgp/backend/modules/problem/DigitalCircuitProblem.java
+++ b/src/jcgp/backend/modules/problem/DigitalCircuitProblem.java
@@ -80,7 +80,7 @@ public class DigitalCircuitProblem extends TestCaseProblem<UnsignedInteger> {
}
@Override
- public int perfectSolutionFound(Population population) {
+ public int hasPerfectSolution(Population population) {
// higher fitness is better
for (int i = 0; i < getResources().populationSize(); i++) {
if (population.get(i).getFitness() >= maxFitness.get()) {
@@ -89,16 +89,4 @@ public class DigitalCircuitProblem extends TestCaseProblem<UnsignedInteger> {
}
return -1;
}
-
- @Override
- public int hasImprovement(Population population) {
- // higher fitness is better
- for (int i = 0; i < getResources().populationSize(); i++) {
- if (population.get(i).getFitness() > bestFitness.get()) {
- bestFitness.set(population.get(i).getFitness());
- return i;
- }
- }
- return -1;
- }
}
diff --git a/src/jcgp/backend/modules/problem/Problem.java b/src/jcgp/backend/modules/problem/Problem.java
index 5f194b5..2af2373 100644
--- a/src/jcgp/backend/modules/problem/Problem.java
+++ b/src/jcgp/backend/modules/problem/Problem.java
@@ -85,7 +85,7 @@ public abstract class Problem extends Module {
* @param population the population to search through for a perfect chromosome.
* @return the perfect solution index, if one exits, -1 if no perfect solution was found.
*/
- public abstract int perfectSolutionFound(Population population);
+ public abstract int hasPerfectSolution(Population population);
/**
* Used to assert whether a given population has a chromosome that is an improvement over
diff --git a/src/jcgp/backend/modules/problem/SymbolicRegressionProblem.java b/src/jcgp/backend/modules/problem/SymbolicRegressionProblem.java
index 24c61d6..3b5f539 100644
--- a/src/jcgp/backend/modules/problem/SymbolicRegressionProblem.java
+++ b/src/jcgp/backend/modules/problem/SymbolicRegressionProblem.java
@@ -126,7 +126,7 @@ public class SymbolicRegressionProblem extends TestCaseProblem<Double> {
}
@Override
- public int perfectSolutionFound(Population population) {
+ public int hasPerfectSolution(Population population) {
// higher fitness is better
for (int i = 0; i < getResources().populationSize(); i++) {
if (population.get(i).getFitness() >= maxFitness.get() - perfectionThreshold.get()) {
@@ -135,18 +135,4 @@ public class SymbolicRegressionProblem extends TestCaseProblem<Double> {
}
return -1;
}
-
- @Override
- public int hasImprovement(Population population) {
- // higher fitness is better
- for (int i = 0; i < getResources().populationSize(); i++) {
- System.out.println("checking for improvement");
- if (population.get(i).getFitness() > bestFitness.get()) {
- System.out.println("found a better chr, " + i);
- bestFitness.set(population.get(i).getFitness());
- return i;
- }
- }
- return -1;
- }
}
diff --git a/src/jcgp/backend/modules/problem/TestCaseProblem.java b/src/jcgp/backend/modules/problem/TestCaseProblem.java
index 69c078d..188e236 100644
--- a/src/jcgp/backend/modules/problem/TestCaseProblem.java
+++ b/src/jcgp/backend/modules/problem/TestCaseProblem.java
@@ -5,6 +5,7 @@ import java.io.File;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import jcgp.backend.parsers.TestCaseParser;
+import jcgp.backend.population.Population;
import jcgp.backend.resources.ModifiableResources;
import jcgp.backend.resources.Resources;
@@ -162,6 +163,24 @@ public abstract class TestCaseProblem<T> extends Problem {
// use standard test case parser for this
TestCaseParser.parse(file, this, resources);
}
+
+ @Override
+ public int hasImprovement(Population population) {
+ for (int i = 0; i < getResources().populationSize(); i++) {
+ if (getFitnessOrientation() == BestFitness.HIGH) {
+ if (population.get(i).getFitness() > bestFitness.get()) {
+ bestFitness.set(population.get(i).getFitness());
+ return i;
+ }
+ } else {
+ if (population.get(i).getFitness() < bestFitness.get()) {
+ bestFitness.set(population.get(i).getFitness());
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
}
diff --git a/src/jcgp/backend/parsers/ChromosomeParser.java b/src/jcgp/backend/parsers/ChromosomeParser.java
index f5f25ae..838ec48 100644
--- a/src/jcgp/backend/parsers/ChromosomeParser.java
+++ b/src/jcgp/backend/parsers/ChromosomeParser.java
@@ -10,7 +10,6 @@ import jcgp.backend.population.Chromosome;
import jcgp.backend.population.Connection;
import jcgp.backend.population.Input;
import jcgp.backend.population.Node;
-import jcgp.backend.resources.ModifiableResources;
import jcgp.backend.resources.Resources;
/**
diff --git a/src/jcgp/backend/population/Chromosome.java b/src/jcgp/backend/population/Chromosome.java
index 0dfa801..673bb26 100644
--- a/src/jcgp/backend/population/Chromosome.java
+++ b/src/jcgp/backend/population/Chromosome.java
@@ -283,12 +283,12 @@ public class Chromosome implements Comparable<Chromosome> {
/**
* This method is useful for mutating chromosomes. It returns any
- * random {@code MutableElement} out of the chromosome with equal
+ * random {@code Mutable} out of the chromosome with equal
* probability.
*
* @return a random element that can be mutated - node or output.
*/
- public MutableElement getRandomMutableElement() {
+ public Mutable getRandomMutable() {
// choose output or node
int index = resources.getRandomInt(outputs.length + (resources.rows() * resources.columns()));
diff --git a/src/jcgp/backend/population/MutableElement.java b/src/jcgp/backend/population/Mutable.java
index 5782a99..3ce7065 100644
--- a/src/jcgp/backend/population/MutableElement.java
+++ b/src/jcgp/backend/population/Mutable.java
@@ -1,7 +1,7 @@
package jcgp.backend.population;
/**
- * {@code MutableElement} declares the expected behaviour of any
+ * {@code Mutable} declares the expected behaviour of any
* part of a chromosome that is mutable, more specifically
* nodes or outputs. Inputs are not mutable since they don't have
* connections or functions.
@@ -14,7 +14,7 @@ package jcgp.backend.population;
* @author Eduardo Pedroni
*
*/
-public interface MutableElement {
+public interface Mutable {
/**
* This method sets the indexed connection to the specified new connection.
@@ -48,6 +48,6 @@ public interface MutableElement {
* @param element the mutable element to compare to.
* @return true if {@code element} is a copy of this element.
*/
- boolean copyOf(MutableElement element);
+ boolean copyOf(Mutable element);
}
diff --git a/src/jcgp/backend/population/Node.java b/src/jcgp/backend/population/Node.java
index 704b24e..3bcf3da 100644
--- a/src/jcgp/backend/population/Node.java
+++ b/src/jcgp/backend/population/Node.java
@@ -10,7 +10,7 @@ import jcgp.backend.function.Function;
* contains a function and a number of connections.
* The node outputs the result of performing its function
* on the values of its connections. Nodes therefore
- * implement both {@code MutableElement} and {@code Connection}
+ * implement both {@code Mutable} and {@code Connection}
* since they can be mutated but also connected to.
* Nodes are constructed with a fixed number of connections
* (determined by the maximum arity of the function set)
@@ -20,7 +20,7 @@ import jcgp.backend.function.Function;
* @author Eduardo Pedroni
*
*/
-public class Node implements MutableElement, Connection {
+public class Node implements Mutable, Connection {
private Function function;
private Connection[] connections;
@@ -124,7 +124,7 @@ public class Node implements MutableElement, Connection {
}
@Override
- public boolean copyOf(MutableElement element) {
+ public boolean copyOf(Mutable element) {
// both cannot be the same instance
if (this != element) {
// element must be instance of node
diff --git a/src/jcgp/backend/population/Output.java b/src/jcgp/backend/population/Output.java
index ab693e2..938741b 100644
--- a/src/jcgp/backend/population/Output.java
+++ b/src/jcgp/backend/population/Output.java
@@ -12,7 +12,7 @@ import java.util.ArrayList;
* @author Eduardo Pedroni
*
*/
-public class Output implements MutableElement {
+public class Output implements Mutable {
private Connection source;
private Chromosome chromosome;
@@ -56,7 +56,7 @@ public class Output implements MutableElement {
* is simply ignored and the output source is
* set.
*
- * @see jcgp.backend.population.MutableElement#setConnection(int, jcgp.backend.population.Connection)
+ * @see jcgp.backend.population.Mutable#setConnection(int, jcgp.backend.population.Connection)
*/
@Override
public void setConnection(int index, Connection newConnection) {
@@ -66,7 +66,7 @@ public class Output implements MutableElement {
}
@Override
- public boolean copyOf(MutableElement m) {
+ public boolean copyOf(Mutable m) {
// both cannot be the same instance
if (this != m) {
// element must be instance of output
diff --git a/src/jcgp/backend/tests/ChromosomeTests.java b/src/jcgp/backend/tests/ChromosomeTests.java
index c326805..b5c1da7 100644
--- a/src/jcgp/backend/tests/ChromosomeTests.java
+++ b/src/jcgp/backend/tests/ChromosomeTests.java
@@ -5,7 +5,7 @@ import static org.junit.Assert.fail;
import jcgp.backend.population.Chromosome;
import jcgp.backend.population.Connection;
import jcgp.backend.population.Input;
-import jcgp.backend.population.MutableElement;
+import jcgp.backend.population.Mutable;
import jcgp.backend.population.Node;
import jcgp.backend.population.Output;
import jcgp.backend.resources.ModifiableResources;
@@ -19,7 +19,7 @@ import org.junit.Test;
* Tests which cover the behaviour specified for a chromosome.
*
* - The chromosome should be able to return a specified node, input or output.
- * - It should be able to return a random MutableElement.
+ * - It should be able to return a random Mutable.
* - It should be able to return a random allowed connection given a column.
* - It should be able to return a random connection.
* - It should contain a freely modifiable fitness value.
@@ -198,7 +198,7 @@ public class ChromosomeTests {
int mutablePicks = 100000;
int mutableNodes = 0, mutableOutputs = 0;
for (int i = 0; i < mutablePicks; i++) {
- MutableElement m = chromosome.getRandomMutableElement();
+ Mutable m = chromosome.getRandomMutable();
if (m instanceof Node) {
mutableNodes++;