Search in sources :

Example 11 with EightPuzzleBoard

use of aima.core.environment.eightpuzzle.EightPuzzleBoard in project aima-java by aimacode.

the class EightPuzzleBoardMoveTest method testPosition6MoveLeft.

@Test
public void testPosition6MoveLeft() {
    // { 6, 5, 4, 1, 8, 0, 7, 3, 2 }
    setGapToPosition6();
    board.moveGapLeft();
    Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 0, 8, 7, 3, 2 }), board);
}
Also used : EightPuzzleBoard(aima.core.environment.eightpuzzle.EightPuzzleBoard) Test(org.junit.Test)

Example 12 with EightPuzzleBoard

use of aima.core.environment.eightpuzzle.EightPuzzleBoard in project aima-java by aimacode.

the class EightPuzzleBoardMoveTest method testPosition9MoveLeft.

@Test
public void testPosition9MoveLeft() {
    // { 6, 5, 4, 7, 1, 8, 3, 2, 0 }
    setGapToPosition9();
    board.moveGapLeft();
    Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 7, 1, 8, 3, 0, 2 }), board);
}
Also used : EightPuzzleBoard(aima.core.environment.eightpuzzle.EightPuzzleBoard) Test(org.junit.Test)

Example 13 with EightPuzzleBoard

use of aima.core.environment.eightpuzzle.EightPuzzleBoard in project aima-java by aimacode.

the class EightPuzzleBoardMoveTest method testPosition7MoveDown.

@Test
public void testPosition7MoveDown() {
    // { 6, 5, 4, 7, 1, 8, 0, 3, 2 }
    setGapToPosition7();
    board.moveGapDown();
    Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 7, 1, 8, 0, 3, 2 }), board);
}
Also used : EightPuzzleBoard(aima.core.environment.eightpuzzle.EightPuzzleBoard) Test(org.junit.Test)

Example 14 with EightPuzzleBoard

use of aima.core.environment.eightpuzzle.EightPuzzleBoard in project aima-java by aimacode.

the class EightPuzzleBoardMoveTest method testPosition5MoveDown.

@Test
public void testPosition5MoveDown() {
    // { 6, 5, 4, 1, 0, 8, 7, 3, 2 }
    setGapToPosition5();
    board.moveGapDown();
    Assert.assertEquals(new EightPuzzleBoard(new int[] { 6, 5, 4, 1, 3, 8, 7, 0, 2 }), board);
}
Also used : EightPuzzleBoard(aima.core.environment.eightpuzzle.EightPuzzleBoard) Test(org.junit.Test)

Example 15 with EightPuzzleBoard

use of aima.core.environment.eightpuzzle.EightPuzzleBoard in project aima-java by aimacode.

the class EightPuzzleBoardMoveTest method testPosition4MoveUp.

@Test
public void testPosition4MoveUp() {
    // { 6, 5, 4, 0, 1, 8, 7, 3, 2 }
    setGapToPosition4();
    board.moveGapUp();
    Assert.assertEquals(new EightPuzzleBoard(new int[] { 0, 5, 4, 6, 1, 8, 7, 3, 2 }), board);
}
Also used : EightPuzzleBoard(aima.core.environment.eightpuzzle.EightPuzzleBoard) Test(org.junit.Test)

Aggregations

EightPuzzleBoard (aima.core.environment.eightpuzzle.EightPuzzleBoard)43 Test (org.junit.Test)42 Action (aima.core.agent.Action)5 BidirectionalEightPuzzleProblem (aima.core.environment.eightpuzzle.BidirectionalEightPuzzleProblem)3 SearchAgent (aima.core.search.framework.SearchAgent)3 GoalTest (aima.core.search.framework.problem.GoalTest)3 MoveToAction (aima.core.environment.map.MoveToAction)2 GreedyBestFirstSearch (aima.core.search.informed.GreedyBestFirstSearch)2 ArrayList (java.util.ArrayList)2 Node (aima.core.search.framework.Node)1 AStarSearch (aima.core.search.informed.AStarSearch)1 Random (java.util.Random)1