[rules-users] How to troubleshoot Drools planner doing nothing?

aitchnyu jesvinj at technovia.co.in
Mon Jan 30 07:43:22 EST 2012


I wrote a program in Drools. But it does not do anything. As the logs show,
the solver finishes in 2 ms and the 'best solution' is an untouched version
of the initial state.

I also noted that not a single movefactory object was created. And at 500
moves/sec and 2 milliseconds of execution, only one move was attempted.

Where do I start troubleshooting?

        SudokuGenerator sg = new SudokuGenerator();
	Solution sudoku = sg.createSudoku();	
	Solver solver = createSolver();	
	solver.setPlanningProblem(sudoku);
	solver.solve();	
	System.out.println("solver over");
	Sudoku result = (Sudoku) solver.getBestSolution();
	result.displaySolution(); //a method that prints the state of the solution

*Output logs in TRACE mode*

jesvin at Jesvin-Technovia:~/dev/drools/sudoku$ java in.co.technovia.sudoku.App
2012-01-30 17:23:33,795 [main] INFO  Solver started: time spend (1), score
(0), new best score (0), random seed (0).
2012-01-30 17:23:33,796 [main] INFO  Solved: time spend (2), best score (0),
average calculate count per second (500).


*Contents of the solver XML*

<?xml version="1.0" encoding="UTF-8"?>
<solver>
  <environmentMode>DEBUG</environmentMode>

  <solutionClass>in.co.technovia.sudoku.domain.Sudoku</solutionClass>
 
<planningEntityClass>in.co.technovia.sudoku.domain.Digit</planningEntityClass>
  <scoreDrl>/score.drl</scoreDrl>
  <scoreDefinition>
    <scoreDefinitionType>SIMPLE</scoreDefinitionType>
  </scoreDefinition>

  <termination>
    <scoreAttained>0</scoreAttained>
  </termination>
  
  <constructionHeuristic>
    <constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
    
  </constructionHeuristic>
  <localSearch>
    <selector>
      
     
<moveFactoryClass>in.co.technovia.sudoku.solution.RowChangeMoveFactory</moveFactoryClass>
    </selector>
    <acceptor>
      <completeSolutionTabuSize>1000</completeSolutionTabuSize>
    </acceptor>
    <forager>
      
    </forager>
  </localSearch>
</solver>


--
View this message in context: http://drools.46999.n3.nabble.com/How-to-troubleshoot-Drools-planner-doing-nothing-tp3699863p3699863.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list