hello,

i have 10 clips for my 10 agents in my game. and every agent have some 
attribute's like known or unknown, moved or not moved etc...   anyways  the 
problem is  i wrote a test class in java that run Jess and the clips and it 
worked fine.  but know i have some "if's" in 1 of my game class. like  
if (agent = moved) {  
r.executeCommand("(assert (i-have-moved))");  }

but this dont work.  

r =  a public static Rete.  

and another if is like    if (agent = known)  { 
r.executeCommand("(assert (my-rank-revealed))");  }

and then i want to run everything.    but i keep getting Nullpointer expection. 
and i think becouse i am trying to r.executeCommand to Jess b4 running 

r.executeCommand("(batch jess/scriptlib.clp)");
r.executeCommand("(batch agents/miner.clp)");

and another quastion is : 

i made the Test class like i mentioned

is it possible to   do like this in a another classes:

agents.Test.r.executeCommand("(batch agents/miner.clp)");  <<<  im trying to 
add a value here but is that possible?  


here is my test class

/*
 * Test.java
 *
 * Created on 13 mei 2004, 13:52
 */

package agents;

/**
 *
 * @author  KiMos
 */
import jess.*;

public class Test {

    private Rete r;

    public Test() {
        r=new Rete();
        try {
            dotest();
        }
        catch(JessException e) {
            e.printStackTrace();
        }
    }

    public void dotest() throws JessException {
        //the ``facts'' command is in the script library
        r.executeCommand("(batch jess/scriptlib.clp)");
        r.executeCommand("(batch agents/miner.clp)");
        r.executeCommand("(reset)");
        r.store("SCORES", new Scores());
        r.executeCommand("(bind ?s (fetch SCORES))");
         r.executeCommand("(assert (i-have-moved))");
         r.executeCommand("(assert (enemy-bomb east))");
        r.executeCommand("(run)");
        r.executeCommand("(facts)");
         print();
    }

    public void print() throws JessException {
        System.out.print("Score for staying: ");
        r.executeCommand("(printout t (call ?s getCenter) crlf)");

        System.out.print("Score for moving forward: ");
        r.executeCommand("(printout t (call ?s getForward) crlf)");

        System.out.print("Score for moving left: ");
        r.executeCommand("(printout t (call ?s getLeft) crlf)");

        System.out.print("Score for moving backward: ");
        r.executeCommand("(printout t (call ?s getBackward) crlf)");

        System.out.print("Score for moving right: ");
        r.executeCommand("(printout t (call ?s getRight) crlf)");
    }

    public static void main(String[] unused) {
        Test t=new Test();
    }

}// Test



i am very sorry for the bad english and i hope someone understands what i want

thanks 

Kimos

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to