All,Take a look at pillarSwapMove.
I have a problem where I need to assign tasks:1.) Times2.) Resources based on a Resource Type
I've used the nurse rostering problem as an example and come up with a planning entity ResourceAssignment that looks like:
Facts:TaskResourceType
Variables:TimeResource
For example:1.) Lets say there are two resource types Type1 & Type22.) A pool of resources: Resource1(type1), Resource2(type1), Resource3(type1), Resource4(type2), Resource4(type2), Resource5(type2) ...3.) Task A: that requires 1 resource of type1 and one resource of type2
My program creates two PlanningEntitiesResourceAssignment1Fact:Task=AResourceType=1VariablesTimeResource
ResourceAssignment2Fact:Task=AResourceType=2Variables:TimeResource
I've created a rule that is designed to keep tasks starting at the same time://tasks need to be in the same timeSlot
rule "taskInTimeSlot"
when
$ra1 : ResourceAssignment ( task != null, time != null, $id : id, $task : task, $time : time)
$ra2 : ResourceAssignment ( task != null, timeSlot != null, id != $id, task == $task, time != $time )
then
insertLogical(new IntConstraintOccurrence("taskInTimeSlot", ConstraintType.NEGATIVE_HARD,
1,$ra1, $ra2));
end
*PROBLEM*
This results in: Cancelled step index (7), time spend (2848): there is no doable move. Terminating phase early.
If I change the constraint to a NEGATIVE_SOFT the problem is solved, but it doesn't scale. Any more that a few tasks and it doesn't seem to be able to find solutions.
What I need is for swaps and moves to change the time on multiple ResourceAssignments together.
A custom MoveListFactory gives you full control, so that will give you even more flexiblity, at the cost of more implementation work.
Am I going about the problem the right way? Do I need something other than the generic move/swap factories?
Thanks in advance,
Jason
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users