Adjusted few things to all

This commit is contained in:
Niklas Birk 2019-06-25 12:06:39 +02:00
parent e09b6fb6e4
commit 5264853c8e
4 changed files with 1 additions and 31 deletions

View File

@ -1,7 +1,6 @@
package machine_learning.perceptron; package machine_learning.perceptron;
import java.util.List; import java.util.List;
import java.util.stream.IntStream;
public class Perceptron public class Perceptron
{ {

View File

@ -6,7 +6,7 @@ import java.util.stream.IntStream;
public class Vector public class Vector
{ {
private List<Double> values; private final List<Double> values;
public Vector(int dim) public Vector(int dim)
{ {

View File

@ -15,11 +15,6 @@ public abstract class Node<T>
this(value, null, 0); this(value, null, 0);
} }
protected Node(final T value, final Node<T> parent)
{
this(value, parent, 0);
}
protected Node(final T value, final Node<T> parent, final int heuristicCosts) protected Node(final T value, final Node<T> parent, final int heuristicCosts)
{ {
this.value = Objects.requireNonNull(value); this.value = Objects.requireNonNull(value);

View File

@ -6,30 +6,6 @@ import search.EightPuzzleNode;
class EightPuzzleNodeTest 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 @Test
public void shouldReturnTrueWhenTargetReached() public void shouldReturnTrueWhenTargetReached()
{ {