In your setup() method, do something like
Rete engine = new Rete();
try {
engine.store("AGENT", this);
engine.batch("ex.clp");
Value v = engine.executeCommand("(assert(ACLMessage(contenu A)))");
engine.executeCommand("(run)");
...
Then in Jess code, you can get access to the "Test1" object by calling
(fetch "AGENT")
And call Java methods on that object as needed. I'm afraid I can't help
any more than that, since you haven't told us anything about what
"activating a behavior" might entail.
On 7/11/12 7:36 AM, "lyes" <[email protected]> wrote:
>Hello,
>
>I wish activate a behavior of agent from jess.
>
>Exemple :
>
>My class Agent
>--------------
>public class Test1 extends Agent{
>
> protected void setup() {
>
> System.out.println ("Agent " + getLocalName()+ " I am here
>");
>
> Rete engine = new Rete();
> try {
> engine.batch("ex.clp");
> Value v =
> engine.executeCommand("(assert(ACLMessage(contenu A)))");
> engine.executeCommand("(run)");
>
> } catch (JessException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
>
> public class MyAction extends OneShotBehaviour {
>
> @Override
> public void action() {
>
> // TODO Auto-generated method stub
>
> System.out.println ("Agent " +
>getLocalName()+
>" I am here ");
>
> }
>
> }
>}
>
>My file ex.clp
>--------------
>(deftemplate ACLMessage (slot contenu))
>(defrule test (ACLMessage (contenu A)) => [// i wish activate behaviour
>MyAction Defined in Agent java for excute instructions//])
>
>Please Help me.
>Thank's
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp46
>54077.html
>Sent from the Jess mailing list archive at Nabble.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].
>--------------------------------------------------------------------
--------------------------------------------------------------------
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].
--------------------------------------------------------------------