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

aitchnyu jesvinj at technovia.co.in
Mon Jan 30 08:19:38 EST 2012


I upgraded the binaries (and sources) to 5.4 . Here is the new logs. I noted
that the clone operation is called once. But not a single move factory
instance is created.

 Clone  -- this displays the entire stuff when a clone is called
Digit:1 (Row 1,Column 1) block code[5] 
Digit:2 (Row n/a,Column 1) block code[n/a] 
...and more

18:45:18.066 [main] INFO  o.d.p.core.solver.DefaultSolver - Solver started:
time spend (8), score (0), new best score (0), random seed (0).
18:45:18.068 [main] INFO  o.d.p.core.solver.DefaultSolver - Solved: time
spend (12), best score (0), average calculate count per second (83).
solver over

--the solution displayed
Digit:1 (Row 1,Column 1) block code[5] 
Digit:2 (Row n/a,Column 1) block code[n/a] 
...




ge0ffrey wrote
> 
> That's weird:
> If there are no solver phases configured, it fails-fast,
> yet it doesn't log any solver phase messages.
> 
> Logging has improved for 5.4.0.Beta1, try upgrading to that
> and put the logging level to trace for org.drools.planner.
> 
> Alternatively, put a breakpoint in a method in 
> DefaultLocalSearchSolverPhase.
> 
> Op 30-01-12 13:43, aitchnyu schreef:
>> 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.
>> _______________________________________________
>> rules-users mailing list
>> rules-users at .jboss
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
> 
> -- 
> With kind regards,
> Geoffrey De Smet
> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at .jboss
> https://lists.jboss.org/mailman/listinfo/rules-users
> 


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



More information about the rules-users mailing list