1

My question is regarding modifying agents on another process. I am using a grid, where I have static agents, one agent per grid cell. Each agent can get its direct neighbours using the Moore2DGridQuery. Then depending on the neighbouring agents states, they can choose one of their neighbours and change their state. Pretty much in the same way with the Humans and Zombies, where a zombie can infect a human. However, since the the agent can modify a direct neighbour, that means the neighbour could be an agent in the buffer zone. So if I want to "infect" and agent in the buffer zone and propagate that back to the original agent, what is the best possible approach to doing this?

1 Answers1

0

There's really no built-in way to do this. Synchronization is from the original to the ghost / buffered agent. The intention is that the non-ghost (non-buffered) agents are active, and would, for example, look around at their neighbors and then change themselves in someway. Is it possible to refactor your agent behavior with that in mind?

You could code your own mechanism for this reverse synchonization but you'd have to use MPI directly, sending agent ids and the updated state, rather than any of Repast HPC's synchronization mechanisms. If you are doing that probably the easiest way is to send all the changes to rank 0 and then have each rank query rank 0 for any applicable changes. Again though that's MPI programming and not strictly related to Repast HPC.

Nick Collier
  • 1,786
  • 9
  • 10
  • Unfortunately, I think there is no way to change that. The model I am trying to create is regarding biological cells which represent their division by "reviving" a neighbouring cell. When a cell is ready to "revive a neighbour", it will store that neighbour's id. Then Model class, will check if there are cells to revive and which are they, and then it will handle the "revival", which is just resetting the agent with new parameter values. However, this is handled by each rank separately, so the buffer zone agents get excluded. – Alexandar Ruskov Mar 02 '22 at 15:37
  • What I was thinking as a possible solution was to store the id of an agent to be revived in the agent which "wants" to revive it. Then that will be transferred in the serialisable package, so on the next tick, I can iterate over the non-local agents and check these values that they have, so that the correct process will be able to handle its agent's revival. – Alexandar Ruskov Mar 02 '22 at 15:39
  • 1
    That sounds like a reasonable solution. – Nick Collier Mar 03 '22 at 18:20