I am doing a sample project with FuzzyJess. To start, I must be able to drive a robot avoiding obstacles. I have a bunch of rules like these:
(defrule avoid-obstacle-left
(ProximitySensors
(left ?left & :(fuzzy-match ?left "near"))
(right ?right & :(fuzzy-match ?right "far" ))
(front ?front & :(fuzzy-match ?front "far" ))
)
=>
(assert
(Steer (orientation "right"))
)
)
(defrule avoid-obstacle-front
(ProximitySensors
(left ?left & :(fuzzy-match ?left "far" ))
(right ?right & :(fuzzy-match ?right "far" ))
(front ?front & :(fuzzy-match ?front "near"))
)
=>
(assert
(Steer (orientation "left"))
)
)
In the FuzzyJess documentation it is written: "Secondly, if there are many rules that affect the same output variable (this is common in many applications), then it is often useful to merge the output variable of all of these rules into a single one. This is know as global contribution. A common strategy is to perform the union of all of the results from all of the rules using a fuzzy union. Then after all of the rules have fired we have the global effect of the contribution of each rule to an answer. The result is often then deffuzzified to provide a crisp value to feed back to the system being controlled. The fuzzy shower problem is an example of this complete process. Note here that in the FuzzyJess extensions this global contribution is done for the user automatically as part of the rule's execution."
There I would expect the following rule:
(defrule use-steer
?ref <- (Steer ?steerValue)
=>
(retract ?ref)
(?*robot* steer ?steerValue)
)
to fire only once, where ?steerValue is the fuzzy union of the fuzzy cuts generated by rules antecedents. Instead, it fires once for every Steer fact and no global contribution seems to be applied.