This repository contains the sources for running a multi-agent system that models trust in market exchanges.
The model can be run with:
python run.py [-h] [-a {MSAgent,WHAgent,RLAgent,GossipAgent,RLGossipAgent}] [-m {[0.0,1.0]}] [-N {[0,10000]}] [-n {[0,10000]}] [-l {[0.0,1.0]}] [-sl {[0.0,1.0]}] [-df {[0.0,1.0]}] [-r {True,False}] [-ms {[0,10000]}] [-t1 {[0,1000000]}] [-t2 {[1,1000000]}] [--save-filename SAVE_FILENAME]
-h
,--help
- Show the help message and exit-a
,--agent-class
- {MSAgent, WHAgent, RLAgent, GossipAgent, RLGossipAgent} - Which type of agent to use.-m
,--mobility-rate
- [0.0,1.0] - The probability of an agent moving to a new neighbourhood.-N
,--number-of-agents
- [0,10000] - The total number of agents in the model.-n
,--neighbourhood-size
- [0,10000] - The initial number of agents in each neighbourhood.
RLAgent, RLGossipAgent only:
-l
,--learning-rate
- [0.0,1.0] - (RLAgent, RLGossipAgent only) The discount factor with which the probabilities are updated.-sl
,--social-learning-rate
- [0.0,1.0] - (RLAgent, RLGossipAgent only) The probability of copying a propensity.-df
,--discount-factor
- [0.0,1.0] - (RLAgent, RLGossipAgent only) The discount factor of the cumulative reward.-r
,--relative-reward
- {True, False} - (RLAgent, RLGossipAgent only) Whether to normalize rewards to a mean of zero.
GossipAgent, RLGossipAgent only:
-ms
,--memory-size
- [0,10000] - (GossipAgent, RLGossipAgent only) The number of memories an agent can store.
Running model parameters:
-t1
,--T_onset
- [0,1000000] - The number of time steps to run before recording data.-t2
,--T_record
- [1,1000000] - The number of time steps to run for recording the data.--save-filename
- SAVE_FILENAME - Saves to /m_SAVE-FILENAME and /a_SAVE-FILENAME
- The starting point for running the code is the file
run.py
.runMultipleExperiments.py
contains the code for running several experiments. - The model implementation can be found in the trust folder. The utils folder contains some utilties for use by the model and running scripts.
- The data from running the model with
run.py
will be stored in the data folder. - Scripts for plotting and some resulting plots is to be found in the plotting folder.