This is the implementation of paper no.9 in 2021 Soical Simulation Workshop at Academia Sinica. Our team (5, 擬會作社模) won the second place in the final stage of the workshop.
Paper: How Network Externalities Can Exacerbate Intergroup Inequality (DiMaggio and Garip, 2011)
# set up
parser = ArgsModel()
args = parser.get_args()
path_to_agentInfo = "PATH/TO/CSV"
agent_data_holder = AgentDataHolder(path_to_agentInfo)
# visualize adopting progress of the experiment expNo.
visualize_3d(agent_data_holder, expNo=args.expNo)
# run all experiments 1~7 and plot results
legend_n = ["No NE", "Gen NE", "Spe NE (h=0)", "Spe NE (h=0.25)", "Spe NE (h=0.5)", "Spe NE (h=0.75)", "Spe NE (h=1.0)"]
path_to_results = run_all_exp(args, agent_data_holder)
data_dict = read_result(path_to_results)
plot_result(data_dict, legend_n, suffix)
# visualize experiments 3
python model.py --vis --expNo 3
# run all 7 experiments, where each experiment runs 1000 trails
python model.py --run_all --n_trail 1000
- No Network Externalities (NE)
- General NE
- Specific NE, h=0.0
- Specific NE, h=0.25
- Specific NE, h=0.5
- Specific NE, h=0.75
- Specific NE, h=1.0