Hello everybody,
I have written a rule which checks a value with two values and if the
value is in the range, that value is asserted as the fourth value. I do
not know the default values for all these and the fourth value.
clp file is:
;;;*************
;;;* TEMPLATES *
;;;*************
;;;
(deftemplate Platform
(slot x1 )
(slot x2 )
(slot x3 )
(slot x4)
)
(defrule EvaluateH30ValueOnPlatform ""
(Platform (x2 ?val1))
(Platform (x3 ?val2))
(Platform (x1 ?x&: (and (<= ?x ?val1)
(>= ?x ?val2))))
=>
(printout t ?x crlf)
(printout t ?val1 crlf)
(printout t ?val2 crlf)
(assert (Platform (x4 ?x)))
)
(defrule initial ""
=>
(assert (Platform (x1 50)(x2 300) (x3 30)(x4 0)))
(assert (Platform (x1 500)(x2 300)(x3 30)(x4 0)))
)
(reset)
(run)
and the exception is:
Rete Exception in routine Value::intValue while executing rule LHS:
[Node2 ntest
s=1 [Test1: test=EQ;sub_idx=-1;slot_value=(and (<= ?2,2,-1 ?0,3,-1) (>=
?2,2,-1
?1,4,-1))] ;usecount = 1;unique = false] while executing defrule
initial.
Message: Not a number: nil type = 1 at line 43: ( run ) .
at jess.Value.typeError(Value.java:299)
at jess.Value.numericValue(Value.java:181)
at jess.LtOrEq.call(Funcall.java:1337)
at jess.Funcall.simpleExecute(Funcall.java:341)
at jess.Funcall.execute(Funcall.java:301)
at jess.Funcall.execute(Funcall.java:201)
at jess.And.call(Funcall.java:1106)
at jess.Funcall.simpleExecute(Funcall.java:341)
at jess.Funcall.execute(Funcall.java:301)
at jess.Funcall.execute(Funcall.java:205)
at jess.Test1.doTest(Test1.java:106)
at jess.Node2.runTests(Node2.java:366)
at jess.Node2.runTestsVaryLeft(Node2.java:331)
at jess.Node2.runTestsVaryLeft(Node2.java:321)
This has got something to do with the data types. But I have given all
the values in my assert statement.
Can somebody help me out in solving this problem.
Thanks,
srinu
===
_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------