Package aima.core.search.local

Examples of aima.core.search.local.SimulatedAnnealingSearch


    try {
      Problem problem = new Problem(new NQueensBoard(8),
          NQueensFunctionFactory.getIActionsFunction(),
          NQueensFunctionFactory.getResultFunction(),
          new NQueensGoalTest());
      SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(
          new AttackingPairsHeuristic());
      SearchAgent agent = new SearchAgent(problem, search);

      System.out.println();
      printActions(agent.getActions());
      System.out.println("Search Outcome=" + search.getOutcome());
      System.out.println("Final State=\n" + search.getLastSearchState());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


    System.out.println("\nEightPuzzleDemo Simulated Annealing  Search -->");
    try {
      Problem problem = new Problem(random1, EightPuzzleFunctionFactory
          .getActionsFunction(), EightPuzzleFunctionFactory
          .getResultFunction(), new EightPuzzleGoalTest());
      SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(
          new ManhattanHeuristicFunction());
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      System.out.println("Search Outcome=" + search.getOutcome());
      System.out.println("Final State=\n" + search.getLastSearchState());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  @Test
  public void testForGivenNegativeDeltaEProbabilityOfAcceptanceDecreasesWithDecreasingTemperature() {
    // this isn't very nice. the object's state is uninitialized but is ok
    // for this test.
    SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(null);
    int deltaE = -1;
    double higherTemperature = 30.0;
    double lowerTemperature = 29.5;

    Assert.assertTrue(search.probabilityOfAcceptance(lowerTemperature,
        deltaE) < search.probabilityOfAcceptance(higherTemperature,
        deltaE));
  }
View Full Code Here

TOP

Related Classes of aima.core.search.local.SimulatedAnnealingSearch

Copyright © 2018 www.massapicom. 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.