Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.ai    |    Awaiting the gospel from Sarah Connor    |    1,954 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,244 of 1,954    |
|    Dmitry A. Kazakov to Thuan Seah Tan    |
|    Re: Thread per agent for traffic simulat    |
|    03 Dec 06 21:17:24    |
      From: mailbox@dmitry-kazakov.de              On Sun, 03 Dec 2006 13:09:50 GMT, Thuan Seah Tan wrote:              > I wonder for a multiagent system simulating traffic flow where each       > vehicle is an agent, is it common to have a thread for each agent? Having a       > thread for each agent doesn't seem to be a good idea if we are looking at       > large numbers vehicle say >100 am I right to assume so? How do people using       > implement such a system then? Hope someone can advice me on this. Thanks in       > advance.              That depends on the environment you are using. Using Ada you usually have       an option not to map the tasks to OS threads/processes. In that case the       language run-time library schedules tasks without OS intervention. This       would make it possible to schedule far more than just 100 tasks.              In concrete case of traffic simulation, you likely wouldn't wish to use       preemptively scheduled tasks at all. Because you need to be sure that all       agents update their state within some time slice. Otherwise the simulation       would look as if car drivers suffered random frequent blackouts.              Concurrency would bring you nothing here. At the end of each time slice you       will need to resynchronize all tasks running the agents anyway. So it were       just an unnecessary overhead. In a situation where you had a natively       parallel system with many CPU, you indeed would like to distribute groups       of agents across the system partitions to better use computational       resources. But in each partition all agents would be still driven by one       task.              --       Regards,       Dmitry A. Kazakov       http://www.dmitry-kazakov.de              [ comp.ai is moderated ... your article may take a while to appear. ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca