Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider rewriting agents inheriting from the (new) abstract base class Agent(Met4FoF) to MesaAgentMet4FoF and OSBrainAgentMet4FoF #197

Open
BjoernLudwigPTB opened this issue Feb 20, 2021 · 4 comments

Comments

@BjoernLudwigPTB
Copy link
Member

The longer I work my way through the agents, the more I think it is worth considering to split up all classes that provide distinct behaviour depending on the string attribute backend. It seems to me a more OO approach would be inheriting from a generic(/abstrcact) base class and rewriting (currently) two agent classes for the two backends. Somewhat similar to what we did with the dashboard (due to the need for distributed capabilities of multiprocess.context.Process).

@bangxiangyong
Copy link
Member

I have thought of that, however in designing new agents, will such scheme require the user to choose to inherit from either MesaAgentMet4FoF or OSBrainAgentMet4FoF ? I am not sure if i'm getting what you're implying, however, the goal was to be able to define a new agent class based on a single abstract class i.e

class SineGenAgent(AgentMET4FOF):

@BjoernLudwigPTB
Copy link
Member Author

BjoernLudwigPTB commented Feb 26, 2021

I understand your thought. I think a three layered abstraction would be best here. The bottom layer defines the interface of an agent class. the middle layer implements this interface and is adapted to a certain backend and maybe more specializations in future. The third layer combines theses adaptions and avoids any trouble for the end-user by switching between the parameterizations of the agents classes (which would be our current class AgentMet4FoF with a lot less code). This third layer would do the case distinction and basically only instantiating the right class of the second layer which currently would be one of something like MesaAgentMet4FoF and OsBrainAgentMet4FoF.

@BjoernLudwigPTB
Copy link
Member Author

@bangxiangyong @anupam-prasad What do you think of that approach?

@BjoernLudwigPTB
Copy link
Member Author

We agree on the current structure being not so clean in terms of object-orientation. A three layered structure as proposed above might be a good idea though it is just one perspective. At a later time, we want to transfer the current string checking into something more robust and clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants