Created
January 22, 2020 04:46
-
-
Save jessesnyder/e870f537a0e7eae4ea280f1872f4d8d2 to your computer and use it in GitHub Desktop.
Experiment delegation/strategy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from . import games | |
def extra_parameters(): | |
config = dlgr.config.get_config() | |
config.register('mexp_turn_type', six.text_type, [], False) | |
class MyExperiment(dlgr.experiments.Experiment): | |
"""Experiment that delegates turn-taking implementation based on configuration""" | |
def __init__(self, session): | |
"""Initialize the experiment.""" | |
super(MyExperiment, self).__init__(session) | |
config = dlgr.config.get_config() | |
self.game = games.by_name( | |
config.get(u'mexp_turn_type', u'fixed_turns'), quorum=self.quorum | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment