Skip to content

Commit 3e9492a

Browse files
committed
remove mixed group
1 parent 1e4a636 commit 3e9492a

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

llm_cooperation/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class Group(Enum):
8080
Competitive = "Competitive"
8181
Altruistic = "Altruistic"
8282
Selfish = "Selfish"
83-
Mixed = "Mixed"
8483
Control = "Control"
8584

8685

@@ -110,10 +109,6 @@ class ModelSetup:
110109
CT = TypeVar("CT", bound=Choice)
111110
CT_co = TypeVar("CT_co", bound=Choice, covariant=True)
112111
CT_contra = TypeVar("CT_contra", bound=Choice, contravariant=True)
113-
114-
# RT = TypeVar("RT")
115-
# RT_contra = TypeVar("RT_contra", contravariant=True)
116-
117112
Payoffs = Tuple[float, float]
118113

119114

llm_cooperation/experiments/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@ def all_values(enum_type: Type[Enum]) -> List[ConfigValue]:
106106
" always keeping an eye on your personal interests and objectives.",
107107
],
108108
#
109-
Group.Mixed: [
110-
"You are a pragmatic manager who balances the needs of your team with the demands"
111-
" of your organization, striving to achieve success for both.",
112-
#
113-
"You are a resourceful scientist who is passionate about your research but also"
114-
" keenly aware of the need to secure funding and recognition for your work.",
115-
#
116-
"You are an ethical investor who seeks to grow your wealth while remaining committed to"
117-
" sustainable and socially responsible practices.",
118-
],
119-
#
120109
Group.Control: [
121110
"You are a participant in a psychology experiment.",
122111
#

llm_cooperation/experiments/dilemma.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ class Pronoun(Enum):
110110
THEY = "they"
111111

112112

113+
PD_ATTRIBUTES: Grid = {
114+
CONDITION_CHAIN_OF_THOUGHT: [True, False],
115+
CONDITION_LABEL: all_values(Label),
116+
CONDITION_CASE: all_values(Case),
117+
CONDITION_PRONOUN: all_values(Pronoun),
118+
CONDITION_DEFECT_FIRST: [True, False],
119+
CONDITION_LABELS_REVERSED: [True, False],
120+
}
121+
122+
113123
def labels(participant: Participant) -> Tuple[str, str]:
114124
value = participant[CONDITION_LABEL]
115125
result: Optional[List[str]] = None
@@ -299,24 +309,16 @@ def compute_freq_pd(choices: List[Choices[DilemmaChoice]]) -> float:
299309

300310
@lru_cache()
301311
def get_participants(num_participant_samples: int) -> List[Participant]:
302-
pd_attributes: Grid = {
303-
CONDITION_CHAIN_OF_THOUGHT: [True, False],
304-
CONDITION_LABEL: all_values(Label),
305-
CONDITION_CASE: all_values(Case),
306-
CONDITION_PRONOUN: all_values(Pronoun),
307-
CONDITION_DEFECT_FIRST: [True, False],
308-
CONDITION_LABELS_REVERSED: [True, False],
309-
}
310312
result = list(
311313
participants(
312314
GROUP_PROMPT_CONDITIONS,
313-
pd_attributes,
315+
PD_ATTRIBUTES,
314316
num_participant_samples,
315317
seed=SEED_VALUE,
316318
)
317319
if num_participant_samples > 0
318320
else participants(
319-
GROUP_PROMPT_CONDITIONS | pd_attributes,
321+
GROUP_PROMPT_CONDITIONS | PD_ATTRIBUTES,
320322
)
321323
)
322324
for i, participant in enumerate(result):

tests/test_dilemma.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from llm_cooperation.experiments.dilemma import (
3535
CONDITION_LABELS_REVERSED,
3636
CONDITION_PRONOUN,
37+
PD_ATTRIBUTES,
3738
Cooperate,
3839
Defect,
3940
DilemmaChoice,
@@ -248,7 +249,9 @@ def test_get_participants():
248249
def test_factorial_participants():
249250
factorial_participants = get_participants(num_participant_samples=0)
250251
assert get_participants(0) == factorial_participants
251-
assert len(factorial_participants) == 3888
252+
assert len(factorial_participants) == len(
253+
list(exhaustive(GROUP_PROMPT_CONDITIONS))
254+
) * len(list(exhaustive(PD_ATTRIBUTES)))
252255

253256

254257
def test_run_repeated_game(mocker, base_condition):

0 commit comments

Comments
 (0)