[jboss-svn-commits] JBL Code SVN: r31101 - in labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US: Chapter-Score_calculation and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jan 15 06:29:05 EST 2010


Author: ge0ffrey
Date: 2010-01-15 06:29:05 -0500 (Fri, 15 Jan 2010)
New Revision: 31101

Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Planner_introduction/Chapter-Planner_introduction.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Score_calculation/Chapter-Score_calculation.xml
Log:
delta score calculation

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Planner_introduction/Chapter-Planner_introduction.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Planner_introduction/Chapter-Planner_introduction.xml	2010-01-15 11:07:31 UTC (rev 31100)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Planner_introduction/Chapter-Planner_introduction.xml	2010-01-15 11:29:05 UTC (rev 31101)
@@ -1,12 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<chapter xmlns="http://docbook.org/ns/docbook"
-         xmlns:xlink="http://www.w3.org/1999/xlink"
-         xmlns:xi="http://www.w3.org/2001/XInclude"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
-                             http://www.w3.org/1999/xlink http://www.docbook.org/xml/5.0/xsd/xlink.xsd"
-         version="5.0" xml:base="./">
-
+<chapter version="5.0"
+         xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd http://www.w3.org/1999/xlink http://www.docbook.org/xml/5.0/xsd/xlink.xsd"
+         xml:base="./" xmlns="http://docbook.org/ns/docbook" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:ns="http://docbook.org/ns/docbook">
   <title>Planner introduction</title>
 
   <section>
@@ -130,6 +127,8 @@
       and pick an example:</para>
 
       <programlisting>$ ./runExamples.sh</programlisting>
+
+      <programlisting>$ runExamples.bat</programlisting>
     </section>
 
     <section>
@@ -185,18 +184,25 @@
   </section>
 
   <section>
-    <title>Questions, issues and patches</title>
+    <title>Questions, issues, patches and blogs</title>
 
-    <para>Your questions are welcome on <link xlink:href="http://www.jboss.org/drools/lists.html">the user mailing
-    list</link>. You can read/write to the mailing list without littering your mailbox through <link
+    <para>Your questions and remarks are welcome on <link xlink:href="http://www.jboss.org/drools/lists.html">the user
+    mailing list</link>. Start the subject of your mail with <literal>[planner]</literal>. You can read/write to the
+    user mailing list without littering your mailbox through <link
+    xlink:href="http://n3.nabble.com/Drools-User-f47000.html">this web forum</link> or <link
     xlink:href="nntp://news.gmane.org/gmane.comp.java.drools.user">this newsgroup</link>.</para>
 
     <para>Feel free to report an issue (such as a bug, improvement or a new feature request) for the Drools Planner code
-    or for this manual to <link xlink:href="https://jira.jboss.org/jira/browse/JBRULES">the drools JIRA</link>. Select
-    the component <literal>drools-planner</literal>.</para>
+    or for this manual to <link xlink:href="https://jira.jboss.org/jira/browse/JBRULES">the drools issue tracker</link>.
+    Select the component <literal>drools-planner</literal>.</para>
 
     <para>Patches are very welcome and get priority treatment! Attach them to a JIRA issue and optionally send a mail to
-    the dev mailing list to get the issue fixed fast. By open sourcing your improvements, you 'll benefit from
-    improvements made upon your improvements.</para>
+    the dev mailing list to get the issue fixed fast. By open sourcing your improvements, you 'll benefit from our peer
+    review, improvements made upon your improvements and maybe even a thank you on our blog.</para>
+
+    <para>Check <link xlink:href="http://blog.athico.com/search/label/planner">our blog</link> for news. If Drools
+    Planner helps you, don't forget to blog or to <link
+    xlink:href="http://twitter.com/#search?q=%23droolsplanner">twitter (hashtag #droolsplanner)</link> about it
+    yourself!</para>
   </section>
 </chapter>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Score_calculation/Chapter-Score_calculation.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Score_calculation/Chapter-Score_calculation.xml	2010-01-15 11:07:31 UTC (rev 31100)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Score_calculation/Chapter-Score_calculation.xml	2010-01-15 11:29:05 UTC (rev 31101)
@@ -1,12 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<chapter xmlns="http://docbook.org/ns/docbook"
-         xmlns:xlink="http://www.w3.org/1999/xlink"
-         xmlns:xi="http://www.w3.org/2001/XInclude"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
-                             http://www.w3.org/1999/xlink http://www.docbook.org/xml/5.0/xsd/xlink.xsd"
-         version="5.0" xml:base="./">
-
+<chapter version="5.0"
+         xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd http://www.w3.org/1999/xlink http://www.docbook.org/xml/5.0/xsd/xlink.xsd"
+         xml:base="./" xmlns="http://docbook.org/ns/docbook" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:ns="http://docbook.org/ns/docbook">
   <title>Score calculation with a rule engine</title>
 
   <section>
@@ -51,14 +48,6 @@
 
     <para>You can add multiple <literal>&lt;scoreDrl&gt;</literal> entries if needed.</para>
 
-    <para>It's recommended to use drools in forward-chaining mode (which is the default behaviour), as for solver
-    implementations this will create the effect of a <emphasis>delta based score calculation</emphasis> instead of a
-    full score calculation on each solution evaluation. For example, if a single queen moves from y <literal>0</literal>
-    to <literal>3</literal>, it won't bother to recalculate the "multiple queens on the same horizontal line" constraint
-    for queens with y <literal>1</literal> or <literal>2</literal>. This is a huge performance gain. <emphasis
-    role="bold">Drools Planner gives you this huge performance gain without forcing you to write a very complicated delta
-    based score calculation algorithm.</emphasis> Just let the drools rule engine do the hard work.</para>
-
     <para><emphasis role="bold">Adding more constraints is <emphasis role="bold">easy and </emphasis>scalable</emphasis>
     (once you understand the drools rule syntax). This allows you to add a bunch of soft constraint score rules on top
     of the hard constraints score rules with little effort and at a reasonable performance cost. For example, for a
@@ -66,6 +55,32 @@
   </section>
 
   <section>
+    <title>Delta based score calculation</title>
+
+    <para>It's recommended to use Drools in forward-chaining mode (which is the default behaviour), as for score
+    implementations this will create the effect of a <emphasis>delta based score calculation</emphasis> instead of a
+    full score calculation on each solution evaluation. For example, if a single queen A moves from y
+    <literal>0</literal> to <literal>3</literal>, it won't bother to recalculate the "multiple queens on the same
+    horizontal line" constraint between 2 queens if neither of those queens is queen A. This is a huge performance gain.
+    <emphasis role="bold">Drools Planner gives you this huge performance gain without forcing you to write a very
+    complicated delta based score calculation algorithm.</emphasis> Just let the Drools rule engine do the hard
+    work.</para>
+
+    <figure>
+      <title>Delta based score calculation for the 4 queens puzzle</title>
+
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="images/Chapter-Score_calculation/deltaBasedScoreCalculationNQueens04.png" format="PNG"></imagedata>
+        </imageobject>
+      </mediaobject>
+    </figure>
+
+    <para>The speedup due to delta based score calculation is huge, because the speedup is relative to the size of your
+    planning problem (your n). By using score rules, you get that speedup without writing any delta code.</para>
+  </section>
+
+  <section>
     <title>The ScoreDefinition interface</title>
 
     <para>The <literal>ScoreDefinition</literal> interface defines the score representation. The score must a



More information about the jboss-svn-commits mailing list