JESS: Retrieving a fact id

2008-08-24 Thread Borislav Bonev
Hi, I'm trying to write a function that runs a query and after that to remove or modify some of the returned facts. And I have a problem with retrieving the fact id from the query result. Is there a way to retrieve the fact id with run-query* without using the deprecated run-query? Regards,

JESS: Jess Problem

2008-08-24 Thread Hasan Khan
Hello, Sorry to bother you again, I have narrowed down my previous issue to the following: My rule is as follows: (defrule getConfigValue loads a single configuration value as a fact (declare (auto-focus true)) (need-config(pid ?pid)(system ?system)(subSystem ?subSystem)(name

JESS: functions as values and calling them

2008-08-24 Thread Hal Hildebrand
I would like to have functions contained in the slot value of a fact and then apply them. I can create and assign the function values by using (lambda ...), which seems to be what I'm looking for on that side of the equation: (deftemplate functional-fact (slot func) ) (assert

JESS: Re: functions as values and calling them

2008-08-24 Thread Hal Hildebrand
Have tried using the CallLambda Userfunction class from http://herzberg.ca.sandia.gov/jesswiki/view?LambdaCallUserFunction (load-function CallLambda) (deftemplate functional-fact (slot func) ) (bind ?f (lambda (?x) ( 1 ?x))) (assert (functional-fact (func ?f))) (defrule

JESS: Re: functions as values and calling them

2008-08-24 Thread Hal Hildebrand
So I figured out how to fix this to do what I want. Basically, the CallLambda Userfunction needs to check that the first argument is a RU.BINDING in addtion to RU.LAMBDA. This this fix, things work as I would like them to. Nice addition - and powerful, too. public class CallLambda implements

JESS: BigDecimal in jess

2008-08-24 Thread Andreas Skowron
Hello, I'm looking for help regarding variable data types in Jess. In our company's project we're using Jess to calculate with money, so floating-point calculations aren't really usable for us, because of rounding issues. Our idea was to use the BigDecimal class because it has all the features

JESS: Using count-query-results in a rule LHS

2008-08-24 Thread Jan Willem Lokin
I'd like to use a rule of the following form: (defrule rule557 (logical (is-active (name Some name)) (in-coverage (tid ?tid) (cid ?cid) (distance ?distance:( 2 (count-query-results in-coverage-nearer-query ?tid ?distance ) = (assert (tracking-actual (tid

JESS: Question about backward inferences

2008-08-24 Thread Senlin Liang
I want to compute the paths through edges using the following code: code (deftemplate edge (slot first) (slot second)) (deftemplate path(slot first) (slot second)) (defrule pathRule (or (edge (first ?first) (second ?second)) (and (edge (first ?first) (second ?mid))

JESS: GUI and defquery

2008-08-24 Thread seyed hossein
Hi,I'm trying to write a program that asks a user his telephone number in GUI, then searches a database for that phone # using defquery, and outputs some results. But when I run it I get an error as below. Jess reported an error in routine QueryResult.get while executing (call ?result getInt ca)

JESS: Jess editor eclipse plugin freeze

2008-08-24 Thread Broekstra, Jeen
Hi, I just started working with Jess (7.1p1) in Eclipse and unfortunately, like several others reported earlier, I too have the problem that Eclipse completely stops responding when I try to save the .clp file. It gives no error messages at all, it just hangs up (Windows reports that it has

JESS: book on Jess

2008-08-24 Thread mike smith
Hi, Is there a book on Jess? Thank you

JESS: October Rules Fest

2008-08-24 Thread James Owen
Greetings: Just a reminder that if you want to attend the October Rules Fest (ORF) on the 22nd - 24th of October in Dallas, you might should make your reservation now if you have not done so already. The students from the DFW area (10 major universities plus lots of colleges) will find out in

Re: JESS: functions as values and calling them

2008-08-24 Thread Peter Lin
if I understand what you're trying to do, you will need to use method cal in the test pattern like the catch is function-fact.func needs to return boolean true/false if you want to use it in the LHS. peter On Thu, Aug 14, 2008 at 11:23 AM, Hal Hildebrand [EMAIL PROTECTED] wrote: I would like

Re: JESS: Jess editor eclipse plugin freeze

2008-08-24 Thread Jason Morris
Hi Jeen, It's like Bigfoot or UFOs... we need to have some incontrovertible physical evidence like a stack trace, error message, log file entry, or something that shows what's happening. I've never found any clue -- Eclipse just hangs (as you observed) and only killing the process and

Re: JESS: functions as values and calling them

2008-08-24 Thread Jason Morris
Hi Hal, Clean up your code a bit, and I think it works fine. :-) ; hal.clp (clear) (watch all) (deftemplate functional-fact (slot func)) (defrule test-me (functional-fact (func ?function)) (test (?function 0)) = (printout t 1 0 crlf)) ; PROGRAM (reset) (assert

Re: JESS: GUI and defquery

2008-08-24 Thread Robert Kirby
The value of next on the QueryResult is not being checked. If next returns false, the message below will be seen as if next had not been called. The getInt method and other get methods could throw a JessException with a different message when called after next returns FALSE, but doesn't. Bob

Re: JESS: book on Jess

2008-08-24 Thread Jason Morris
Hi Mike, Of course! See http://www.jessrules.com/jesswiki/view?JessInAction and http://www.manning.com/friedman-hill/ I think it's out of print now, but the online version is available and it saves trees! Do check out the Jess Wiki for many topics contributed by the Jess community.