Adjusted few things to all
This commit is contained in:
parent
e09b6fb6e4
commit
5264853c8e
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -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()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user