Hi,

Well, let's see. First of all, I note that the Jess 5.0 version of
Pumps stabilizes with pump rates varying between 3 and 4 on the two
machines I've tried it on: a dual-processor PII 266 running Windows
NT, JDK 1.2.2 + HotSpot 1.0.1, and a 133 MHz Pentium notebook running
Windows 95 and the same JDK. A different JDK, or an even slower
machine, could indeed possibly prevent the example from working, I'm
sure. This is because while the pumps and tanks run in "real time"
(driven by separate Threads performing periodic (wall-clock-based)
tasks), the Jess rules will only fire as fast as the machine will
go. Since there are five threads, too, the Thread scheduling algorithm
in use by the JVM will also make a big difference.

Anyhow, as far as the realtime control algorithm being used, it is
admittedly a lousy one - I've definitely never claimed to be an
engineer. Realtime control is an entire college semester course, not
something some fellow like me makes up on the spot (as this example
originally was!)

I know that one elegant solution to this kind of control problem is to
use fuzzy logic. Of course, you can therefore use Bob Orchard's Fuzzy
Jess toolkit - see
http://www.iit.nrc.ca/IR_public/fuzzy/fuzzyJavaToolkit.html . The
standard FuzzyJess example is a fuzzy control algorithm, so have a
look. 

I think Rudolph George-P27574 wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Ernest,
> 
> When I run the latest Pumps example, it cranks the pump up then down hard,
> then
> overfills the tank, which explodes.  Apparently, increments of 5 units is
> too much for
> the tank to handle.
> I the modified the test to the condition of the rule "lower-rate-if-high"  (
> line 55 of pumps-from-java.clp) : (test (>= ?flow-rate 5)).
> This will set the flow rate to 0 if 5 is still too high, effectively
> shutting off the
> pump until the tank is low.   This keeps the tank from exploding.
> 
> Note:
> The solution above "works", in  that the tank will now not explode.
> However, the pump is throttled up and down so hard that the tank and pump
> never
> approximate any kind of smooth equilibrium.
> Recognizing that a true smooth equilibrium would require calculus, and that
> an
> approximation is sufficient in this particular case, and that this is, after
> all, only an example,:
> 
> How would you adjust this example to smooth out the pump's flow rate, given
> that the 
> tank, pump and main threads all run as fast as they currently do?
> I'm curious.
> 
> Thanks.
> 
> ----------
> George Rudolph
> Mad Scientist
> Motorola SSG
> ----------
> 
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------

Reply via email to