Closed shanive closed 12 years ago
there is a way to use some sort of reflection (that is, accessing classes by name), but it is awkward.
what you want is an agent factory that gets the name of an agent and creates an agent. The factory may use a map from from agent names to agent creating functions, and a method like registerAgent(name, creator) that registers all agents on startup.
or any other way you find usable.
David,
When we implemented tournament on python, we got the agents' class names from command line and used a "getattr" function. Is there any way of doing this on c++, that you know of? otherwise i will have to use "if" statement on every agent we have.
Thanks, Vered.