Interactive browser experiment where one human plays a 50-round public-goods game against two AI automata calibrated from observed behavior in punnoise_data.csv.
- Group size: 3 players (You, AI-1, AI-2)
- Rounds: 50 fixed rounds
- Contribution action each round:
20or0 - Stage-1 payoff per player:
- If contribute
0: keep20 - All players receive
10 * (# contributors) - So:
income_pg = (keep amount) + 10 * group_contributors
- If contribute
- Monitoring:
- Perfect: public record equals real contribution
- Noisy: if real contribution =
20, public record flips to0with probability10% - Real
0always shows as0
- Punishment stage (treatment-dependent):
- Each player can assign
0..5points to each other player - Cost to punisher:
1per point - Regular punishment: target loses
3 * received_points, capped by targetincome_pg - Strong punishment: target loses
6 * received_points, uncapped (can go negative)
- Each player can assign
- Perfect + No punishment
- Noisy + No punishment
- Perfect + Regular punishment
- Noisy + Regular punishment
- Perfect + Strong punishment
- Noisy + Strong punishment
Automata are stochastic and data-driven from data/behavior_policy.json:
- Contribution probability by treatment, round bucket, and short memory state:
- previous observed no-contribution count (
0..2) - whether they were punished in prior round
- their previous contribution
- previous observed no-contribution count (
- Punishment probability/intensity by treatment, round bucket, actor contribution, and target public signal
This policy JSON was extracted from your dataset with scripts/extract_policy.py.
Adaptive bot priors, learning rates, noise, and response sensitivities are in:
data/bot_config.json
You can tune these without editing source code.
policy_mode in config controls which policy is used:
belief(default, explainable model)nn(offline-trained tiny neural network inference)
node ./scripts/calibrate_response.mjs \
--config ./data/bot_config.json \
--policy ./data/behavior_policy.json \
--out ./data/bot_config.calibrated.jsonThen replace data/bot_config.json with the calibrated output if desired.
Files:
src/bot_policy_nn.mjs(inference)scripts/train_nn_policy.mjs(offline training)data/nn_model.json(trained weights)
Feature set used by NN:
- Contribution head: round index, estimated human cooperation probability, other-bot cooperation proxy, recent observed no-contribution signal, recent punishment signal, monitoring/punishment treatment indicators.
- Punishment heads: target public no-contribution signal, actor contribution, recent trend proxy, free-rider belief mass, treatment indicators, and whether target is the human slot.
Train command:
node ./scripts/train_nn_policy.mjs \
--input \"/Users/mac/Desktop/Thesis/8th Meeting - Online/Data/Data Imperfect Public Monitoring with Costly Punishment/AER-2010-1123_data/punnoise_data.csv\" \
--output ./data/nn_model.jsonTo enable NN inference in game/harness, set in data/bot_config.json:
{
"policy_mode": "nn",
"nn_model_path": "./data/nn_model.json"
}- From the project root:
python3 -m http.server 8000No build step required.
python3 ./scripts/extract_policy.py \
--input "/Users/mac/Desktop/Thesis/8th Meeting - Online/Data/Data Imperfect Public Monitoring with Costly Punishment/AER-2010-1123_data/punnoise_data.csv" \
--output "./data/behavior_policy.json"At the end of a session, click Download Results CSV. The exported file contains one row per player per round with contributions, public records, punishment, payoff components, and cumulative scores.
Run many no-UI sessions across bot and scripted-human settings:
node ./scripts/stress_test.mjs \
--sessions 1000 \
--rounds 50 \
--modes all \
--treatments all \
--out-dir ./outputsModes:
bot_vs_botbot_vs_free_riderbot_vs_conditionalbot_vs_random
Outputs (CSV):
outputs/stress_summary_<timestamp>.csvoutputs/stress_timeseries_<timestamp>.csvoutputs/stress_final_beliefs_<timestamp>.csv
Summary metrics include cooperation rates (overall/bots/human), punishment spent, welfare, and false-punishment rate under noisy monitoring.