Hello,
Thanks for the help. But, i'm using a slightly different way. Instead of
implement fire property change listener for all the attributes of Car,
i'm using a field called update, that informs jess when the Car object
changes over the java part. The idea is that whenever i change from java
a property from car, this update slot will change, and this change will
be seen by jess. What i do then, is that i have a rule, that update the
object Car, when the slot update is changed, like:
(defrule update-car
(Car (update ?up) (OBJECT ?car))
=>
(update ?car))
And when this rule fire, i see the shadow fact Car, updated. But still i
have a problem. It seems that my rules implemented with logical don't
work very well with these updates from Car. Moreover, i have rules that
check if a car is inside a determined area, and what i see, is that even
if the Car goes away from this area, my rules still say that the car is
inside the area. Can anyone explain me, what is going on here? What
actually update does? Do it removes the old Car shadow fact and asserts
the new one, corresponding to the update? And if so, the old Car shadow
facts are really removed or somehow they are still in the working memory?
Best regards,
Joao
On 09-01-2009 17:25, Ernest Friedman-Hill wrote:
If the Car objects are getting new Position objects, but you're not
seeing that in working memory, then something is wrong with your
change event notification.
But if you're simply changing the properties of a Position object, and
you want those changes to be reflected in working memory, then yes,
you need to add the objects to working memory, and furthermore,
matches to the properties of the Position's properties must be done in
patterns that match the Position objects. I.e., you can't do this:
(Car (position ?p&:(> ?p.x 10)))
You must do
(Car (position ?p))
(Position (OBJECT ?p) {x > 10})
On Jan 9, 2009, at 7:32 AM, Joao Antunes Mourao wrote:
Hello,
I have two classes defined, in which the second class is an attribute of
the first class. Like the class Car, has an attribute that comes from
the Class Position.
The class Car is a JessBean, using the property listener to respond to
updates. So the idea is that i insert a Car in the working memory, and
if the object changes from Java, Jess will see the changes.
Now, what is happening in my case, is that when i change the position of
the object Car (from Java), Jess still see the old position. It seems
that the position is never updated in Jess. Do I need to define the
class Position as a JessBean too? And if so, do i need to insert
directly to the working memory? Because the Position is already inside
the Car.
Regards,
Joao
----------------------------
unclassified message
------------------------------------------------------------------------------------------------------------
Disclaimer:
If you are not the intended recipient of this email, please notify
the sender and delete it.
Any unauthorized copying, disclosure or distribution of this email or
its attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused
by this email or its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the
Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------
<joao.mourao.vcf>
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012 [email protected]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
in the BODY of a message to [email protected], NOT to the list
(use your own address!) List problems? Notify
[email protected].
--------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Disclaimer:
If you are not the intended recipient of this email, please notify the sender and delete it.
Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------
begin:vcard
fn;quoted-printable:Jo=C3=A3o Mour=C3=A3o
n;quoted-printable;quoted-printable:Mour=C3=A3o;Jo=C3=A3o
org:Thales;Above Water Systems
adr:;;;Hengelo;;;Netherlands
email;internet:[email protected]
title:THALES NETHERLANDS B.V.
tel;work:2640
note:-unclassified mail-
version:2.1
end:vcard