In this situation, you might want to investigate the use of the logical
conditional element to link dependent objects in your game state. Taking
the example from the Jess manual on page 42, you assert that (water-flowing)
is dependent on (faucet-open). Then if you assert or retract (faucet-open)
Jess will automatically update the state to reflect the ramifications for
that (i.e., whether or not water is flowing). I think you could use this
mechanism to create and then incrementally modify your game state rather
than reasserting from scratch all the time.
From: Friedman-Hill, Ernest [mailto:ejfr...@sandia.gov]
Sent: Monday, October 10, 2011 10:15 AM
Subject: RE: JESS: Using JESS for representing game states
It is true that the Rete algorithm (on which Jess is based) is built on the
assumption that only a small fraction (usually quoted as 5-10%) of the
knowledge base will change on each evaluation cycle. Populating the network
from scratch is expensive and constantly resetting it does degrade
performance quite seriously.
On the other hand, if the whole knowledge base must be constantly
reevaluated, than no other algorithm will necessarily be any better. Rather
than searching for other tools, you might put some work into figuring out
how to preserve those parts of the KB that don't change as frequently,
rather than constantly resetting. Presumably there are stationary objects
and information about ownership and properties that don't change often.
From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On
Behalf Of Sam Sarjant
Sent: Sunday, October 09, 2011 5:49 PM
Subject: JESS: Using JESS for representing game states
I have been using JESS for some time as a rule-system for representing
states in a game (relational reinforcement learning), such that the state of
the game can be represented in terms of objects. An agent uses these states
and a decision making process (in this case defqueries to resolve rules in
conditions -> action form). Because games are very dynamic environments, the
state is constantly changing. I am currently handling this by resetting the
state and reasserting the facts of the state (then running to generate any
further facts that rules generate).
My question is: is JESS the best rule-system to use for this task? I know
JESS has the property of only generating facts once, but if the state is
constantly being reset, perhaps some other system would be more effective.
JESS certainly gets the job done, and I haven't really tested anything else,
but I am concerned with the speed of execution, but perhaps this is simply
due to the fact that I am using this relational representation.
- Thanks, Sam Sarjant