
- Traditional Pattern
- Shower( temperature == “hot” )
- Pattern with uncertainty evaluator
- Shower( temperature == ~“hot” )
- Pattern with uncertainty evaluator and parameters
- Shower( temperature == ~(10, $x, 15, $y) “hot” )
All things Artificial Intelligence related: Rules, Processes, Events, Agents, Planning, Ontologies and more :)

Drools-solver combines a search algorithm with the power of the drools rule engine to solve planning problems, such as:
Employee shift rostering
Freight routing
Supply sorting
Lesson scheduling
Exam scheduling
Drools-solver supports several search algorithms, such as simple local search, tabu search and simulated annealing. You can easily switch the search algorithm, by simply changing the configuration. There's even a benchmark utility which allows you to play out the different search algorithms against each other on your planning problem.
Drools-solver uses the drools rule engine to calculate the score, based on score rules. This allows you to easily add hard and soft constraints in your score function, simply by adding a score rule.
It's available now in the drools trunk and the manual explains how to run the examples yourself in no time.

package org.drools.examples
import org.drools.examples.FibonacciExample.Fibonacci;
dialect "mvel"
rule Recurse
salience 10
when
f : Fibonacci ( value == -1 )
not ( Fibonacci ( sequence == 1 ) )
then
insert( new Fibonacci( f.sequence - 1 ) );
System.out.println( "recurse for " + f.sequence );
end
rule Bootstrap
when
f : Fibonacci( sequence == 1 || == 2, value == -1 ) // this is a multi-restriction || on a single field
then
modify ( f ){ value = 1 };
System.out.println( f.sequence + " == " + f.value );
end
rule Calculate
when
f1 : Fibonacci( s1 : sequence, value != -1 ) // here we bind sequence
f2 : Fibonacci( sequence == (s1 + 1 ), value != -1 ) // here we don't, just to demonstrate the different way bindings can be used
f3 : Fibonacci( s3 : sequence == (f2.sequence + 1 ), value == -1 )
then
modify ( f3 ) { value = f1.value + f2.value };
System.out.println( s3 + " == " + f3.value ); // see how you can access pattern and field bindings
end
<rule-set name="fibonacci"
xmlns="http://drools.org/rules"
xmlns:java="http://drools.org/semantics/java"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/rules rules.xsd
http://drools.org/semantics/java java.xsd">
<import>org.drools.examples.fibonacci.Fibonacci</import>
<rule name="Bootstrap 1" salience="20">
<parameter identifier="f">
<class>Fibonacci</class>
</parameter>
<java:condition>f.getSequence() == 1</java:condition>
<java:condition>f.getValue() == -1</java:condition>
<java:consequence>
f.setValue( 1 );
System.err.println( f.getSequence() + " == " + f.getValue() );
drools.modifyObject( f );
</java:consequence>
</rule>
<rule name="Bootstrap 2">
<parameter identifier="f">
<class>Fibonacci</class>
</parameter>
<java:condition>f.getSequence() == 2</java:condition>
<java:condition>f.getValue() == -1</java:condition>
<java:consequence>
f.setValue( 1 );
System.err.println( f.getSequence() + " == " + f.getValue() );
drools.modifyObject( f );
</java:consequence>
</rule>
<rule name="Recurse" salience="10">
<parameter identifier="f">
<class>Fibonacci</class>
</parameter>
<java:condition>f.getValue() == -1</java:condition>
<java:consequence>
System.err.println( "recurse for " + f.getSequence() );
drools.assertObject( new Fibonacci( f.getSequence() - 1 ) );
</java:consequence>
</rule>
<rule name="Calculate">
<parameter identifier="f1">
<class>Fibonacci</class>
</parameter>
<parameter identifier="f2">
<class>Fibonacci</class>
</parameter>
<parameter identifier="f3">
<class>Fibonacci</class>
</parameter>
<java:condition>f2.getSequence() == (f1.getSequence() + 1)</java:condition>
<java:condition>f3.getSequence() == (f2.getSequence() + 1)</java:condition>
<java:condition>f1.getValue() != -1</java:condition>
<java:condition>f2.getValue() != -1</java:condition>
<java:condition>f3.getValue() == -1</java:condition>
<java:consequence>
f3.setValue( f1.getValue() + f2.getValue() );
System.err.println( f3.getSequence() + " == " + f3.getValue() );
drools.modifyObject( f3 );
drools.retractObject( f1 );
</java:consequence>
</rule>
</rule-set>
16293 drools-4.0.0-bin.zip
8364 drools-4.0.0-brms-standalone.zip
7207 drools-4.0.0-src.zip
6978 drools-4.0.0-eclipse.zip
5921 drools-4.0.0-brms.zip
5191 drools-4.0.0-examples.zip