Closed dassarthak18 closed 1 year ago
Shared variables aren't implemented, and the parser error is expected. However, since agents can read other agent's variables (depending on the sensor), if you have a defined order of the values for each of the shared variables, you could use a variable in each agent that signals the others of an update to the shared variable, and use that as an approximate for shared variables for now.
If we have two different types of agents, A and B, and the scenario has a single copy of A and n-1 copies of B, is there a mechanism to implement a shared variable in A and access it from all copies of B, without having to explicitly implement the same variable in B?
I think currently you have to had the same variable in all n-1 copies of B as the sensor require all agents having same set of variables.
Is there any method to implement shared variables between multiple agents? I have tried to use global variables using Python's 'global' keyword, but this results in an error from the parser.