Re: [rules-users] Planner with a list of planning variables
On 16-01-14 20:58, jonathan.labin wrote: Does having PeriodChangeMove and RoomChangeMove undermine the effect of having the swap filter? no, because they move only 1 lecture Since a swap can be constructed by a sequence of changes does the filter reduce the space or simply remove swapMoves that are silly to enact? simply remove swapMoves that are silly to enact It matters how big the ocean (= search space) is, but it matters far more how you navigate it. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-with-a-list-of-planning-variables-tp4024088p4027734.html Sent from the Drools: User forum mailing list archive at Nabble.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
Re: [rules-users] Planner with a list of planning variables
Does having PeriodChangeMove and RoomChangeMove undermine the effect of having the swap filter? Since a swap can be constructed by a sequence of changes does the filter reduce the space or simply remove swapMoves that are silly to enact? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-with-a-list-of-planning-variables-tp4024088p4027734.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Planner with a list of planning variables
I have a related question and I'd like to ask it by extending the domain described here. Say that instead of the solution being one recipe, I am building a multiple-course meal of recipes. The problem will define the course slots including the maximum number of ingredients that can be used and the list of ingredients allowed for the slots of that course. Not all courses must have a recipe built. If the constraints of the guests can be satisfied with fewer courses, the caterer saves money. Each course is one recipe as described here: a list of ingredients (in my case i don't particularly care about the order of the ingredients within the recipe). Certainly each recipe does not need to use it's maximum number of ingredients. In my current implementation, I have a flattened list of assignment Planning Entities where each assignment represents an ingredient slot of a course mapped ingredient). For example if the first course has a maximum of 5 ingredients, the second course has a maximum of 10 ingredients, and the third has a maximum of 3 ingredients, my problem would have a list containing 18 Planning Entities all in one list. The trouble with this approach is that each slot is a separate entity. This means that assigning the ingredient to each of the 5 possible slots of first course is considered a separate solution when in reality it doesn't matter which slot of the course the ingredient ends up in. This makes the search space much larger than it needs to be and results in a lot of swapping of ingredient assignments within the same course which results in no change in score. Is there a recommended pattern to model this domain efficiently? Is there a modification that I can apply to my current representation of this domain which will allow an ingredient assigned to any slot of a course to be considered the same? Thanks, Jon -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-with-a-list-of-planning-variables-tp4024088p4027704.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Planner with a list of planning variables
On 15-01-14 21:36, jonathan.labin wrote: I have a related question and I'd like to ask it by extending the domain described here. Say that instead of the solution being one recipe, I am building a multiple-course meal of recipes. The problem will define the course slots including the maximum number of ingredients that can be used and the list of ingredients allowed for the slots of that course. Not all courses must have a recipe built. If the constraints of the guests can be satisfied with fewer courses, the caterer saves money. Each course is one recipe as described here: a list of ingredients (in my case i don't particularly care about the order of the ingredients within the recipe). Certainly each recipe does not need to use it's maximum number of ingredients. In my current implementation, I have a flattened list of assignment Planning Entities where each assignment represents an ingredient slot of a course mapped ingredient). For example if the first course has a maximum of 5 ingredients, the second course has a maximum of 10 ingredients, and the third has a maximum of 3 ingredients, my problem would have a list containing 18 Planning Entities all in one list. The trouble with this approach is that each slot is a separate entity. This means that assigning the ingredient to each of the 5 possible slots of first course is considered a separate solution when in reality it doesn't matter which slot of the course the ingredient ends up in. This makes the search space much larger than it needs to be and results in a lot of swapping of ingredient assignments within the same course which results in no change in score. The curriculum course example had the same problem: Lectures (= entities) belonging to the same course are interchangeable. Therefore, I configured the swapMoveSelector as such: swapMoveSelector filterClassorg.optaplanner.examples.curriculumcourse.solver.move.DifferentCourseSwapMoveFilter/filterClass /swapMoveSelector Is there a recommended pattern to model this domain efficiently? Is there a modification that I can apply to my current representation of this domain which will allow an ingredient assigned to any slot of a course to be considered the same? This cannot (currently) be expressed declaratively on the domain. We might want to support that in the future (so the filterClass is automatically applied on the swapMoveSelector etc), feel free to create a jira. Thanks, Jon -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-with-a-list-of-planning-variables-tp4024088p4027704.html Sent from the Drools: User forum mailing list archive at Nabble.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] Planner with a list of planning variables
Hello all, can I use as planning variable a list of values? Here's a test use case: planning a food recipe, where the recipe can have say maximally 5 ingredients (taken from the solution property, I guess). So far I could find in the examples and documentation, it's all about ONE planning variable in the solution, but here I'd need a LIST of such... is it actually doable this way? I cannot do it the other way around, as an ingredient may be found in more recipes... Many thanks, JC ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Planner with a list of planning variables
Currently, Planner only supports a single value for a @PlanningVariable property. Here's the issue for that: But in your case, I 'd just do it like this: class Recipe extends Solution { ListInredient ...; ListAssignment ...; // of size 5 ... } class Ingredient {...} class Assignment { private int index; // Ingredient 1, 2, 3, 4 or 5? private Ingredient ingredient; @PlanningVariable() @ValueRange(...) public Ingredient getIngredient() {...} ... } On 03-06-13 14:21, Justin Case wrote: Hello all, can I use as planning variable a list of values? Here's a test use case: planning a food recipe, where the recipe can have say maximally 5 ingredients (taken from the solution property, I guess). So far I could find in the examples and documentation, it's all about ONE planning variable in the solution, but here I'd need a LIST of such... is it actually doable this way? I cannot do it the other way around, as an ingredient may be found in more recipes... Many thanks, JC ___ 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
Re: [rules-users] Planner with a list of planning variables
Cool, that should work as well :) thanks a lot for the prompt reply! JC From: Geoffrey De Smet ge0ffrey.s...@gmail.com To: Rules Users List rules-users@lists.jboss.org Sent: Monday, June 3, 2013 3:05 PM Subject: Re: [rules-users] Planner with a list of planning variables Currently, Planner only supports a single value for a @PlanningVariable property. Here's the issue for that: But in your case, I 'd just do it like this: class Recipe extends Solution { ListInredient ...; ListAssignment ...; // of size 5 ... } class Ingredient {...} class Assignment { private int index; // Ingredient 1, 2, 3, 4 or 5? private Ingredient ingredient; @PlanningVariable() @ValueRange(...) public Ingredient getIngredient() {...} ... } ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users