<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 06-06-13 10:22, Michiel Vermandel
wrote:<br>
</div>
<blockquote
cite="mid:1370506920.82531.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:arial,
helvetica, sans-serif;font-size:10pt">
<div><span>Hi,</span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;">(using drools-planner
5.5.0.Final)</div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><br>
<span></span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>I'm struggling with
assigning weights to IntConstraintOccurrence in a rule's
LHS.</span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>If I assign different
weights for different rules (because we think one rule is
more important than an other)</span></div>
</div>
</blockquote>
The business analysis defines the score weights, it's not our call
to make which is more important etc.<br>
One way talk to you your business people and get them to convert
their knowledge into score weights<br>
is to ask "if you had to put a price tag on everything, how much
would violating this constraint cost us?".<br>
Basically normalize everything to a price.<br>
<br>
For example: in nurse rostering, "not giving a nurse her day off
requests costs the solution 100 $".<br>
It might seem unethical to put a price tag on a nurse's happiness,
but reality does it implicitly anyway.<br>
<br>
<blockquote
cite="mid:1370506920.82531.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:arial,
helvetica, sans-serif;font-size:10pt">
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span> our end result is far
worse than when we assign all equal weights.</span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>I do not look at the
total value of hard and soft score but at the number of
violations.</span></div>
</div>
</blockquote>
That's comparing apples and oranges.<br>
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.<br>
<br>
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).<br>
<br>
<blockquote
cite="mid:1370506920.82531.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:arial,
helvetica, sans-serif;font-size:10pt">
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>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.</span></div>
</div>
</blockquote>
Yes, if and only if the more difficult constraints have higher
weights (otherwise it's the opposite).<br>
<br>
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...<br>
<blockquote
cite="mid:1370506920.82531.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:arial,
helvetica, sans-serif;font-size:10pt">
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><br>
<span></span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>But how should we then
implement importance in rules?</span></div>
</div>
</blockquote>
Define your score function as your business needs it. Use the
techniques described in the 6.0 manual: negative/postive, weights
and levels.<br>
<br>
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).<br>
<blockquote
cite="mid:1370506920.82531.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:arial,
helvetica, sans-serif;font-size:10pt">
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><br>
<span></span></div>
<div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family: arial,helvetica,sans-serif; background-color:
transparent; font-style: normal;"><span>Thanks</span></div>
<div> </div>
<div>-----------------<br>
<a class="moz-txt-link-freetext" href="http://www.codessentials.com">http://www.codessentials.com</a> - Your essential software, for
free!<br>
Follow us at <a class="moz-txt-link-freetext" href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</body>
</html>