Hi all Drools users,<br>
I'm trying to use Drools in order to determinize a category from a
record from an input file and write the category int an output file.<br>
I have around 100 categories and so around 100 rules.<br>
Everything works well except the fact that the perf are really bad.<br>
After profiling my program, it appears that the performance problem
cames from the call of the modifyObject method everytime I read a new
record. With a file of 10000 lines, I need 200 seconds to determinize
all the categories. The modifyObject method calls represents 185
seconds.<br>
 <br>
The problem is that I've not found any other ways to activate my rules without 
making a call to modifyObject.<br>
<br>
Is there any other way to read a file, and determinize all my
categories without regenerating the activations in the agenda every new
line ?<br>
<br>
I already tried to activate all my rules, to get all the activations :<br>
org.drools.spi.Activation[] acts = 
workingMemory.getAgenda().getActivations();<br>
<br>
To create a new agenda Group :<br>
org.drools.common.AgendaGroupImpl group = new 
org.drools.common.AgendaGroupImpl("test");<br>
        for(int j = 0; j < acts.length; j++) {<br>
            group.add(acts[j]);<br>
        }<br>
<br>
To create my agenda :<br>
org.drools.common.Agenda agenda = new 
org.drools.common.Agenda(workingMemory);<br>
        agenda.addAgendaGroup(group);<br>
        agenda.setFocus(group);<br>
<br>
And I modified the working memory to always fire the rules in my agenda :<br>
workingMemory.fireAllRules(agenda);<br>
<br>
But the problem is that the LHS is not evaluated and all the rules
activated are fired so I always have the same result (the one from the
rules with the smaller salience...).<br>
<br>
I will really appreciate any help :-)<br>
<br>
Thank you<br>
<br>
<br>

CaraMail le seul webmail à vous offir des fils d'infos RSS - www.caramail.com

Reply via email to