Re: JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

2012-01-16 Thread Hunter McMillen
After a couple hours on the mail archive, I found the problem. When I added the defglobal to the Rete engine I used this command: *Defglobal playerIDGlobal = new Defglobal(*PLAYER_ID*, new Value(self.getID()));* *engine.addDefglobal(playerIDGlobal);* * * But this doesn't specify a type for the

JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

2012-01-11 Thread Hunter McMillen
Hi everyone, I am trying to differentiate between Objects that belong to a certain user inside two of my rules. I have a variable created from Java like this: *engine.getGlobalContext().setVariable(PLAYER_ID, new Value(player.getID());* * * And I want to use this variable in rules to determine

Re: JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

2012-01-11 Thread Friedman-Hill, Ernest
The asterisks are part of the defglobal's name. You're not comparing to the defglobal: you're binding the value in the slot to a new variable. It's not legal to negate such a constraint in its first use, as the error message said. You need to use (unit (ID ?id) (typeID ?typeID) (player

Re: JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

2012-01-11 Thread Hunter McMillen
I placed the asterisks around PLAYER_ID then still received an error when the rule fired: No such variable *PLAYER_ID* But then noticed that when I call setVariable, I name the variable PLAYER_ID not *PLAYER_ID* so I changed my statement to this:

Re: JESS: [EXTERNAL] How to negate a variable when in lhs of a rule

2012-01-11 Thread Friedman-Hill, Ernest
For everything to work right, you always have to use the asterisks (as I said, they're part of the name), and you must include a (defglobal) declaration before using the variable. Setting a global variable by hand without declaring it first produces undefined results (I.e., it'll work right