RE: [jade-develop] Registration gets blocked ! how to solve it ?


Subject: RE: [jade-develop] Registration gets blocked ! how to solve it ?
From: Caire Giovanni (Giovanni.Caire@TILAB.COM)
Date: Mon Jan 06 2003 - 11:01:51 MET


Hi,
 
The agent name is assigned at agent creation time and MUST NOT be changed (as you do in the setup method)
The fact that your agent gets stuck comes from that.
 
Bye
 
Giovanni
-----Original Message-----
From: David [mailto:amdawong@starhub.net.sg]
Sent: sabato 28 dicembre 2002 10.04
To: JADE
Subject: [jade-develop] Registration gets blocked ! how to solve it ?

Hi guys,
 
I understand the registration of the agent with the DF will be blocked if it is not successful. The programming guide offers
A solution to programmer by using the addBehaviour(DFService.getNonBlockingBehaviour() to add a non blocking behaviour to the
Registration with DF. When I execute the program, Only "A" is printed out. That is , the program hangs at (below in bold too)
 
addBehaviour(DFService.getNonBlockingBehaviour(this, "actionName"));
 
Why is this so ?
 
Please advise. I had formerly tried to get the agents I launched to registered with a DF, they all hanged.. and so I am trying to use the non
Blocking method. However, this still doesn't solve the problem that is, I still cannot get my agents to register with the DF.
 
Please help ! Thanks... I have been stuck at this problem for some time.
 
Regards
David
 
 
 
public class PowerSystemManager extends Agent
{
    public static String psmAgentName = "Power System Manager";
 
    public void setup()
    {
        PowerSystemState powerSystemState = new PowerSystemState();
        (this.getAID()).setLocalName(psmAgentName);
        System.out.println(this.getAID().getLocalName() + " Agent created on the platform");
 
        Behaviour registerPowerSystemManagement = new RegisterPowerSystemManagerBehaviour(this);
        Behaviour psm = new PowerSystemManagementBehaviour(this,powerSystemState);
 
        try{
        System.out.println("A");
        addBehaviour(DFService.getNonBlockingBehaviour(this, "actionName"));
        System.out.println("B");
        addBehaviour(registerPowerSystemManagement);
        System.out.println("C");
        addBehaviour(psm);
        }catch (jade.domain.FIPAException e){}
 
    } // end setup()

Hi,
 
The agent name is assigned at agent creation time and MUST NOT be changed (as you do in the setup method) 
The fact that your agent gets stuck comes from that.
 
Bye
 
Giovanni
-----Original Message-----
From: David [mailto:amdawong@starhub.net.sg]
Sent: sabato 28 dicembre 2002 10.04
To: JADE
Subject: [jade-develop] Registration gets blocked ! how to solve it ?

Hi guys,

 

I understand the registration of the agent with the DF will be blocked if it is not successful. The programming guide offers

A solution to programmer by using the addBehaviour(DFService.getNonBlockingBehaviour() to add a non blocking behaviour to the

Registration with DF. When I execute the program, Only “A” is printed out. That is , the program hangs at (below in bold too)

 

addBehaviour(DFService.getNonBlockingBehaviour(this, "actionName"));

 

Why is this so ?

 

Please advise. I had formerly tried to get the agents I launched to registered with a DF, they all hanged.. and so I am trying to use the non

Blocking method. However, this still doesn’t solve the problem that is, I still cannot get my agents to register with the DF.

 

Please help ! Thanks…  I have been stuck at this problem for some time.

 

Regards

David

 

 

 

public class PowerSystemManager extends Agent

{

    public static String psmAgentName = "Power System Manager";

 

    public void setup()

    {

        PowerSystemState powerSystemState = new PowerSystemState();

        (this.getAID()).setLocalName(psmAgentName);

        System.out.println(this.getAID().getLocalName() + " Agent created on the platform");

 

        Behaviour registerPowerSystemManagement = new RegisterPowerSystemManagerBehaviour(this);

        Behaviour psm = new PowerSystemManagementBehaviour(this,powerSystemState);

 

        try{

        System.out.println("A");

        addBehaviour(DFService.getNonBlockingBehaviour(this, "actionName"));

        System.out.println("B");

        addBehaviour(registerPowerSystemManagement);

        System.out.println("C");

        addBehaviour(psm);

        }catch (jade.domain.FIPAException e){}

 

    } // end setup()



This archive was generated by hypermail 2a22 : Mon Jan 06 2003 - 11:02:09 MET