[rules-users] Rules for Hierarchical Type Calculation Formulas
Anstis, Michael (M.)
manstis1 at ford.com
Fri Nov 9 04:14:19 EST 2007
Are the parameters for the calculations hierarchical in your model or are
there just many components to each equation? For example:-
Rule "Total Resource"
when
$s : Student( $e : employmentEarnings, $ss : scholarships, $a : assets)
then
insert(new TotalResource($s, $e + $ss + $a);
end
Rule "Child Care Expenses"
when
$s : Student( $nc : numberOfChildren, $pca : perChildAmount)
then
insert(new ChildCareExpenses($s, $nc * $pca);
end
Rule "Total Need"
when
$s : Student( $t : tuition, $la : LivingAllowance, $cce : childCareExpenses)
ChildCareExpenses(student == $s, $cce : amount)
then
insert(new TotalNeed($s, $t + $la + $cce);
end
Rule "Total Eligible Loan Amount"
when
$s : Student($maa : maxAllowedAmount)
TotalNeed( student == $s, $n : amount)
TotalResource( student == $s, $r : amount)
then
insert(new TotalEligibleLoanAmount(Math.min($n - $r, $maa));
end
Possible? Yes. Performant? Performance depends upon many factors (number of
students, hardware, subjective definition of performant); but there have
been many postings suggesting Drools is as quick, if not quicker than other
commercial engines.
There are plenty of ways to skin an apple.
With kind regards,
Mike
_____
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Don Cameron
Sent: 08 November 2007 23:28
To: rules-users at lists.jboss.org
Subject: [rules-users] Rules for Hierarchical Type Calculation Formulas
We have been using a custom rules engine successfully for our 1000+
rules for our student loans application, but these rules are decision
based types rules (if then else).
For assessing loan amounts for our student loan application, we have
over 400+ calculation formulas plus decision logic. These formulas are
mostly simple:
TotalEligilbleLoanAmount = Min(TotalNeed - TotalResource,
MaxAllowedAmount)
TotalNeed = Tuition + LivingAllowance + ChildCareExpenses
ChildCareExpenses = NumberOfChildren * PerChildAmount
TotalResource = EmploymentEarnings + Scholarships + Assets
(however there are 400+ formulas and the hierarchy gets up to 20 deep)
Is it possible to implement something like this in Drools? Will it be
maintainable and performant?
Thanks
Don
This communication is intended for the use of the recipient to which it is
addressed, and may contain confidential, personal, and or privileged
information. Please contact us immediately if you are not the intended
recipient of this communication, and do not copy, distribute, or take action
relying on it. Any communication received in error, or subsequent reply,
should be deleted or destroyed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071109/4ecd1c1d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4159 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071109/4ecd1c1d/attachment.bin
More information about the rules-users
mailing list