I think Barker, Brett A wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
>
> Hello,
>
> I am running into a problem with the Rete getObjects( Filter.ByClass(
> CLASS.class) ) method. I am trying to retrieve results from a Rete object
> after having called the Rete.run() method. However, the Iterator returned by
> the getObjects method is always empty and I can't figure out what I am doing
> wrong.
>
You've got both a handmade "Foo" template, and a Foo class. The
getObjects() method will return actual Java objects of a given class
that have been added to working memory using add() or definstance();
it won't return non-Java facts created with "assert". Which are you doing?
> Here is the basics of what I am doing:
>
> Rete r = new Rete();
> r.reset();
> r.batch( "myfile.clp");
> r.run();
> Iterator it = r.getObjects(new Fileter.ByClass( Foo.class ) );
>
> for( int i= 0; it.hasNext(); ++i){
> System.out.println("Foo found! " + i);
> it.next();
> }
>
> The deftemplate Foo within the "myfile.clp" is defined as:
> (deftemplate MAIN::Foo "blah"
> (slot bar (TYPE STRING))
> (multislot ms)
> (slot num (TYPE INTEGER))
> )
>
> I have also defined the Java class Foo to be
> public class Foo {
> private String bar;
> private ValueVector ms;
> private int num
>
> Foo();
> //.. getters / setters for all private members
> }
>
> My goal is to simply retrieve all facts from the Rete object of type Foo. Any
> ideas on what could be wrong or any additional information on how the
> getObjects method works would be great.
>
> Thanks,
> Brett
>
>
> --------------------------------------------------------------------
> 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
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
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]
--------------------------------------------------------------------