From 5264853c8e922d8275c48f6d343aa3b50d18e7c9 Mon Sep 17 00:00:00 2001 From: Niklas Birk Date: Tue, 25 Jun 2019 12:06:39 +0200 Subject: [PATCH] Adjusted few things to all --- .../perceptron/Perceptron.java | 1 - src/machine_learning/perceptron/Vector.java | 2 +- src/search/Node.java | 5 ---- test/search/EightPuzzleNodeTest.java | 24 ------------------- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/src/machine_learning/perceptron/Perceptron.java b/src/machine_learning/perceptron/Perceptron.java index cb5cb23..72ca91f 100644 --- a/src/machine_learning/perceptron/Perceptron.java +++ b/src/machine_learning/perceptron/Perceptron.java @@ -1,7 +1,6 @@ package machine_learning.perceptron; import java.util.List; -import java.util.stream.IntStream; public class Perceptron { diff --git a/src/machine_learning/perceptron/Vector.java b/src/machine_learning/perceptron/Vector.java index d032fc9..3677af8 100644 --- a/src/machine_learning/perceptron/Vector.java +++ b/src/machine_learning/perceptron/Vector.java @@ -6,7 +6,7 @@ import java.util.stream.IntStream; public class Vector { - private List values; + private final List values; public Vector(int dim) { diff --git a/src/search/Node.java b/src/search/Node.java index 0d7d3f8..0946848 100644 --- a/src/search/Node.java +++ b/src/search/Node.java @@ -15,11 +15,6 @@ public abstract class Node this(value, null, 0); } - protected Node(final T value, final Node parent) - { - this(value, parent, 0); - } - protected Node(final T value, final Node parent, final int heuristicCosts) { this.value = Objects.requireNonNull(value); diff --git a/test/search/EightPuzzleNodeTest.java b/test/search/EightPuzzleNodeTest.java index c9e99fd..0ff9448 100644 --- a/test/search/EightPuzzleNodeTest.java +++ b/test/search/EightPuzzleNodeTest.java @@ -6,30 +6,6 @@ import search.EightPuzzleNode; class EightPuzzleNodeTest { - @Test - public void shouldThrowExceptionWhileStateHasDuplicateNumbers() - { - final int[][] state = { - {1, 1, 3}, - {4, 5, 6}, - {7, 8, 0} - }; - - Assertions.assertThrows(IllegalArgumentException.class, () -> new EightPuzzleNode(state)); - } - - @Test - public void shouldThrowExceptionWhileStateHasNumbersOutOfRange() - { - final int[][] state = { - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9} - }; - - Assertions.assertThrows(IllegalArgumentException.class, () -> new EightPuzzleNode(state)); - } - @Test public void shouldReturnTrueWhenTargetReached() {