-
Notifications
You must be signed in to change notification settings - Fork 271
5.0.0 discussion -- Abstract base classes for players #1240
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
Comments
This all sounds very good.
Could the
For the axelrod library this would be on the
Is there merit in perhaps bringing the dojo in to the axelrod library itself? I'm generally more of a fan of keeping them separated but given the proposed changes it feels like they'll be much closer linked.
This would all be on the |
Mutable could be the base class I suppose. This would be on the master branch. We may want to fold in the dojo once the rest of this is done. I hadn't thought about that yet. Starting with the namespace reorg the changes would be on the 5.0.0 branch. |
Sounds good to me @marcharper. |
What was the intended difference between |
Mainly that most Players aren't naturally mutable. Some of the generic classes like LookerUp and the FSM player are, but the ones implemented from Axelrod's tournaments generally are not. One can imagine wanting to check if a player is mutable, which could be at the method class level or whether certain methods are implemented, or a new classifier entry. |
Note for this one I went with |
Creating an abstract player still needs to be done right? I would like to tackle this. My thought is that we can call the abstract player AbstractPlayer, the current implementation FsmPlayer, and somewhere in init say that Player=FsmPlayer. This makes the change non-API breaking, and in a future change, we can make Player=AbstractPlayer. Because this doesn't break API, dojo would be okay, and we can do the namespace re-org later. For now, we can make everything work only with FsmPlayer, and start generalizing things piecemeal. Does this make sense, and are you okay with me taking a stab at it? |
I'm fine with you taking a stab at it. Let me record some thoughts here that may help. One thing we should change for the IPD player, which is API breaking, is that the Note also that in #1288 I'm moving the Some open questions on how to proceed to supporting new game types: (1) Assuming we have new Player types for different games (see e.g. the ultimatum branch, which is a non-matrix game), can we design (2) Can we reduce adding a new game to simply defining a new Game class (with a scoring function) and a new intermediate abstract player class? Perhaps also an optimized history class? A first step perhaps is to try to separate the layers for IPD games so that we have a clean "plugin style" way of adding new games. I.e. we'd have an AbstractPlayer class, AbstractIPDPlayer as a descendant, and then IPD specifics like FSMPlayer as further descendants. It's worth thinking about where Evolvable Players should be in the hierarchy. Similarly we'd have an AbstractGame, IPDGame, UltimatumGame, etc. Hopefully we don't also need a Match and Tournament class for each game. |
I can't think of a way to make backwards compatible. How do we roll out an API change? We can take both arguments for a while with a deprecation warning, maybe... Actually as I think more about this, we may need to break API to support multiple players and to support different result sets...
I thought I saw that you made a History class, but it's not being passed in to strategies.
I will wait for that.
I think the question in both is: Do we derive Match, Tournament, MoranProcess, ... classes or do we just let things get passed in? (Maybe the Game class can store everything we need.) I won't try to answer that here.
Yea, this is what I'm thinking.
I was thinking of calling this IPDPlayer (IpdPlayer?). |
We can break the API, but it's best to make the breaking changes as a batch, and with a new major release version. I think we won't really know the best collection of classes until we work through some of the new game types. |
Yeah, our previously discussed plan was to make all |
I've been working on a number of separate branches and problems and would like some feedback on a proposal before I sink a lot of time into it.
For the namespace reorganization for Axelrod (#1175) we need an abstract player class. A lot of the core functionality of the class can move out (cloning for example); the IPD class just needs to additionally track cooperations, defections, and the state distribution (or perhaps on a History class). To use the dojo on the ultimatum game we need resetting, cloning, and such as well.
For the new style of mutation for the dojo and Moran class (see the mutation branch), I think it makes sense to introduce an intermediate ABC that defines mutation and crossover methods. IIRC we needed the params classes in the dojo because Players couldn't be picked, however I think that's no longer the case, so all that functionality can (and I think should) move into the main library.
So I'd like to do the following:
Thoughts?
The text was updated successfully, but these errors were encountered: