From 5cb1f5892ddbe792b5f4219c43a80f6d62d32c18 Mon Sep 17 00:00:00 2001 From: Mia Lu Date: Mon, 6 May 2024 14:21:48 +0200 Subject: [PATCH] Adjust to a total number of participants of 36 instead of 30 --- live_bargaining/__init__.py | 6 +- .../create_group_matrices.ipynb | 80 ++++++++++++------ preparation/group_matrices/group_matrices.pkl | Bin 640 -> 760 bytes 3 files changed, 57 insertions(+), 29 deletions(-) diff --git a/live_bargaining/__init__.py b/live_bargaining/__init__.py index 5b10450..e5654d2 100644 --- a/live_bargaining/__init__.py +++ b/live_bargaining/__init__.py @@ -25,7 +25,7 @@ def creating_session(subsession): num_active_groups = len(subsession.get_groups()) - if num_active_groups == 10: + if num_active_groups <= 12 and num_active_groups % 2 == 0: subsession_index = subsession.round_number - 1 with open( "preparation/group_matrices/group_matrices.pkl", @@ -33,7 +33,9 @@ def creating_session(subsession): ) as file: group_matrices = pickle.load(file) if subsession_index < len(group_matrices): - subsession.set_group_matrix(group_matrices[subsession_index]) + subsession.set_group_matrix( + group_matrices[subsession_index][:num_active_groups] + ) else: subsession.group_randomly() else: diff --git a/preparation/group_matrices/create_group_matrices.ipynb b/preparation/group_matrices/create_group_matrices.ipynb index 345045a..93fc736 100644 --- a/preparation/group_matrices/create_group_matrices.ipynb +++ b/preparation/group_matrices/create_group_matrices.ipynb @@ -2,8 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": 60, - "metadata": {}, + "execution_count": 1, + "metadata": { + "metadata": {} + }, "outputs": [], "source": [ "import pickle\n", @@ -14,19 +16,23 @@ }, { "cell_type": "code", - "execution_count": 61, - "metadata": {}, + "execution_count": 2, + "metadata": { + "metadata": {} + }, "outputs": [], "source": [ "num_groups = 2 # number of groups per matching group\n", - "num_match_grp = 5\n", + "num_match_grp = 6\n", "num_rounds = 6" ] }, { "cell_type": "code", - "execution_count": 62, - "metadata": {}, + "execution_count": 3, + "metadata": { + "metadata": {} + }, "outputs": [], "source": [ "class Groups:\n", @@ -61,20 +67,22 @@ }, { "cell_type": "code", - "execution_count": 63, - "metadata": {}, + "execution_count": 4, + "metadata": { + "metadata": {} + }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_89633/62703243.py:19: UserWarning: Player 3 was first multiple times\n", + "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_18948/62703243.py:19: UserWarning: Player 3 was first multiple times\n", " warnings.warn(f\"Player {first_in_group} was first multiple times\")\n", - "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_89633/62703243.py:19: UserWarning: Player 1 was first multiple times\n", + "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_18948/62703243.py:19: UserWarning: Player 1 was first multiple times\n", " warnings.warn(f\"Player {first_in_group} was first multiple times\")\n", - "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_89633/62703243.py:19: UserWarning: Player 0 was first multiple times\n", + "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_18948/62703243.py:19: UserWarning: Player 0 was first multiple times\n", " warnings.warn(f\"Player {first_in_group} was first multiple times\")\n", - "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_89633/62703243.py:19: UserWarning: Player 2 was first multiple times\n", + "/var/folders/ml/b6fb3hq91m70wjn5hjgyky58kdcssc/T/ipykernel_18948/62703243.py:19: UserWarning: Player 2 was first multiple times\n", " warnings.warn(f\"Player {first_in_group} was first multiple times\")\n" ] } @@ -94,8 +102,10 @@ }, { "cell_type": "code", - "execution_count": 64, - "metadata": {}, + "execution_count": 5, + "metadata": { + "metadata": {} + }, "outputs": [ { "data": { @@ -108,7 +118,7 @@ " [[1, 2, 4], [3, 5, 6]]]" ] }, - "execution_count": 64, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -119,8 +129,10 @@ }, { "cell_type": "code", - "execution_count": 65, - "metadata": {}, + "execution_count": 6, + "metadata": { + "metadata": {} + }, "outputs": [ { "data": { @@ -134,7 +146,9 @@ " [23, 21, 19],\n", " [24, 22, 20],\n", " [29, 27, 25],\n", - " [30, 28, 26]],\n", + " [30, 28, 26],\n", + " [35, 33, 31],\n", + " [36, 34, 32]],\n", " [[6, 5, 1],\n", " [4, 3, 2],\n", " [12, 11, 7],\n", @@ -144,7 +158,9 @@ " [24, 23, 19],\n", " [22, 21, 20],\n", " [30, 29, 25],\n", - " [28, 27, 26]],\n", + " [28, 27, 26],\n", + " [36, 35, 31],\n", + " [34, 33, 32]],\n", " [[5, 3, 4],\n", " [2, 1, 6],\n", " [11, 9, 10],\n", @@ -154,7 +170,9 @@ " [23, 21, 22],\n", " [20, 19, 24],\n", " [29, 27, 28],\n", - " [26, 25, 30]],\n", + " [26, 25, 30],\n", + " [35, 33, 34],\n", + " [32, 31, 36]],\n", " [[4, 5, 6],\n", " [3, 1, 2],\n", " [10, 11, 12],\n", @@ -164,7 +182,9 @@ " [22, 23, 24],\n", " [21, 19, 20],\n", " [28, 29, 30],\n", - " [27, 25, 26]],\n", + " [27, 25, 26],\n", + " [34, 35, 36],\n", + " [33, 31, 32]],\n", " [[2, 3, 6],\n", " [1, 4, 5],\n", " [8, 9, 12],\n", @@ -174,7 +194,9 @@ " [20, 21, 24],\n", " [19, 22, 23],\n", " [26, 27, 30],\n", - " [25, 28, 29]],\n", + " [25, 28, 29],\n", + " [32, 33, 36],\n", + " [31, 34, 35]],\n", " [[1, 2, 4],\n", " [3, 5, 6],\n", " [7, 8, 10],\n", @@ -184,10 +206,12 @@ " [19, 20, 22],\n", " [21, 23, 24],\n", " [25, 26, 28],\n", - " [27, 29, 30]]]" + " [27, 29, 30],\n", + " [31, 32, 34],\n", + " [33, 35, 36]]]" ] }, - "execution_count": 65, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -203,8 +227,10 @@ }, { "cell_type": "code", - "execution_count": 67, - "metadata": {}, + "execution_count": 7, + "metadata": { + "metadata": {} + }, "outputs": [], "source": [ "with open(\"group_matrices.pkl\", \"wb\") as f:\n", diff --git a/preparation/group_matrices/group_matrices.pkl b/preparation/group_matrices/group_matrices.pkl index 0937d7b1322c47911bd21433751072edf5336e65..ed3b36a851236aa6b5ccae1642b2988dfe6d2d52 100644 GIT binary patch delta 154 zcmZo*{lUu8z%upiM3zF~*eM#`%HE3J@~I$}ino%t!o-qHu&@eH0wSygRG={N4n!EF zS_!OL!CT&2WwHw+L|h4|Tm>u+G|gLK@*1eP0#H3fTpnn;@?;UFOmUE1Ks8Wv6u~-E GQ}qDt|15F< delta 35 ocmeyt+Q7=vz%sRTB1_@K&Wy>dj2V*~f%q>FS2ATVr>5!w0OkM;g#Z8m