Op 11-12-12 22:25, Willem van Asperen schreef:
Hi All,

I have a PlanningEntity that has several planning variables, say A and B. Now, if A is O then B can be X or Y and when A is P then B can be Y or Z.

I see two routes:
I recommend this (not just because of [1], but because it allows certain heuristics (SA for example) to temporary break the hard constraint to "tunnel through those hard constraints").

Several ways to implement:
- generate all valid A-B combinations in getProblemFacts() (see manual section "cached problem facts") and do something like
when
  MyEntity(a, b)
  not ABCombo(same a, same b)
then
  // bad, possibly get weight from ABCombo
end
- add a method on my MyEntity:
when
  MyEntity(a, b, aAndBCompatible = false)
then
  // bad
end

Dependending on the difficulty of the domain, moveSelectionFilter and/or moveSelectionProbability could be helpful to optimize the selected moves.
The default swap move already swaps all vars by default, so that's good.

[1] Entity property is supported in 5.5 currently. (see documentation warning at the start of that section).

What is the best route?

(Alternatively I do not use the constructionHeuristic and just start of my solution with a randomly (but correct) generated solution)

Regards,
Willem



_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users