Op 11-02-13 21:24, fdauffy schreef:
Hello
Thanks for your quick answer.
In fact, I realise that the ShiftDate class doesn't contain directly a date
field, only a dayindex or the date as string.
If I want to use your solution, I guess I will have to implement either a
date or a time field in order to be able to add hours as you suggest.
In the
nurseRostering example, there's a shiftIndex, which is uniqueness
over shiftTypeIndex and shiftDateIndex.
But it doesn't accurately depict time indeed.
In the nurseRostering example, there's also shiftDateIndex together with
shiftType.startTimeString, but the latter is just a String because there
was no need to parse it.
So yes, to go the time way, you'll need to alter the domain :)
I continue to work on the subject and I have another question: do you
think
I should continue on the way you indicated and do the modification in order
to be able to do some time comparison between shifts, or go in another
direction with the unwanted pattern (I just discover that this afternoon).
If I understand well, with the unwanted pattern, I should be able to avoid
some group of consecutive shifts like late shift followed by early shift..
This solution looks easier to me but less nice (code to update if new
shifts,...).
Sounds less nice indeed.
Talk to your business: let them figure out what they want.
The time way seems most business simple, I could imagine a contract
stating "at least 8 hours rest after a shift".
But maybe they're ok with have an early-shift(6-14) followed by a
demi-late-shift (18-22), even though there are only 4 hours in between,
so the shift patterns do matter.
Your score function should be what your business wants it to be. But it
takes a few iterations before they accurately know want they want :)
You really did a great job with Drools Planner!!
Frédéric
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-Planner-contraint-for-rest-time-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users