[rules-users] Planner: weighting moves & adaptive foragers

Christopher Dolan christopher.dolan at avid.com
Mon Apr 16 16:31:23 EDT 2012


Three related questions about Drools Planner:

My planning problem involves distributing N jobs into M job queues. The optimal queue ordering depends on a large number of factors, but most important are job priority and job age. Priority usually wins, but old jobs can trump to avoid starvation.

If N x M is large, the collection of possible moves becomes large. But I know a priori that some moves are more likely to help than others. For example, I can promote the high-priority and old jobs first, because they will have the largest score impact.

1) Can I weight the selector to pick the better moves first? It looks like I'd make a custom AbstractSelector subclass that shuffled differently from MoveFactorySelector, maybe lazily finding moves via a pick function.

Of course, selecting better moves first is worthless if the forager doesn't use shortcuts, like FIRST_BEST_SCORE_IMPROVING. But the existing AcceptingForager implementation is very binary: it either takes the first good score or it ignores score and waits for a total number of moves. 

2) Has anyone built a generic Forager that looks at the distribution of scores and stops early if it finds a fantastic outlier? In particular, early in the solver there are lots of very easy improvements to make. Taking the first good one may be premature, but going through 1000 moves is a waste of time. I'd like a forager that just tries a few moves early and then tries more moves later on when it's harder to make gains. On the other hand, is putting a lot of work into a perfect forager just redundant with the acceptor?

3) Has anyone employed the undocumented TopListSelector? I'm intrigued that it feeds the forager's best moves back into the selector. How does it work? I think you need to combine it with a move factory to seed the solutions, but then it's redundant with that factory's output. Are selectors allowed to return the same move twice??

Chris




More information about the rules-users mailing list