<div dir="ltr">Hi,<div style>I&#39;ve got a really simple problem that I can&#39;t seem to fix. :-)</div><div style>I&#39;m trying to use a simplified model for a room planning problem. </div><div style>The planning entity is a Topic and the planning variables are Room and TimeSlot.</div>
<div style>A Person is tied to a Topic as a moderator. </div><div style>Each Person can have multiple Topics as an interest.</div><div style><br></div><div style>The hard constraints are that a Person cannot be moderator in two Topics at the same TimeSlot and that there cannot be multiple Topics in the same Room at the same TimeSlot.</div>
<div style><br></div><div>rule &quot;conflictingModeratorInSameTimeslot&quot;</div><div>    when</div><div>        $leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot != null, $leftModerator: moderator)</div>
<div>        $rightTopic : Topic(timeSlot == $leftTimeslot, moderator == $leftModerator, id &gt; $leftId)</div><div>    then</div><div>        scoreHolder.addHardConstraintMatch(kcontext, -1);</div><div>end</div><div><br>
</div><div>rule &quot;multipleTopicsInSameRoomAndTimeslot&quot;</div><div>    when</div><div>        $leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot != null, $leftRoom: room)</div><div>        $rightTopic : Topic(timeSlot == $leftTimeslot, room == $leftRoom, id &gt; $leftId)</div>
<div>    then</div><div>        scoreHolder.addHardConstraintMatch(kcontext, -1);</div><div style>end</div><div style><br></div><div style>The soft constraint that I have a problem with is that a Person has multiple Topics as interests and I would like to penalize the Solution with the number of Topics in the Persons interests collection with the number of Topics that are allocated at the same TimeSlot.</div>
<div style><br></div><div style>Any ideas on how to go about this?</div><div style><br></div><div style>Regards,</div><div style>Mats</div><div style><br></div><div style><br></div><div style><br></div><div style><br></div>
</div>