Examples of NQueensBoard


Examples of aima.core.environment.nqueens.NQueensBoard

public class BreadthFirstSearchTest {

  @Test
  public void testBreadthFirstSuccesfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new BreadthFirstSearch(new TreeSearch());
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

        agent.getInstrumentation().getProperty("pathCost"));
  }

  @Test
  public void testBreadthFirstUnSuccesfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new BreadthFirstSearch(new TreeSearch());
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

public class DepthFirstSearchTest {

  @Test
  public void testDepthFirstSuccesfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthFirstSearch(new GraphSearch());
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

        agent.getInstrumentation().getProperty("nodesExpanded"));
  }

  @Test
  public void testDepthFirstUnSuccessfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthFirstSearch(new GraphSearch());
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

public class IterativeDeepeningSearchTest {

  @Test
  public void testIterativeDeepeningSearch() {
    try {
      Problem problem = new Problem(new NQueensBoard(8),
          NQueensFunctionFactory.getIActionsFunction(),
          NQueensFunctionFactory.getResultFunction(),
          new NQueensGoalTest());
      Search search = new IterativeDeepeningSearch();
      SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

public class DepthLimitedSearchTest {

  @Test
  public void testSuccesfulDepthLimitedSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthLimitedSearch(8);
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

        agent.getInstrumentation().getProperty("nodesExpanded"));
  }

  @Test
  public void testCutOff() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    DepthLimitedSearch search = new DepthLimitedSearch(1);
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

    Assert.assertEquals(true, search.isCutOff(actions));
  }

  @Test
  public void testFailure() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    DepthLimitedSearch search = new DepthLimitedSearch(5);
    SearchAgent agent = new SearchAgent(problem, search);
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

  NQueensBoard board;

  @Before
  public void setUp() {
    goalTest = new NQueensGoalTest();
    board = new NQueensBoard(8);
  }
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensBoard

    Assert.assertFalse(goalTest.isGoalState(board));
  }

  @Test
  public void testSingleSquareBoard() {
    board = new NQueensBoard(1);
    Assert.assertFalse(goalTest.isGoalState(board));
    board.addQueenAt(new XYLocation(0, 0));
    Assert.assertTrue(goalTest.isGoalState(board));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.