On 06-06-13
10:22, Michiel Vermandel wrote:
Hi,
(using
drools-planner 5.5.0.Final)
I'm
struggling with assigning weights to
IntConstraintOccurrence in a rule's LHS.
If
I assign different weights for different rules
(because we think one rule is more important
than an other)
The business analysis defines the score weights, it's
not our call to make which is more important etc.
One way talk to you your business people and get them
to convert their knowledge into score weights
is to ask "if you had to put a price tag on
everything, how much would violating this constraint
cost us?".
Basically normalize everything to a price.
For example: in nurse rostering, "not giving a nurse
her day off requests costs the solution 100 $".
It might seem unethical to put a price tag on a
nurse's happiness, but reality does it implicitly
anyway.
our end result is far worse than when we
assign all equal weights.
I
do not look at the total value of hard and
soft score but at the number of violations.
That's comparing apples and oranges.
If you have 2 solutions A and B scored using a
different score function, it's impossible to state
whether A is better/worse than B based on those scores
or the number of violations.
What you can do is take solution B and grind it
through A's score function to compare it with score A
(or vica versa).
I
can imagine that the planner can evolve much
easier to a better solution with all weights
being the same because if not then "transient"
moves will be made impossible to take.
Yes, if and only if the more difficult constraints
have higher weights (otherwise it's the opposite).
But it's a bit absurd. For example in nurse rostering,
I could give all nurses their day off requests if I
didn't have to worry about assigning no more than 2
shifts to the same nurse as the same time...
But
how should we then implement importance in
rules?
Define your score function as your business needs it.
Use the techniques described in the 6.0 manual:
negative/postive, weights and levels.
PS: 6.0.0.Beta3 is out and the new
addSoftConstraintMatch() system is much faster and
easier to use (see the blog post of a few months ago).
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users