[rules-users] Solving Conflict Resolution on values of the facts - Help
Davide Sottara
dsotty at gmail.com
Tue Jun 12 15:31:04 EDT 2012
-- You have several options.. one is the more declarative:
$best : Person( $xp : experience )
not Person( experience > $xp )
-- Another option is to accumulate and find the highest level of experience:
accumulate( Person( $xp : experience ), $max : max ( $xp ) )
then you can match against that, either directly or inserting that value as
a fact:
$best : Person( $exp : exp >= $max )
-- which leads to a possible solution for the multi-criteria case, creating
score facts:
when
$p : Person( $xp : experience, $a: age )
then
insert( new Score( $p, /* an appropriate function of your xp and age */ )
);
end
at this point, the previous options apply to the score facts directly.
-- Of course there are other variations and possibilities
Davide
btw, are you assuming that no other Person will be insert after the best has
been chosen, right?
--
View this message in context: http://drools.46999.n3.nabble.com/Solving-Conflict-Resolution-on-values-of-the-facts-Help-tp4017876p4017877.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
More information about the rules-users
mailing list