ki_rwu_java/test/search/breadthfirstsearch/BreadthFirstSearchTest.java

37 lines
846 B
Java
Raw Normal View History

2019-03-24 16:41:14 +01:00
package search.breadthfirstsearch;
import org.junit.jupiter.api.Test;
2019-03-24 16:58:10 +01:00
import java.util.Arrays;
import java.util.List;
2019-03-24 16:41:14 +01:00
class BreadthFirstSearchTest
{
@Test
void shouldReturnCorrectTarget()
{
2019-03-24 16:58:10 +01:00
int[][] state = {
2019-03-24 17:25:51 +01:00
{5, 0, 3},
{2, 1, 6},
{4, 7, 8}
2019-03-24 16:58:10 +01:00
};
var root = new EightPuzzleNode(state);
int[][] targetState = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 0}
};
var expected = new EightPuzzleNode(targetState);
var actual = new BreadthFirstSearch().breadthFirstSearch(List.of(root), expected);
2019-03-24 17:25:51 +01:00
System.out.println("Target: " + Arrays.deepToString(targetState));
System.out.println("Actual:\n" + actual);
2019-03-24 16:41:14 +01:00
}
2019-03-25 19:14:17 +01:00
private void printSolution(Node<int[][]> targetNode)
{
}
2019-03-24 16:41:14 +01:00
}