Thanks John!

After some thought and a limited number of tests, I have decided to use a similar approach to yours (I have found the true dynamic agent creation seems to be slow and the operation of the agent creations affects the other agents quite a bit. ) . What I have done is to use two data collections to hold agents. At start, I produce more than enough agents and put them in the “outside collection” and when I need to “create” agents, instead of creating them on the fly, I just move the agent from “outside collection” to the “inside collection” and when an inside agent needs to be removed, I just do the opposite and the agent again is ready to be  recycled “recreated” again.

I think it should be computationally more efficient to have two data collections because we only need to check  the “inside agent collection” when network is called for.



From: MASON Multiagent Simulation Toolkit [mailto:[log in to unmask]] On Behalf Of John McManus
Sent: Friday, March 04, 2011 9:15 PM
To: [log in to unmask]
Subject: Re: Dynamic Agent Creation


I create lots of dead agents, all linked up to portrayals and the schedule, each with the line “If (!alive) return:” up top in the step method. I just bring them to life or kill them as needed. I find this is much faster and simpler than actually creating new agents on the fly when thousands of agents are coming and going rapidly on a desktop. May or may not work best in your case.





From: MASON Multiagent Simulation Toolkit [mailto:[log in to unmask]] On Behalf Of Yang, Ming
Sent: Friday, March 04, 2011 9:12 AM
To: [log in to unmask]
Subject: Dynamic Agent Creation


Does MASON support dynamic agent creation? I mean to create agents not all at the start up but some in the middle of simulation. The issue seems at the method of "setupPortrayals()" in the GUIState object. I am not sure if one needs to register all agents individually there to make them show up at the simulation. If one does, we have a problem because we do not know yet how many agents will show up eventually?




  Ming Yang, PhD

  Media & Mechatronic Systems Group

  Xerox Research Center Webster


  800 Phillips Rd (MS:0147-11B); Webster, NY, 14580

  Ph: (585) 422-2375     Fx: (585) 231-8404