, GA,
NV, TN, CA, OK, OH, WY, FM, FL, SD, SC, CT, WV, DC, WI, KY, KS, OR, LA,
GU, WA, CO, PA]
Regards,
Win Carus
On 09/18/2010 09:24 AM, Donald Winston wrote:
Why doesn't this work?
(defglobal ?*usps-state-codes* = (progn
(bind ?hash-set (new java.util.HashSet 59))
(call ?hash-set add
Try the following instead:
(deftemplate t (slot a) (slot b) (slot c) (slot d))
(assert (t (a 5) (b 4) (c 3) (d 2)))
(defrule rl
(t (a ?a) (b ?b) (c ?c) (d ?d))
(test ( ?a ?b))
(test (or ( ?b ?d) ( ?c ?d)))
=
(printout t test crlf)
)
(run)
test
1
There are, of course, other
Hello Khalid.
There is an
extensive entry on date handling in Jess and Java (with many working
functions) in the Jess Wiki by contributor George Williamson:
http://www.jessrules.com/jesswiki/view?WorkingWithDates
Regards,
Win
Hai There,
I am having difficult
time to use Calendar Class from
Hi Chirag.
You might consider using the much richer and more flexible (format)
function with a nil router instead of (str-cat).
If ?predicate, ?subject, and ?object are all strings:
(retract-string
(format nil (triple (predicate \%s\) (subject \%s\) (object
\%s\)) ?predicate ?subject
mod)
(defrule bad-rule
(b)
=
(printout t BAD!!! crlf))
(watch all)
(reset) ;; added by Win Carus
(assert (a))
(facts *) ;; added by Win Carus
(run)
(retract 1) ;; (retract (b))
(run)
(facts *) ;; added by Win Carus
(retract 0) ;; (retract (a))
(focus mod)
(run)
(facts *)
Regards,
Win
begin:vcard
(a))
(not (b))
=
(assert (b)))
(defmodule mod)
(defrule bad-rule
(b)
=
(printout t BAD!!! crlf))
(watch all)
(reset) ;; added by Win Carus
(assert (a))
(facts *) ;; added by Win Carus
(run)
(retract 1) ;; (retract (b))
(run)
(facts *) ;; added by Win Carus
(retract 0) ;; (retract (a))
(focus mod)
(run
Hi Eithon.
Take a look at the logical conditional element in the Jess on-line manual:
The logical conditional element lets you specify /logical dependencies/
among facts. All the facts asserted on the RHS of a rule become
dependent on the matches to the logicalpatterns on that rule's LHS. If
Hi Michal.
This is really a basic Java programming question, I think. Using Java,
you can iterate over the elements of the first ArrayList to ensure they
are contained in the second ArrayList. Assume that the first list is
contained in the second and seek evidence to the contrary:
boolean
Hi Zafer.
Regular expression matching uses the java.util.regex match
functionality (The |matches|
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html#matches%28%29
method attempts to match the entire input sequence against the
pattern.). So, if you want to match an embedded
[EMAIL PROTECTED] wrote:
I think Mihai Barbuceanu wrote:
And for multislot binding would you allow $/[a-z]*/, meaning each value in
the set has to match the regex?
E.g. (animal (legs $/[a-z]*/)) or (animal (legs ?leg1 ?leg2 $/[a-z]*/)).
Mihai
Hey, that's a cool idea! Do people agree?
Hi Ernest and Mitch.
I made one small mistake in the test. The test should have been for =
instead of . This does not materially affect performance (it's still
just as fast), but some missing answers are now generated.
(defrule find-solution
(coin (denomination penny) (count ?cp) (amount ?ap))
: Monday, August 11, 2003 1:20 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Newbie question (Coin puzzle-SOLVED)
I think Win Carus wrote:
Ernest's approach reduces matching time substantially and does make it
possible in a realistic time to compute the $2.00 change combinations
using a version
Ernest's approach reduces matching time substantially and does make it
possible in a realistic time to compute the $2.00 change combinations
using a version of your script modified as he suggest.
However ... the generate-and-test approach is still very
memory-intensive and a still-better
Hi Ernest and Mitch.
Not to be outdone ...
An even greater performance boost can be achieved not only by Ernest's
reordering-the-tests + pennies-are-0-modulo-5-test approach, but also by
adding summation at each denomination:
(defrule find-solution
(coin (denomination penny) (count ?cp)
Hi Ernest.
For Jess 7.0 I would vote in favor of a well-written Eclipse plug-in and
more attention given to core engine features (e.g., performance and new
functionality). Since you are uniquely positioned to add the
Jess-specific functionality, I would strongly vote in favor of focussing
on
the
zebra.clp example supplied by the Jess distribution (which is taken,
in turn,
directly from the Giarratano and Riley's Expert Systems: Principles and
Programming).
Regards,
Win Carus
Dear Jessers,
I am a newbie to Jess. I would like to solve the following riddle using
Jess. I have previously
Hello Dukle.
I believe that you've misinterpreted the Jess documentation. There are
three string-number conversion function in Jess (float, integer, and
long). They work by calling the type-X-specific parseX method:
(float 25) is equivalent to (call Float parseFloat 25)
(integer 25) is
[EMAIL PROTECTED] wrote:
Hi Folks,
A few quick announcements. First, the first release candidate for Jess
6.1 will come out on Monday, barring any unforeseen problems. If
you've got any 6.1 prerelease bug reports, please let me know now!
Secondly, I tried using html2ps from
Hi Ernest.
This is great news about your book!
Some things you might consider:
FAQ. Newbies on the jess-users list seems to have some rather common
themes (esp. related to installation, Java, rule writing, performance,
missing features, and so forth) that might be gathered in a single place
19 matches
Mail list logo