[jboss-svn-commits] JBL Code SVN: r31871 - in labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook: images/Chapter-Benchmarking_and_tweaking and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Feb 28 04:58:58 EST 2010
Author: ge0ffrey
Date: 2010-02-28 04:58:58 -0500 (Sun, 28 Feb 2010)
New Revision: 31871
Added:
labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/images/Chapter-Benchmarking_and_tweaking/bestScoreOverTimeGraph.png
Modified:
labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Benchmarking_and_tweaking/Chapter-Benchmarking_and_tweaking.xml
Log:
JBRULES-2440 docs
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Benchmarking_and_tweaking/Chapter-Benchmarking_and_tweaking.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Benchmarking_and_tweaking/Chapter-Benchmarking_and_tweaking.xml 2010-02-28 09:47:10 UTC (rev 31870)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/en-US/Chapter-Benchmarking_and_tweaking/Chapter-Benchmarking_and_tweaking.xml 2010-02-28 09:58:58 UTC (rev 31871)
@@ -1,42 +1,33 @@
<?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>Benchmarking and tweaking</title>
<section>
<title>Finding the best configuration</title>
<para>Drools Planner supports several solver types, but you're probably wondering which is the best one? Although
- some solver types generally perform better then others, it really depends on your problem domain. Most solver types
- also have settings which can be tweaked. Those settings can influence the results of a solver a lot, although most
- settings perform pretty good out-of-the-box.
- </para>
+ some solver types generally perform better then others, it really depends on your problem domain. Most solver types
+ also have settings which can be tweaked. Those settings can influence the results of a solver a lot, although most
+ settings perform pretty good out-of-the-box.</para>
<para>Luckily, Drools Planner includes a benchmarker, which allows you to play out different solver types and
- different settings against each other, so you can pick the best configuration for your problem domain.
- </para>
+ different settings against each other, so you can pick the best configuration for your problem domain.</para>
</section>
<section>
<title>Building a Benchmarker</title>
- <para>You can build a
- <literal>Benchmarker</literal>
- instance with the<literal>XmlSolverBenchmarker</literal>.
- Configure it with a benchmarker configuration xml file:
- </para>
+ <para>You can build a <literal>Benchmarker</literal> instance with the<literal>XmlSolverBenchmarker</literal>.
+ Configure it with a benchmarker configuration xml file:</para>
- <programlisting>XmlSolverBenchmarker benchmarker = new XmlSolverBenchmarker();
- benchmarker.configure("/org/drools/planner/examples/nqueens/benchmark/nqueensSolverBenchmarkConfig.xml");
- benchmarker.benchmark();
- benchmarker.writeResults(resultFile);
- </programlisting>
+ <programlisting> XmlSolverBenchmarker benchmarker = new XmlSolverBenchmarker();
+ benchmarker.configure("/org/drools/planner/examples/nqueens/benchmark/nqueensSolverBenchmarkConfig.xml");
+ benchmarker.benchmark();
+ benchmarker.writeResults(resultFile);</programlisting>
<para>A basic benchmarker configuration file looks something like this:</para>
@@ -98,31 +89,45 @@
</solverBenchmarkSuite></programlisting>
<para>This benchmarker will try 4 configurations (1 solution tabu, 2 move tabu's and 1 solution-move tabu) on 2 data
- sets (32 and 64 queens), so it will run 8 solvers.
- </para>
+ sets (32 and 64 queens), so it will run 8 solvers.</para>
- <para>Every
- <literal>solverBenchmark</literal>
- entity contains a solver configuration (for example a local search
- solver) and one or more
- <literal>unsolvedSolutionFile</literal>
- entities. It will run the solver configuration on
- each of those unsolved solution files. A
- <literal>name</literal>
- is optional and generated if absent. The common
- part of multiple
- <literal>solverBenchmark</literal>
- entities can be extracted to the
- <literal>inherited</literal>
- entities and can be overwritten per
- <literal>solverBenchmark</literal>
- entity.
- </para>
+ <para>Every <literal>solverBenchmark</literal> entity contains a solver configuration (for example a local search
+ solver) and one or more <literal>unsolvedSolutionFile</literal> entities. It will run the solver configuration on
+ each of those unsolved solution files. A <literal>name</literal> is optional and generated if absent. The common
+ part of multiple <literal>solverBenchmark</literal> entities can be extracted to the <literal>inherited</literal>
+ entities and can be overwritten per <literal>solverBenchmark</literal> entity.</para>
- <para>If you specify a
- <literal>solvedSolutionFilesDirectory</literal>
- (relative to the working directory), the best
- solution of each solver run will be written to that directory.
- </para>
+ <para>If you specify a <literal>solvedSolutionFilesDirectory</literal> (relative to the working directory), the best
+ solution of each solver run will be written to that directory.</para>
</section>
+
+ <section>
+ <title>Best score over time statistic (graph and CSV)</title>
+
+ <para>The benchmarker supports outputting the best score over time statistic as a graph or CSV (comma separated
+ values) file. Here's an example of a graph:</para>
+
+ <figure>
+ <title>Best score over time statistic</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Chapter-Benchmarking_and_tweaking/bestScoreOverTimeGraph.png" format="PNG"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To configure graph and CSV output of the best score over time, just add the
+ <literal>solverStatisticType</literal> and the <literal>solverStatisticFilesDirectory</literal> lines:</para>
+
+ <programlisting><solverBenchmarkSuite>
+ <solvedSolutionFilesDirectory>local/data/nqueens/solved</solvedSolutionFilesDirectory>
+ <solverStatisticType>BEST_SOLUTION_CHANGED</solverStatisticType>
+ <solverStatisticFilesDirectory>local/data/nqueens/statistic</solverStatisticFilesDirectory>
+ ...
+</solverBenchmarkSuite></programlisting>
+
+ <para>It will output an overview of all graphs and CSV files as an <filename>index.html</filename> file in the
+ statistic directory.</para>
+ </section>
</chapter>
Added: labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/images/Chapter-Benchmarking_and_tweaking/bestScoreOverTimeGraph.png
===================================================================
(Binary files differ)
Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-planner/src/main/docbook/images/Chapter-Benchmarking_and_tweaking/bestScoreOverTimeGraph.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jboss-svn-commits
mailing list