[rules-users] [planner] Questions about employee shift rostering example

Geoffrey De Smet ge0ffrey.spam at gmail.com
Tue Jan 19 14:36:43 EST 2010


Hi Samuel,

None of my implementations have a null instance asserted into the 
working memory. Which code is doing insertLogical(null)?
IMHO, It shouldn't do that.

In your code I noticed last time that you used smart functions.
The problem is, those smart functions don't use DRL, so don't do forward 
chaining, re-iterated over a lot of stuff while calculating the result, 
so they break delta score calculation.
Those smart functions also did a lot of things that looked like black 
magic to me, which could be causing your wierd behaviour.
Maybe you can rewrite those functions as DRL patterns?

http://fisheye.jboss.org/browse/~raw,r=31102/JBossRules/trunk/drools-docs/drools-docs-planner/src/main/docbook/images/Chapter-Score_calculation/deltaBasedScoreCalculationNQueens04.svg

With kind regards,
Geoffrey De Smet


Samuel Deballon schreef:
> Hi all, Hi Geoffrey,
> 
> I have implemented a first version of the solution with two types of move  :
> status move and another tour move.
> 
> When i try to retrieved the scoreDetailList, the iterateObject is not clean.
> It contains many null values. I don't know if it's normal but it has for
> consequence that the method SolutionBusiness.getScoreDetailList() return a
> null list.
> 
>         Iterator<ConstraintOccurrence> it = (Iterator<ConstraintOccurrence>)
>             workingMemory.iterateObjects(new
> ClassObjectFilter(ConstraintOccurrence.class));
>         while (it.hasNext()) { //Doesn't in the loop because a value is null
>          ..
>         }
> 
> Maybe you have an idea.
> 
> Samuel




More information about the rules-users mailing list