[rules-users] [Planner]Sudoku solver
Hi everybody, In order to understand better Planner, I did a sudoku solver. I was inspired by Queens example. I need 3 minutes to solve a sudoku with localSearch . *I have 2 issues :* 1- Construction Heuristic doesn't work at all : I don't understand why. 2- I use FROM_PLANNING_ENTITY_PROPERTY for my @PlanningVariable. The @ValueRange is a collection of Value : [value1, value2, value3, value4, value5, value6, value7, value8, value9]. = But this range isn't used in the localSearch. Instead I think localSearch uses the value list FROM_SOLUTION_PROPERTY. I share my code on GitHub : g...@github.com:qchevalier/Sudoku-solver.git *[To understand my code]* Firstly I use the API configuration : you will have to change the path of the drl file in App.java(line 36), and put away the xml configuration file. A sudoku is composed by 81 digits : each digit has 1 value, 1 column, 1 row and 1 block. 1 value has a value between [1-9] (Value can be initialized; in this case they can't be changed during solving. 0 is undefined value and has to be changed). 1 column has an index with a value between [0-8]. 1 row has an index with a value between [0-8]. 1 block has an index with a value between [0-8]. http://drools.46999.n3.nabble.com/file/n4005002/sudoku_how_to.png In order to initialize the sudoku I use methods initTab* from NDigitsGenerator.java . After get it on github (g...@github.com:qchevalier/Sudoku-solver.git ): In order to run the application : import it in eclipse, modify the path of the DRL file, and then run as java application App.java. *A sample of the execution can be as this : * 2012-05-21 11:19:08,332 [main] INFO Solving started: time spend (218), score (-508), new best score (-508), random seed (0). /2012-05-21 11:19:08,332 [main] INFO Phase constructionHeuristic ended: step total (0), time spend (234), best score (-508)./ 2012-05-21 11:19:10,910 [main] DEBUG Step index (0), time spend (2812), score (-485), new best score (-485), accepted move size (1948) for picked step (col8@row2@block6@value0 = value1) ... 2012-05-21 11:21:55,909 [main] DEBUG Step index (88), time spend (167811), score (-3), best score (-2), accepted move size (1797) for picked step (col0@row7@block2@value3 = value6). 2012-05-21 11:21:57,643 [main] DEBUG Step index (89), time spend (169545), score (-2), best score (-2), accepted move size (1795) for picked step (col0@row7@block2@value3 = value6). 2012-05-21 11:22:09,815 [main] DEBUG Step index (96), time spend (181717), score (-3), best score (-2), accepted move size (1797) for picked step (col0@row3@block1@value6 = value3). 2012-05-21 11:22:11,534 [main] DEBUG Step index (97), time spend (183436), score (0), new best score (0), accepted move size (1796) for picked step (col2@row3@block1@value3 = value6). 2012-05-21 11:22:11,534 [main] INFO Phase localSearch ended: step total (98), time spend (183436), best score (0). 2012-05-21 11:22:11,534 [main] INFO Solving ended: time spend (183436), best score (0), average calculate count per second (984). Solved sudoku: I-I-I-I I | 9 | 4 | 2 | I | 3 | 1 | 5 | I | 6 | 8 | 7 |I I | 8 | 3 | 1 | I | 2 | 7 | 6 | I | 4 | 5 | 9 |I I | 7 | 6 | 5 | I | 8 | 4 | 9 | I | 2 | 3 | 1 |I I-I-I-I I | 3 | 5 | 6 | I | 9 | 2 | 7 | I | 8 | 1 | 4 |I I | 4 | 7 | 9 | I | 1 | 5 | 8 | I | 3 | 2 | 6 |I I | 2 | 1 | 8 | I | 4 | 6 | 3 | I | 9 | 7 | 5 |I I-I-I-I I | 1 | 9 | 7 | I | 6 | 8 | 2 | I | 5 | 4 | 3 |I I | 6 | 2 | 4 | I | 5 | 3 | 1 | I | 7 | 9 | 8 |I I | 5 | 8 | 3 | I | 7 | 9 | 4 | I | 1 | 6 | 2 |I I-I-I-I -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-Sudoku-solver-tp4005002.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Why is solving a partial puzzle much slower than generating one from scratch?
Hello aitchnyu, Can you share your source code about the Planner implementation on sudoku game? To train myself on Planner, I tried to implement a sudoku solver based on Planner, but I didn't manage to go through. Thank you in advance, Quentin -- View this message in context: http://drools.46999.n3.nabble.com/Why-is-solving-a-partial-puzzle-much-slower-than-generating-one-from-scratch-tp3703622p3977593.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fwd: Re: make the Guvnor interface into French
Thank you for your answer. No, I didn't tag the corrections. I will do the fork. Your linkhttps://hudson.jboss.org/hudson/job/droolsjbpm-knowledge/lastSuccessfulBuild/artifact/droolsjbpm-introduction-docs/target/docbook/publish/en-US/html_single/index.html#gettingstarteddoesn't work, I got this : HTTP Status 404 - -- *type* Status report *message* *description* *The requested resource () is not available.* -- JBoss Web/2.1.12.GA-patch-03 *Sorry for the delay :), **I was in holidays **. Regards, Quenitn * 2012/4/7 Vincent Legendre [via Drools] ml-node+s46999n389268...@n3.nabble.com This is exactly what I did. This procedure works like a charm. You said a lot of errors ? I can't be possible :) !! Did you tag your corrections ? the NWELL ? Message original Sujet: Re: [rules-users] make the Guvnor interface into French Date : Fri, 6 Apr 2012 21:27:47 +0100 De : Michael Anstis [hidden email]http://user/SendEmail.jtp?type=nodenode=3892685i=0 Répondre à : Rules Users List [hidden email]http://user/SendEmail.jtp?type=nodenode=3892685i=1 Pour : Rules Users List [hidden email]http://user/SendEmail.jtp?type=nodenode=3892685i=2 Hi Quentin, The droolsjbom-build-bootstrap\README.md is a good source (and kept up to date). The simplest (and preferred) approach might be to fork the github repository, apply your changes and submit a pull request. Please see herehttps://hudson.jboss.org/hudson/job/droolsjbpm-knowledge/lastSuccessfulBuild/artifact/droolsjbpm-introduction-docs/target/docbook/publish/en-US/html_single/index.html#gettingstartedfor more information. With kind regards, Mike On 6 April 2012 10:53, Qchevalier [hidden email]http://user/SendEmail.jtp?type=nodenode=3892685i=3 wrote: Hello, I got your last file (Constants_fr_FR.properties) Vincent, but I found a lot of errors. So here is my corrected file : http://drools.46999.n3.nabble.com/file/n3889908/Constants_fr_FR.properties Constants_fr_FR.properties I didn't manage to integrate this file into the guvnor war file. I understood that I have to rebuild the sources of guvnor, but I didn't manage to do it. I found several documentations about how to build guvnor sources but each time it was either old instructions, either partial instructions. Can you share a good instruction source? Thanks Regards, Quentin -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-make-the-Guvnor-interface-into-French-tp3737267p3889908.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=3892685i=4 https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=3892685i=5 https://lists.jboss.org/mailman/listinfo/rules-users -- If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/rules-users-make-the-Guvnor-interface-into-French-tp3737267p3892685.html To unsubscribe from [rules-users] make the Guvnor interface into French, click herehttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3737267code=cXVlbnRpbi5jaGV2YWxpZXIuYWx0cmFuQGdtYWlsLmNvbXwzNzM3MjY3fDEyMzUwMDk0MzQ= . NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://drools.46999.n3.nabble.com/Re-rules-users-Fwd-Re-make-the-Guvnor-interface-into-French-tp3935200p3935200.html Sent from the Drools: User forum mailing list archive at Nabble.com.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] make the Guvnor interface into French
Hello, I got your last file (Constants_fr_FR.properties) Vincent, but I found a lot of errors. So here is my corrected file : http://drools.46999.n3.nabble.com/file/n3889908/Constants_fr_FR.properties Constants_fr_FR.properties I didn't manage to integrate this file into the guvnor war file. I understood that I have to rebuild the sources of guvnor, but I didn't manage to do it. I found several documentations about how to build guvnor sources but each time it was either old instructions, either partial instructions. Can you share a good instruction source? Thanks Regards, Quentin -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-make-the-Guvnor-interface-into-French-tp3737267p3889908.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users