[rules-users] Creating selection filter for PlanningEntity with 4 planning variables

Geoffrey De Smet ge0ffrey.spam at gmail.com
Thu Nov 7 11:27:55 EST 2013


On 07-11-13 16:21, maciekpob wrote:
> We are developing an application whose PlanningEntity has multiple planning
> variables, in fact 4.  There are some moves that we do not want to select.
> To ensure that the values proposed (moves) for the 4 different variables do
> not break a constraint (between them).  We wanted to filter out inacceptable
> move configurations instead of using the score function to check the
> constraints.
>
> We studied the MoveSelector and SelectorFilter APIs and we implemented a
> ChangeMove SelectionFilter as an UnionMoveSelector of ChangeMoves of the
> four variables.   The SelectionFilter is written to accept or refuse the
> values (of the 4 variables) proposed.
>
>   
>
> However we encounter problems:
>
> -          The same ChangeMove (with same values of the 4 variables)  are
> proposed in consecutive moves and hence invocations of SelectionFilter
A) First, see what happens if you put on the unionMoveSelector 
cacheType=PHASE (or STEP).
By using a cacheType != JIT you guarantee that the same ChangeMove 
cannot be selected twice.

I would expect you to go out of memory in that case.
If that's not the case - then see C).

B) Next, see what happens if you put the cacheType=PHASE (or STEP) on 
every changeMove, but not in unionMoveSelector.
This probably fixes the problem and might be your favorite way to do things.
But I want to know why you're getting the bailout, so do figure that out 
and reply :)
>
> -          The SelectionFilter rejects the values since it breaks
> constraints
>
> Then the we get a warning : “Bailing out of neverEnding selector ({}) to
> avoid infinite loop”.
C) Bailout is normally almost impossible to occur. Let me explain bailout.
Bailout only applies with filtering for cacheType=JIT, because JIT 
selectors are neverEnding.
Bailout happens if it's has selected (size * 10) moves (so if there are 
1 million possible moves, it must have selected 10 million moves)
AND not a single one of them was accepted by the filter.

Given the fact that it keeps selecting the same move - and that move is 
not accepted, that might explain this though.
So the real question is why does it keep selecting the same move? Is 
there only 1 move?


PS: what version are you using?
I remember fixing a bailout related problem in one of the CR's. Make 
sure you're using 6.0.0.CR5 or higher.
>   
>
> Hence we have been unable to implement the SelectionFilter for our purposes.
>
> Could you advise us?



>
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Creating-selection-filter-for-PlanningEntity-with-4-planning-variables-tp4026575p4026679.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list