why am i getting " Message: No method named 'hasNext' found in class jess.QueryResult."

17 Views Asked by At

new to jess. i have a problem i'm using as a learning tool. it is the process to assign available docks in our marina. the process works like this, a dock becomes available, it is compared against a list of requests. if there is a match, one or more, then a series of rules are triggered to award the dock to the winning request.

i've written a short program (see below) to start that process. when i execute it i get the following error message:

Jess, the Rule Engine for the Java Platform Copyright (C) 2008 Sandia Corporation Jess Version 7.1p2 11/5/2008

Jess reported an error in routine call while executing (call ?it hasNext) while executing (while (call ?it hasNext) (bind ?token (call ?it next)) (bind ?fact (call ?token ?fact 1)) (bind ?person (fact-slot-value ?fact name)) (printout t ?person crlf)). Message: No method named 'hasNext' found in class jess.QueryResult. Program text: ( while ( ?it hasNext ) ( bind ?token ( call ?it next ) ) ( bind ?fact ( call ?token ?fact 1 ) ) ( bind ?person ( fact-slot-value ?fact name ) ) ( printout t ?person crlf ) )
at line 32 in file C:\data\code\eclipseJessTutor\JessTutor\src\com\soundsoftware\jesstutor\defquery.clp.

(defglobal ?*curSlip* = nil)
(deftemplate bid
  (slot person)
  (slot slipRequestedID)
  (slot boatID))
(deftemplate slip
  (slot slipID)
  (slot slength)
  (slot swidth)
  (slot sdepth))
(deftemplate person
  (slot name)
  (slot bycseniority)
  (slot boatID)
  (slot currentSlip))
(deffacts bids
  (bid (person John) (slipRequestedID A13) (boatID GEM))
  (bid (person Joe) (slipRequestedID A13) (boatID FarNiente))
  (bid (person Frank) (slipRequestedID B9) (boatID DoryO)))
(deffacts freeSlips
  (slip (slipID A13)))
(defquery bidLookup
    (declare (variables ?slipID))
        (bid (slipRequestedID ?sID & :( = ?slipID))))
(bind ?collOfBids (run-query* bidLookup A13))
    <External-Address: java.util.AbstractList$Itr>
    (while (?collOfBids hasNext)
        (bind ?token (call ?collOfBids next))
        (bind ?fact (call ?token ?fact 1))
        (bind ?person (fact-slot-value ?fact name))    
        (printout t ?person crlf)    
    )

any help is appreciated,

duetto
0

There are 0 best solutions below