Examples of NQueensGoalTest


Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(0, actions.size());
    Assert.assertEquals("6",
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    assertCorrectPlacement(actions);
    Assert.assertEquals("113",
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(0, actions.size());
    Assert.assertEquals("6",
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  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);
      List<Action> actions = agent.getActions();
      assertCorrectPlacement(actions);
      Assert.assertEquals("3656",
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    assertCorrectPlacement(actions);
    Assert.assertEquals("113",
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(true, search.isCutOff(actions));
  }
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  @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);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(true, search.isFailure(actions));
  }
View Full Code Here

Examples of aima.core.environment.nqueens.NQueensGoalTest

  NQueensBoard board;

  @Before
  public void setUp() {
    goalTest = new NQueensGoalTest();
    board = new NQueensBoard(8);
  }
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.