0

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?

Draken
  • 3,134
  • 13
  • 34
  • 54

2 Answers2

0

Try this to terminate your Agent.

protected void takeDown() {
    // Printout a dismissal message
    System.out.println("Agent-1 "+getAID().getName()+" terminating.");
}
Piyush Rumao
  • 363
  • 4
  • 7
0

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

Community
  • 1
  • 1
nikelyn
  • 518
  • 3
  • 13