You could put that in a SimpleScoreCalculator and use 
<scoreDirectorFactory>'s <assertScoreDirector> to assert any DRL you write.

As for the DRL:
> for (final OrderLine planningEntity : orderSourcing.getOrderLineList()) {
when
   OrderLine(...)

> if (allocatedResource == null) {
when
   Orderline(allocatedResource ==null)
then
   // lower hardscore with 1000
...
end

> if (planningEntity.getProductId().equals(allocatedResource.getProductId())) {
> } else {
>                                       // item is not the same (use a Selector 
> instead? how?)
>                                       hardScore -= 10;
>                               }

when
   Orderline(allocatedResource !=null, 
productIdEqualsAllocationResourceProductId == false)
then
   // lower hardscore with 10
...
end

class OrderLine {
public boolean isProductIdEqualsAllocationResourceProductId() {
   return 
planningEntity.getProductId().equals(allocatedResource.getProductId())
}
}


etc for the other constraints. See the Planner examples for inspiration.

Op 28-03-13 18:15, Al Ferguson schreef:
> Here is a Java version of what a first draft scoring might look:
>
>
>
> Can someone help me for the drl equivalent? Geoffrey?
>
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Planner-drl-for-Selection-and-Decreasing-tp4022999p4023111.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to