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 {
  List<Inredient> ...;
  List<Assignment> ...; // 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