Agent communication based on networks #1037
Replies: 1 comment 4 replies
-
Hi @meiertgrootes . The FLAME GPU team had a chat about this. There are a few different approaches for what you want to do but it would depend very much on the details of your use case. I suggested when we spoke by email to consider using an agent array variable so that each agent could store a list of indices of agents that it are in its network (and that it want to receive information from). Each agent could then write an array (1D) message to a unique position (it's index) and agents could query their network by traversing their list of stored neighbours and then querying the 1D array message list using the stored indices. The obvious limitations to the above would be that this would require agents to build their networks during initialization or using some other form of communication (e.g. spatial or perhaps bucket if they add friends when say visiting a building/website). If you needed to be able to query friends of friends then the network would have to be stored in the environment (macro environment property). If you used the same 1D message strategy then you could traverse friends and then lookup friends of friends in the same way. This would however have to be static. Some case would be needed regarding IDs. This would work best with agents having contiguous IDs defined at initialization as the message array would become sparse otherwise. Some degree of sparsity would be fine but if your model was very dynamic then another approach may be required. Do any of the above fit your use case? |
Beta Was this translation helpful? Give feedback.
-
In (many) ABMs (even with a spatial component) communication/interaction between agents is best described via networks. For example, for infectious disease modelling, agents are members in several networks, incl. household, profession, and a larger random encounter network. Such a model is potentially also well suited to a more general class of models investigating the impacts/outcomes of information spread.
Does FLAMEGPU2 currently support such models, and/or what could an implementation look like? This issue has been raised in #68 and is partially being addressed in #883. However, #883 only covers the situation where the model is described as a (static) network, rather than the agent communication being described as a (dynamic) network.
#883 also mentions that the currently implemented bucket communication scheme might suffice, but I'm not sure this is the case.
As an example, consider an infectious disease model. An agent has interactions with a number of other agents defined by a network. One possibility would be for each agent to write its infectious state to a bucket corresponding to a unique id associated with it. Then other agents would have to read a list of buckets. It is unclear to me whether this could be handled concurrently, or how most efficiently. It seems that each bucket would need to be read separately by its own agent function. The iteration through the buckets might be feasible in a submodel, but the question of efficiency looms large. In addition one would be left with synchronizing exposure times between two agents. Defining interaction lists and exposure time might be possible via environment variables, but overall the question is can this be implemented in an efficient fashion In FlameGPU2 at the moment or in the foreseeable future.
The alternative would be to have agents write to a bucket with a unique id corresponding to the agent they interact with. This would then only require the interrogating agent to read messages from one bucket, but require an iteration over all the buckets and agent would have to write to (as defined by a interaction list which would have to be upated via an environment variable). The same issues as above seem to apply.
We'd (@meiertgrootes, @cpranav93, @vmgaribay, @debraj001) be very interested in hearing your thoughts on this @mondus and @ptheywood and discussing if and how FLAMEGPU2 might be a suitable tool. Thanks
Beta Was this translation helpful? Give feedback.
All reactions