<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<br>
<br>
Op 10-02-12 05:24, Jason Parekh schreef:
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite"><span style="">I'm new to constraint programming and
Drools Planner. I've read through the</span><br style="">
<span style="">docs and built some rules that would probably get
me to the right answer,</span><br style="">
<span style="">eventually :)</span><br style="">
<br style="">
<span style="">I was hoping to get your suggestions for better
concrete rules.</span><br style="">
</blockquote>
Sometimes it's easier to improve the domain then the rules.<br>
There is good advice around domain design in the manual:<br>
<a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-planner-docs/html_single/index.html#d0e1568">http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-planner-docs/html_single/index.html#d0e1568</a><br>
<br>
What class is your planning entity? What property(s) of that class
is your planning variable(s)?<br>
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite"><br style="">
<span style="">The problem is I need to order items in a
performance with the following</span><br style="">
<span style="">logical rules:</span><br style="">
<span style="">1) All items of the same category must appear
together.</span><br style="">
</blockquote>
What does "appear together" mean? Is this a hard constraint?<br>
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite"><span style="">2) A performer can be in multiple
items, but ideally there'd be at least</span><br style="">
<span style="">three items between any of her two items</span><br
style="">
<br style="">
<span style="">The approaches I took are:</span><br style="">
<span style="">- For (1), count the number of transitions from one
category to another.</span><br style="">
<span style="">Subtract this to the hard score.</span><br style="">
</blockquote>
Sounds good.<br>
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite">
<span style="">- For (2), three separate rules, each of which
assert that an item at</span><br style="">
<span style="">position i does not share performers with an item
at position i+1, i+2 and</span><br style="">
<span style="">i+3 (one of these per rule). The number of shared
performers would be</span><br style="">
<span style="">subtracted from the hard score.</span><br style="">
</blockquote>
Sounds good.<br>
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite"><br style="">
<span style="">The scoring and my choice for construction
heuristic (FIRST_FIT) are just</span><br style="">
<span style="">naive selections. <br>
</span></blockquote>
First fit is the best way to start :)<br>
<a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-planner-docs/html_single/index.html#d0e3179">http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-planner-docs/html_single/index.html#d0e3179</a><br>
<blockquote
cite="mid:CAO3LDj+TFegf-LFTfjWpYvxt2MTjCNbgcScHq_G-Cbk8SreM8Q@mail.gmail.com"
type="cite"><span style="">I haven't gotten to optimizing either
of these -- just</span><br style="">
<span style="">wanted to check with you guys to make sure my rules
are sane.</span><br style="">
<br style="">
<span style="">Thanks in advance,</span><br style="">
<span style="">jason</span><br style="">
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
<pre class="moz-signature" cols="72">--
With kind regards,
Geoffrey De Smet</pre>
</body>
</html>