RE: JESS: Help on Jess under the hood! :) ..

2003-11-26 Thread James Owen








Not to be a nit-picker, but the Ph.D. dissertation was 1979. The 1982 reference is a four-pager in AI
magazine that had, basically, the same title.
Since then, to my knowledge, Dr. Forgy has not published anything on the
subject of the Rete algorithm.





SDG

jco







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Dusan Sormaz
Sent: Wednesday, November 05, 2003 6:40 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Help on Jess
under the hood! :) ..



Mechanism for saving patterns and matchings is rete network.
Done by Charels Forgy in his dissertation (1982-3).
Good explanation in JIA book, chapter 8.

Dusan Sormaz

At 05:56 PM 11/5/2003 -0600, you wrote:




Hi everybody ...

Let assume the following rule base rb, function save, and working
memory wm:

rb = {
 (defrule r1
 (foo ?x ?y)
 (bar ?y ?z)
 =
 (save ?x ?y ?z))
}

wm = {(foo p q), (bar q w), (bar q t)}.

Now, it is easy to see that the first and second facts in wm, (foo p q)
(bar q w), filter all the way down to the bottom of the rete network,
associated to this example, and then become a new activation record. In other
words when rule r1 fires, then the tuple {p,q,w} is going to be saved. Right
... based on the current example:

Q1. What kind of data structure Jess uses for partially storing the facts
(foo p q) (bar q w) activating r1?
Q2. Given that the facts (foo p q) (bar q t) activate r1 as well,
which Jess' method (class) is in charge of iterating over the working
memory for finding more facts, like (bar q t), that activate r1 as well?
Q3. How, tecnically speaking, Jess manages for not testing again facts
which were already used for activating a rule?

Q4. By looking at this example one can see that the fact (foo p q) is in some
sense partially kept in Jess' mind in order to test facts like (bar q w)
and (bar q t) which can activate rule r1. Therefore my question is which
strategy, tecnically speaking, is implemented in Jess for partially keeping in
mind facts such as (foo p q) in order to test complementary facts such as (bar
q w), (bar q t) that could potencially activate a given rule?

Finally, regarding Q4 I know that the overall proccess can be explained via a
forward chaining. Nevertheless, how Jess under the hood deals with this issues?

thank you
Jose Antonio


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]


***
* Duan ormaz, PhD, Associate
Professor

* Ohio University
* Industrial and Manufacturing Systems Engineering Department
* 277 Stocker Center, Athens, OH 45701-2979
* phone: (740) 593-1545 
* fax: (740) 593-0778 
* e-mail: [EMAIL PROTECTED] 
* url: http://www.ent.ohiou.edu/~sormaz

***









RE: JESS: Question on the Fuzzy control using Jess

2003-11-26 Thread David
Hi there,

Many thanks for your pointers. 
I am now looking more closely at the Fuzzy controller because it gives
very good results as compared to the Boolean logic.

To make the simulation more realistic, I tested the simulation with a
varying outdoor temperature. That is, I allow the outdoor temperature to
vary from 73F to 90F at different times of the day (i.e. different time
on a 4000 time step simulation setting). 

The original simulation setting as suggested by the book works perfectly
well with a constant outdoor temperature 90F. Very low errors and the
room temp follows the set point with high accuracy. Impressive! 

When I ran the simulation under varied outdoor settings, I notice the
fuzzy controller have difficulty keeping the temperature close to the
set point when the outdoor temperature is around 73-76F. It seems to me
that the fuzzy controller is not able to follow the set point
temperature well when the outdoor temperature is near to the set point
temperature. 

I wonder if I have done something wrong to the fuzzy simulator, which
caused it not to work as well it should have.

I hope you can shed some light on it. 

P/S: simulation is ran for 4000 time steps, Thread.sleep(1000); 
 

Regards
David


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 6:41 AM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Question on the Fuzzy control using Jess


It's great to be curious, and the examples in the book are intended to
be realistic examples. The control rules for the HVAC application  --
especially the fuzzy version -- would work great in real applications.

But if you're serious about developing and testing this kind of
application yourself, the first thing you'll want to do is make the
simulator that the rules work against more realistic. The simulator in
the book works fine, but it's designed to make watching the controller
more interesting, not necessarily to be a realistic simulation of a
building. For example, the rate at which heat is lost to the outside
is astronomical. There's no insulation at all in the imaginary
building, and all the windows are open! Change the cooling constants
to more realistic values -- some actual engineering calculations may
be needed here -- so that the rate of temperature change is comparable
to what would be observed in a real building. This is the main reason
why the heat pumps run all the time. 

Second, the simulator, for the sake of simplicity, uses only one array
of temperatures to represent the floors. But any sort of decent
finite-event simulator should use two arrays, one to represent the
temperature at the current time step, and one for the next time step;
the next calculation should be based on the current temps. But in
the simulator in the book, there's only one array, and as a result,
there's a strong, artificial heat rises effect which adds more heat
than there should be to the upper floors.

Third, as Bob Orchard has pointed out to me, if you've got one heat
pump servicing three floors and you close the vent to one floor, the
other two floors get 1.5x as much heat flux. This effect isn't
accounted for in the simple simulator in the book, meaning that much
of the output of the heat pumps are wasted.


I think David wrote:
 Hi guys,
  
 I understand this area has been posted a few times. I am following the
 materials in the book (JIA) especially the example on HVAC and always
 have the urge to test and run the simulations myself. 
  
 When I run the fuzzy version of the HVAC controller in the book, I
 realize the heat pump is on most of the time. A plot of the graph
 reveals that the pump is in operation 99.8% of the time. On the other
 hand, the Boolean logic version of the controller is in operation
about
 90%. 
  
 I understand the algorithms implemented are not meant to be optimal as
 this is not a book on control engineering. 
 However, based on the two observations I have two questions.
  
 1.Am I doing the right thing ? Is the Fuzzy version of the
 controller suppose to be in operation close to 99.8% of the time?
 2.I wonder if there is a way to make the fuzzy version to be
 actually more energy efficient (i.e. operation times to be lower than
 the Boolean version, yet without switching the pump from OFF mode to
 operation mode too frequently)? I read in some books and websites that
 fuzzy logic sometimes do help to cut energy cost. Any ideas how this
can
 be done ?
  
  
 I wonder if anyone has tweak around with the example in the book
before.
 Would appreciate any comments and ideas. Many thanks!!
  
 Regards, 
 David
  



-
Ernest Friedman-Hill  
Science and Engineering PSEsPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


RE: JESS: Question on the Fuzzy control using Jess

2003-11-26 Thread Orchard, Bob
I'll be happy to answer some questions about this but it may not be 
for a day or two ... some other pressing things at the moment.

But as a quick note, Ernest is correct about the simulation being 
limited in it's accuracy. But it is good for a simple demonstration
like this. There are a lot of simplifications and they impact on the
way things work.

The goal of the controller was to keep the temp close to the
setpoint and it does this reasonably well. In some instances
it could do much better and turn off the heat pump. But at
90 degrees it perhaps makes sense for it to continue to run if
maintaining the setpoint is the most important thing.

I haven't looked to see why it might not control
well in the 73-76 range. I'll take a look.

Bob.

Bob Orchard
National Research Council CanadaConseil national de recherches
Canada
Institute for Information TechnologyInstitut de technologie de
l'information
1200 Montreal Road, Building M-50   M50, 1200 chemin Montrial
Ottawa, ON, Canada K1A 0R6  Ottawa (Ontario) Canada K1A 0R6

(613) 993-8557 
(613) 952-0215 Fax / tilicopieur

[EMAIL PROTECTED] 

Government of Canada | Gouvernement du Canada




-Original Message-
From: David [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 2:40 PM
To: [EMAIL PROTECTED]
Subject: RE: JESS: Question on the Fuzzy control using Jess


Hi there,

Many thanks for your pointers. 
I am now looking more closely at the Fuzzy controller because it gives
very good results as compared to the Boolean logic.

To make the simulation more realistic, I tested the simulation with a
varying outdoor temperature. That is, I allow the outdoor temperature to
vary from 73F to 90F at different times of the day (i.e. different time
on a 4000 time step simulation setting). 

The original simulation setting as suggested by the book works perfectly
well with a constant outdoor temperature 90F. Very low errors and the
room temp follows the set point with high accuracy. Impressive! 

When I ran the simulation under varied outdoor settings, I notice the
fuzzy controller have difficulty keeping the temperature close to the
set point when the outdoor temperature is around 73-76F. It seems to me
that the fuzzy controller is not able to follow the set point
temperature well when the outdoor temperature is near to the set point
temperature. 

I wonder if I have done something wrong to the fuzzy simulator, which
caused it not to work as well it should have.

I hope you can shed some light on it. 

P/S: simulation is ran for 4000 time steps, Thread.sleep(1000); 
 

Regards
David


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 6:41 AM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Question on the Fuzzy control using Jess


It's great to be curious, and the examples in the book are intended to
be realistic examples. The control rules for the HVAC application  --
especially the fuzzy version -- would work great in real applications.

But if you're serious about developing and testing this kind of
application yourself, the first thing you'll want to do is make the
simulator that the rules work against more realistic. The simulator in
the book works fine, but it's designed to make watching the controller
more interesting, not necessarily to be a realistic simulation of a
building. For example, the rate at which heat is lost to the outside
is astronomical. There's no insulation at all in the imaginary
building, and all the windows are open! Change the cooling constants
to more realistic values -- some actual engineering calculations may
be needed here -- so that the rate of temperature change is comparable
to what would be observed in a real building. This is the main reason
why the heat pumps run all the time. 

Second, the simulator, for the sake of simplicity, uses only one array
of temperatures to represent the floors. But any sort of decent
finite-event simulator should use two arrays, one to represent the
temperature at the current time step, and one for the next time step;
the next calculation should be based on the current temps. But in
the simulator in the book, there's only one array, and as a result,
there's a strong, artificial heat rises effect which adds more heat
than there should be to the upper floors.

Third, as Bob Orchard has pointed out to me, if you've got one heat
pump servicing three floors and you close the vent to one floor, the
other two floors get 1.5x as much heat flux. This effect isn't
accounted for in the simple simulator in the book, meaning that much
of the output of the heat pumps are wasted.


I think David wrote:
 Hi guys,
  
 I understand this area has been posted a few times. I am following the
 materials in the book (JIA) especially the example on HVAC and always
 have the urge to test and run the simulations myself. 
  
 When I run the fuzzy version of the HVAC controller in the book, I
 realize the heat