How to delete Jade agents

2.2k views Asked by At

I need to run my solution N times and in each iteration a set of agents is created but before passing to the next iteration (i+1), I need to shut down the platform or to delete all the agents so they can be created again in (i+1) iteration.

I have tried the .dodelete() and .kill() methods but it is not working I guess that I need to shutdown the whole platform each time but I don't know how to do it. Are there any methods or code I can use?

2

There are 2 answers

0
nikelyn On

You can kill and create your agents with AMS. The link to create agent, and use jade.domain.JADEAgentManagement.KillAgent to kill agent.

0
Piyush Rumao On

Try this to terminate your Agent.

protected void takeDown() {
    // Printout a dismissal message
    System.out.println("Agent-1 "+getAID().getName()+" terminating.");
}