[rules-users] Planner: Hard Constraint Prevents Moves and Swaps

Geoffrey De Smet ge0ffrey.spam at gmail.com
Fri Sep 28 05:04:14 EDT 2012


Op 27-09-12 19:28, jrvirtue schreef:
> Thank you for the advice.
>
> I've downloaded 5.5.0.Beta1 and carried out the required update steps. BTW
> the new selector system seems to be a giant leap forward.
>
> First question: Given that I want to keep certain entities together, do I
> still need to employ changeMoveSelector's? or should I only use pillars?
I usually mix both:
<unionMoveSelector>
   <changeMoveSelector/>
   <swapMoveSelector/>
   <pillarSwapMoveSelector/>
</unionMoveSelector>

Just try it out and use the benchmarker to find the best set for your 
use case.
>
> With respect to the pillarSwapMoveSelector, as in my example above, how do I
> tell it I want to base the pillar on the planningVariable timeSlots? I tried
> to add a valueSelector/planningVariableName but it doesn't work. I had a
> look at the source code and it seems that the planningVariableName section
> of the code has been commented out.
You mean you have multiple planning vars, but only want to pillarSwap to 
base on and affect 1 var (and ignore the other vars)?

The PillarSwapMoveSelectorConfig class doesn't support that yet,
but the PillarSwapMoveSelector class itself does.

Currently the PillarSwapMoveSelectorConfig always pillarSwaps around all 
vars:

     public MoveSelector buildBaseMoveSelector(EnvironmentMode 
environmentMode, SolutionDescriptor solutionDescriptor,
             SelectionCacheType minimumCacheType, SelectionOrder 
resolvedSelectionOrder) {
         ...
         Collection<PlanningVariableDescriptor> variableDescriptors = 
leftPillarSelector.getEntityDescriptor()
                 .getPlanningVariableDescriptors(); // This should be a 
singleton of just the variable you want
         return new PillarSwapMoveSelector(leftPillarSelector, 
rightPillarSelector, variableDescriptors,
                 resolvedSelectionOrder == SelectionOrder.RANDOM);
     }

That class really needs something like this:

     @XStreamImplicit(itemFieldName = "swapPlanningVariable")
     private List<String> swapPlanningVariableList = null;

so you can do
   <pillarSwapMoveSelector>
<swapPlanningVariable>timeSlot</swapPlanningVariable>
   </pillarSwapMoveSelector>

Same story for SwapMoveSelectorConfig.

Pull requests welcome :)
>
> Thanks,
> Jason
>
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-Hard-Constraint-Prevents-Moves-and-Swaps-tp4019953p4020023.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list