Closed mptouzel closed 2 weeks ago
Using the class name as the key is just a convention at the level of the agent factory. None of the code outside the factory file makes the assumption that the keys will be the class names. So you can name them however you like.
Ok! Good to know. Thanks.
Great work on this library! This is minor, but...
I have run into a use case where it really makes sense to have a single entity component class, but many instances.
As I understand, currently, the components are accessed via a dictionary whose keys are the names of the component class: https://github.com/google-deepmind/concordia/blob/01e4ad40e4721f35b884f1235f2b79b041a725e6/concordia/factory/agent/basic_agent.py#L196C3-L197C61
This restricts their use to only one instance, and so the only way to have many instances is to duplicate the same class, which is not really a good solution.
FIX: The obvious fix would be to add a name field to all component class definitions and use that as the key, rather than the class name.