[rules-users] Re: drools solver for 2d knapsack problem
Sounds a like good planning problem for drools-solver :) Lessonsschedule and nqueens are nice problems to understand how drools-solver works, but they aren't optimized (and don't need to be). The Itc2007 examination example is highly optimized, but more difficult to understand. The latest manual is at: https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/index.html If you've already read it a while back, I 've just added some info about score traps and relativeSelection, 2 things that can boost your performance. Drools 5.0.1 (including drools-solver) will be released any day now and will fix the runExample.sh script which was released in the 5.0.0.CR1 download. The SimulatedAnnealingAccepter and GreatDelugeAccepter aren't any good yet (patches welcome), so stick with tabu search for now. I am working on shifting penalty support for hard/soft constraints, which should boost performance. With kind regards, Geoffrey De Smet Wolfgang Laun schreef: That's indeed more like a problem for using rules (and far from the plain cutting sheet I had in mind), From the examples, itc2007 and lessonsschedule might give you an idea how to approach your problem. -W On Fri, May 8, 2009 at 1:05 PM, Olaf Raether o.raet...@epro.de mailto:o.raet...@epro.de wrote: I think it´s more a knapsack problem. And the rectangles have to follow some business rules, so that´s the reason try to using solver. Here´s an image of the problem. http://www.nabble.com/file/p23443994/2dknapsack.jpg 2dknapsack.jpg The big rectangle is the load area of a truck und the small ones are racks. And i have to put them on the truck. And the Business rules come into the play, cause the racks can only mounted in a special manner on the track. Any hint is welcome Wolfgang Laun-2 wrote: I've researched this, a long time ago (trying to find a solution for a problem from the worse class). Even then, several results could be found in the literature for the cutting sheet problem for rectangles, showing that certain parameters (w.r.t. to rectangle dimensions being multiples of each other, replication factors, etc.) influence the problem space considerably. (Cutting random rectangles from a sheet is hardly an industry problem.) Having said that, drools-solver should be able to handle this problem. However, it is very likely that there is an algorithm that solves your particular problem more efficiently. -W On Fri, May 8, 2009 at 9:59 AM, Olaf Raether o.raet...@epro.de mailto:o.raet...@epro.de wrote: Rectangles within a Rectangle OR Wolfgang Laun-2 wrote: Rectangles or simple polygons or worse? -W On Fri, May 8, 2009 at 9:02 AM, Olaf Raether o.raet...@epro.de mailto:o.raet...@epro.de wrote: Hey , i would like to use drools solver for a 2d knapsack problem. Has anyone expirience with that ? Is drools solver made for such a task ? Thank for hints Olaf Raether ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/drools-solver-for-2d-knapsack-problem-tp23441149p23441743.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/drools-solver-for-2d-knapsack-problem-tp23441149p23443994.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org
[rules-users] Re: Drools : usage as appointment booking engine ? (drools-solver, drools-fusion)
As I understand it, the time language in drools-fusion applies to fusion events (CEP). Your appointments and timeslots are actually normal drools facts, not fusion events, so I doubt it's possible to apply that time language meaningfully. However it should be possible to do things like this: when firstTimeSlot : Timeslot(firstDate : date) secondTimeSlot : TimeSlot(secondDate : date) eval(JodaTimeHelper.isSameWeek(firstDate, secondDate) ... then ... As you can see, I 'd suggest using JodaTime instead of DateCalendar, because it comes with methods to determine if it's the same day, week, etc reliably. Hopefully JSR-310 (=standarized JodaTime) will make Java 7. If you do want to (or have to) continue torturing yourself with DateCalendar: apache's commons-lang has some of those methods already implemented. Either way, drools-solver doesn't care and can work with both :) As for real-time changes while drools-solver is planning: The new Solver.cancel() method allows you to cancel solving, so you can apply those changes and then you can call Solver.solve() again to continue from the last best score. However, you 'll need to use some java.concurrent stuff (ExcecutorService), probably a Latch, to wait for the solver to finish on the solver thread (after calling cancel()), before applying the changes in your changingAndCanceling thread. With kind regards, Geoffrey De Smet Wim Vancroonenburg schreef: That makes a lot of sense. Metaheuristics and local search methods (which Drools Solver supports) are great for creating schedules, roster, plannings, ... . I've been using Drools Solver for a bed assignment problem in health care (more of a benchmark problem) and it performs well. Colleagues of mine are solving exam-timetables and course-timetables with metaheuristics, so these type of problems should be equally doable with Drools Solver. Drools Solver does not have any time operators like Nicolas says, that is something that your model should implement. Sincerely, Wim Vancroonenburg Greg Barton wrote: Well, Fusion is mainly geared towards processing incoming dynamic events. Drools-solver would be best for creating the appointment schedule. However, if you want to react to real time changes that may affect your schedule, you could always use drools-fusion for that. (i.e. we have an appointment for Bob, Alice, and Chuck in Room D on Monday. Then an event comes in saying Chuck is sick within 30 minues of the appointment. If Chuck is a critical member of the meeting the system decides to reschedule, but without the only on Mondays constraint.) So drools-solver would create the schedule, and drools-fusion would decide in real time based on the current schedule structure and the incoming events whether to respaawn a solver session to adjust the schedule. Does that make sense? --- On Thu, 5/7/09, Damien Raude-Morvan draz...@drazzib.com wrote: From: Damien Raude-Morvan draz...@drazzib.com Subject: Re: [rules-users] Drools : usage as appointment booking engine ? To: Rules Users List rules-users@lists.jboss.org Date: Thursday, May 7, 2009, 10:50 AM Hello, Hi Nicolas, you should look at drools-solver here is a link to the documentationhttp://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-solver/html_single/index.html Thanks this documentation, I was using oudated documentation from http://users.telenet.be/geoffrey/tmp/solver/manual/html_single/ . I've evaluated drools-solver, for example trying to evolve lessonschedule sample to include some time constraints but I failed to use time operators in drools solver. I found Drools Fusion time constraints (before, inside, meets) interesting but for now haven't been able to build something with it. Drools Fusion StockTick sample seems oriented to STREAM event and not to managing time slots and constraints on this time slots. Anybody having experience with such problems ? Regards, 2009/5/7 Damien Raude-Morvan draz...@drazzib.com Hi, I'm evaluating use of Drools 5 as an appointment booking engine. My input data are : - some time slots, defined with a start and end time. - some appointment constraints (only monday, only morning, appointment theorical duration) I've looked at Drools 5 Fusion without finding a way to go with this. Can someone give me some pointer / start URL about how to solve this kind of problems ? -- Damien Raude-Morvan / www.drazzib.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] How to import DRL into Business Rule Assets section?
Hello, We are trying to develop a system based on Drools and want to have a repository based on JBoss and manage it from the Guvnor website. Now, we have a few questions: 1) Can we import DRL files into the Business rules section, so that later we can view/modify them using the graphical interface (text boxes, drop down menus, etc)? This will be very useful for production use. What we tried so far, imports them as text in the Technical rules section which is not user friendly at all. 2) Can we at all import .dslr files ? And where from in the Guvnor GUI ? Thanks a lot, John -- View this message in context: http://www.nabble.com/How-to-import-DRL-into-Business-Rule-Assets-section--tp23443796p23443796.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users