[rules-users] Reusing a Solution in Drools Planner (real-time planning)

Geoffrey De Smet ge0ffrey.spam at gmail.com
Sat May 5 03:53:34 EDT 2012


Op 04-05-12 19:11, Cedric Hurst schreef:
> I would imagine using an existing solution should be pretty straightforward,
> you'd simply set the previous solution as the initial solution in your next
> run:
>
> solver.setPlanningProblem(oldSolution);
> solver.solve();
>
> There's unfortunately some unavoidable upfront cost to doing things that
> way, but the advantage is that you don't have to keep the solver running
> while you're waiting on a change. You can persist your previous solution
> and fire up a new solver if something changes.
>
> The other option is the real-time planning option mentioned in chapter 12.
> I haven't worked with it yet, but I believe you'd simply need to create a
> ProblemFactChange() with an onChange() method that applies the change to
> working memory the same way you would in doMove(), with
> scoreDirector.afterVariableChanged() calls, etc. I'm not quite sure how
> stable the real-time planning option is at the moment, though.
I have implemented it on several examples (cloud balance, nurse 
rostering, tsp, vehicle routing)
and I haven't been able to break it yet.
I do live demo's during presentations where I show it by randomly 
"clicking around" (kill computers in cloud balance, add customers in 
vehicle routing, ...).

Take a look at this video (especially near the end) and blog:
   http://vimeo.com/25902052
   
http://blog.athico.com/2011/07/real-time-planning-with-drools-planner.html
> --
> View this message in context: http://drools.46999.n3.nabble.com/Reusing-a-Solution-in-Drools-Planner-tp3962821p3962954.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
>

-- 
With kind regards,
Geoffrey De Smet




More information about the rules-users mailing list