Op 04-02-12 15:18, aitchnyu schreef:
> As follow up, I included my domain model and an incomplete rule
>
> *Problem facts*:
> Entity:
>      weight: int
> Bucket:
>      id: int
>
> *Planning entity*:
> EntityBucketAssignment
>      entity: Entity
>      bucket: Bucket (planning variable)
>
> *The rule fragment is*:
> when
>      $b1:Bucket($id:id)
>      $minSum:Number from accumulate(
>       Entity(
>           bucket==$b1,
>           $weight:wieght
>           ),
>       sum($wieght)
>      )
then
  insertLogical BucketTotal($b1, $weight)

do the rest of the rule in a new rule based on the BucketTotal facts.

See examples nurserostering's Employee*Total class or something named 
like that.
>      not($b2:Bucket(id!=$id)
>       $minSum:Number from accumulate(
>           Entity(
>               bucket==$b2,
>               $weight:wieght
>               ),
>           sum($wieght)
>       )
>      )
> then
>      ...
>       
> Could you correct this?
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/How-to-even-out-n-buckets-in-Drools-Planner-tp3713200p3715546.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>

-- 
With kind regards,
Geoffrey De Smet


_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to