AB-CE / abce

Agent-based computational Economics, the Python library that makes AB modelling easier
http://abce.readthedocs.io
190 stars 64 forks source link

Default group name to class name #56

Closed rht closed 7 years ago

rht commented 7 years ago

This changes the parameter order, but simplifies build_agents. This is for better interoperability.

DavoudTaghawiNejad commented 7 years ago

I have thought about this for long and I think this is not a good idea. If the user has to specify the agent name explicitly he knows the agent name. If he don't he has to read the documentation to know that the class name is used as an agent name.

rht commented 7 years ago

Here are the use cases sorted in the order of how common they might arise:

  1. (majority / most common cases) Agent names are used only for logging purpose, and never used by the modeler to fetch to an agent from the global hash table of the simulation.
  2. Modelers need to fetch an agent from the global hash table of the simulation. This is better done by agent id instead of string name.
  3. Modelers somehow need to fetch an agent by its string name. This is far less common than case 1 and 2, and so a documentation suffices to explain how an agent string name is generated.
  4. Modelers need to specify a name that may deviate far from the class name. This is the least common case, and the library interface should be designed to hide the extraneous toggles and switches away.

Why should an instantiation of an agent be complicated by an extra param when they are not used at all but only in case 3 or 4?

e: s/Here is/ Here are/