pppoole wrote
I have a planning entity which has a "ResourceType" on it
and I am
attempting to schedule resources on the entity. The Resource is the
Planning variable and the Resource instance has a "ResourceType" on it as
well. I want to filter to make sure that a ResourceType matches between
the PlanningEntity and the PlanningVariable prior to subjecting it to
rules (since this is a hard constraint that can never be broken and want
to save on performance). For example, if my PlanningEntity calls for a
resource of type "janitor", then I shouldn't assign a Resource
(PlanningVariable) of type "teacher" to the event. In order to filter
these, I implemented a SelectionFilter class and validate that the
entity's resource type matches the planning variable's resource type and
return false if not. This is definitely returning the correct values (I
debugged this to confirm), but yet my final solution is still getting the
wrong resource types on it.
My implementation for my filter:
public boolean accept(ScoreDirector scoreDirector, PlanningEvent
selection)
{
return selection.getRequiredResourceType().getType()
.equals(selection.getResource().getResourceType().getType());
}
My configuration:
<changeMoveSelector>
<entitySelector>
<entityFilterClass>
com.lmco.mst.lss.autoscheduler.domain.move.RequiredTypeEntityFilter
</entityFilterClass>
</entitySelector>
</changeMoveSelector>
Please advise, I am kind of stuck.
Thanks!
This thread continues here:
http://stackoverflow.com/questions/15394426/drools-planner-planner-not-pr...
--
View this message in context:
http://drools.46999.n3.nabble.com/Using-EntitySelector-EntityFilterClass-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.