<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 22-08-13 00:01, Adam Hirsch wrote:<br>
</div>
<blockquote
cite="mid:CAJ=f-+rz8DuAQ_1CjkREJDR2+4=7SpBXj8WweAwRehaJmDek_A@mail.gmail.com"
type="cite">
<div dir="ltr">Hey, folks -- I'm trying to wrap my head around
Optaplanner by extending the nurse-rostering example (for my
wife, who's a nurse in a group that needs a rostering solution,
as it happens).
<div><br>
</div>
<div>I've got a couple of approach/philosophy questions I
haven't yet found addressed in the docs, and I'm hoping
someone could help direct me.</div>
<div>
<div>
<ul>
<li>How best to constrain a problem: Say I've got six
people to schedule and Employee A *must* work every
Tuesday night and alternate Friday nights, while the
other five people should fill in the remaining shifts as
best they can with the other soft constraints I'm
specifying. From my initial reading, I'm thinking the
best approach will be to specify an "only Tuesday and
alt Fridays" <Contract> in the scoreRules.xml
(with an accompanying DRL rule to match whether or not
the particular employee is working shifts other than
those) and then specify it as a "hard" constraint for
that particular employee. Do I have that right, or is
there some way to remove those shifts entirely from the
problem space, since we already know ahead of time how
they'll be allocated?</li>
</ul>
<ul>
<ul>
<li>A similar question would come up around Christmas,
New Years, Arbor Day, etc, to wit: if we know before
the problem ever runs which employees are supposed to
be working those, what's the recommended approach to
pre-setting an employee into those particular shifts
before trawling the solution space?</li>
</ul>
</ul>
</div>
</div>
</div>
</blockquote>
I think you can reuse "immovable planning entities" for this,
especially for the second requirement:<br>
<a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/index.html#d0e8539">http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/index.html#d0e8539</a><br>
This is of course if you're a 100% sure about specific assignments
before the planning starts.<br>
That presumes that those specific assignments are hard constraints.
As soon as your business changes it minds and they become soft
constraints instead, this way won't work (and you'll need to go your
original way).<br>
<br>
<blockquote
cite="mid:CAJ=f-+rz8DuAQ_1CjkREJDR2+4=7SpBXj8WweAwRehaJmDek_A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<ul>
<ul>
</ul>
</ul>
</div>
Apologies if these are naive questions -- I suppose I
could/should have started with one of the easier examples,
but, well, real world needs and all.</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div>
Adam</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>