diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-02-13 22:41:26 +0000 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-02-13 22:41:26 +0000 |
commit | 6419b69faeb4736db1ccb50cfa5a030f9aa818aa (patch) | |
tree | ca424a5ea85abf044cd4b22c3c43608163ae5f74 /src/jcgp/population/MutableElement.java | |
parent | 3326c58f4d2d7e8c77738277dcd093aa864ad2a5 (diff) |
Added methods in Chromosome to compare active and all nodes. Associated tests also written.
Diffstat (limited to 'src/jcgp/population/MutableElement.java')
-rw-r--r-- | src/jcgp/population/MutableElement.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/jcgp/population/MutableElement.java b/src/jcgp/population/MutableElement.java index 5eae4ef..114a4ab 100644 --- a/src/jcgp/population/MutableElement.java +++ b/src/jcgp/population/MutableElement.java @@ -3,5 +3,23 @@ package jcgp.population; public interface MutableElement { public void setConnection(Connection newConnection); + + /** + * This method returns true if and only if:</br> + * - the elements being compared are not the same instance;</br> + * - the connections of the compared elements are not the same instance;</br> + * - the elements have the same function (in the case of Node);</br> + * - the grid position of the elements themselves are the same;</br> + * - the grid position of all equivalent connections are the same;</br></br> + * + * The relationship computed by this method is:</br> + * - symmetric: a.copyOf(b) == b.copyOf(a);</br> + * - not reflexive: a.copyOf(a) returns false;</br> + * - not transitive: if a.copyOf(b) is true and b.copyOf(c) is true, a.copyOf(c) is not necessarily true;</br> + * + * @param m + * @return + */ + boolean copyOf(MutableElement m); } |