Skip to content

Commit

Permalink
Some documentation updates and add some limits to the quorum values t…
Browse files Browse the repository at this point in the history
…o prevent hangs.
  • Loading branch information
alecpm committed Nov 9, 2024
1 parent 3e553c4 commit 19df9f7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ Number of players. Default is 3.

Number of rounds. Default is 1.

### num_games

Number of concurrent games to run. Default is 1.

### quorum

The number of total participants needed in the waiting room before any games can
start. Default is `max_participants`

### game_quorum

The number of participants needed in each game before the game can start. A game
can start before it has filled, any additional players will be added to the
already running game. Default is `max_participants`

### time_per_round

Time per round, in seconds. Defaults to 300.
Expand Down
12 changes: 8 additions & 4 deletions dlgr/griduniverse/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ def __init__(self, **kwargs):

# Players
self.num_players = kwargs.get("max_participants", 3)
# Minimum quorum for game defaults to max nubmer of players per game
self.quorum = kwargs.get("game_quorum", self.num_players)
# Minimum quorum for game defaults to max nubmer of players per game,
# and cannot exceed that number
self.quorum = min(kwargs.get("game_quorum", self.num_players), self.num_players)

# Rounds
self.num_rounds = kwargs.get("num_rounds", 1)
Expand Down Expand Up @@ -1640,8 +1641,11 @@ def configure(self):
self.num_participants = self.config.get("max_participants", 3)
self.instruct = self.config.get("instruct", True)
self.total_participants = self.num_participants * self.experiment_repeats
# Quorum defaults to the max number of players for a single game
self.quorum = self.config.get("quorum", self.num_participants)
# Quorum defaults to the max number of players for a single game, and
# cannot exceed the total number of allowed participants
self.quorum = min(
self.config.get("quorum", self.num_participants), self.total_participants
)
self.initial_recruitment_size = self.config.get(
"num_recruits", self.total_participants
)
Expand Down

0 comments on commit 19df9f7

Please sign in to comment.