monster750jp

monster750jp's information

Drools sample

2004-07-06 12:11:20 | Weblog
http://www.drools.org/

I always develop a very simple example, which recommends some products for ganeder and age. I describe drools sample. Apache web application prompts ganeder and age, and executes drools to display the recommendation result. For example, if gender is male and age is greater than 20 and age is less than 29, then recommends products A and products B. I also put this kind of business rules into Excel and Excel macro generates drools syntax. So, what business people need to do is simply meintain Excel spredsheets. Decision table is one of the most powerful tools for business rules and easy for business people to develop, add, remove and manage business rules.
A simple recommendatio sample:

<rules xmlns="http://drools.org/rules">

<semantics module="org.drools.semantics.java"/>

<rule-set name="Recommendation Rules"

<rule name="over 20">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>

<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 1 ))
</java:condition>
</condition>

<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>

<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>

<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>

<>
<consequence>
<java:consequence>
System.err.println( "** over 20" );
recommendation.setSS( "ProductA" );
System.err.println( recommendation.getSS());
recommendation.setCheckStatus(1);
System.err.println( recommendation.getCheckStatus());
modifyObject( recommendation);
</java:consequence>
</consequence>
</rule>

<rule name="between 20 and 30">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>

<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>

<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>

<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>
<condition>
<java:condition>recommendation.getAge() <30

RETE, RETE II vs STP

2004-07-04 16:12:40 | Weblog
Tpoics:
What's RETE?
What's RETE II?
STP stands for straight through processing.
Need to clear when RETE is effective or not.

RETE... WRONG
http://www.corticon.com/html/so_rete_wrong.html

Charles Forgy Ph.D., Chief Scientist and Co-Founder
Forgy brings 27 years of rules experience and is the inventor of the RETE algorithm rules engine. The RETE algorithm is widely recognized as by far the most efficient algorithm and is utilized in almost all implementations of production rules based systems in the industry today. RETE is the only algorithm for production systems whose efficiency is asymptotically independent of the number of rules. Charles Forgy has a PhD from Carnegie Mellon University. Charles Forgy is a protégé of Allen Newell, who was one of the 4 founding fathers of the Artificial Intelligence(AI) field.
http://www.rulespower.com/contents/management.html

Constructing Intelligent Agents Using Java: Professional Developer's Guide, 2nd Edition
by Joseph P. Bigus, Jennifer Bigus, Joe Bigus, Jennifer Bigus
http://www.amazon.com/exec/obidos/tg/detail/-/047139601X/qid=1088925079/sr=1-2/ref=sr_1_2/102-6878944-2248129?v=glance&s=books
http://www.amazon.co.jp/exec/obidos/ASIN/4797318147/qid%3D1088924978/250-6907314-8075464
Constructing Intelligent Agents With Java: A Programmer's Guide to Smarter Applications
by Joseph P. Bigus, Jennifer Bigus
http://www.amazon.com/exec/obidos/tg/detail/-/0471191353/qid=1088925079/sr=1-1/ref=sr_1_1/102-6878944-2248129?v=glance&s=books

ISID S.T.P Engine
http://www.isid.co.jp/solution/finance/stp_engine.html