[rules-users] Solving Conflict Resolution on values of the facts - Help
Daniel Souza
danieldsouza15 at gmail.com
Tue Jun 12 15:00:32 EDT 2012
Hi..
Can anyone suggest me how can I solve conflict resolution on values of the
facts? It seems so simple but I have no idea in mind. The restriction is we
don't know how many facts will be inserted, it could be one fact, 3 facts or
more.
My problem is: If my application suggested me 1 or * Persons() as best
person, I have a conflict resolution and the rules to solve this conflict
should be evaluate the best properties (values) of the facts.
I don't know how to create rules to work with an amount of facts that I
can't know and after to solve conflict resolution between values.
The sample facts below show what I want to express as conflict resolution.
Supose that I have a POJO
Person():
atribute name;
atribute experience;
atribue age;
atribute sugestedPerson;
getters and setters;
end Person
*The declared rule is not explict. I can't express rule as:*
rule "best experience"
when
$person : Person ( experience > 200 )
then
$person.suggestedPerson = true;
end
or
rule "best experience"
salience 100
when
$person1 : Person ( $exp1 : experience )
$person2 : Person ( $exp2 : experience )
$person3 : Person ( $exp3 : experience )
eval( $exp1 > $exp2 && $exp1 > $exp3)
then
$person1.suggestedPerson = true;
end
My knowledge Base was Built.. and 3 Persons facts was inserted into.. (*The
problem is: - WE DON'T KNOW HOW MANY PERSONS WILL BE INSERTED IN THE
KNOWLEDGE BASE*)
Person { name = Jhon, experience = 200, age = 35, suggestedPerson = false }
Person { name = Daniel, experience = 251, age = 27, suggestedPerson = false
}
Person { name = Julia, experience = 219, age = 31, suggestedPerson = false }
Now I has 3 Persons and I want to sugest just the Person with the best
experience, or if all persons has the same experience indicate the older
person. What Can I do?
In this Case the sugested person is: /Person { name = Daniel, experience =
251, age = 27, sugestedPerson = *true* }/
If all person facts has the same experience and was inserted:
Person { name = Jhon, experience = 200, age = 35, sugestedPerson = false }
Person { name = Daniel, experience = 200, age = 27, sugestedPerson = false }
Person { name = Julia, experience = 200, age = 31, sugestedPerson = false }
In this Case the sugested person is: /Person { name = Jhon, experience =
200, age = 35, sugestedPerson = *true* }/
*A sample rule will be helpfull*
Daniel Souza - Brazil
--
View this message in context: http://drools.46999.n3.nabble.com/Solving-Conflict-Resolution-on-values-of-the-facts-Help-tp4017876.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
More information about the rules-users
mailing list