From 1a01afd51b23037c66efe76641234e106147365c Mon Sep 17 00:00:00 2001
From: Liyao Zhu <l.zhu34@student.unimelb.edu.au>
Date: Tue, 11 Jun 2019 12:44:53 +1000
Subject: [PATCH] Submit version. README
---
README.md | 42 ++++++++++++++++++++++++++++++++++++++++++
main.py | 8 +++-----
2 files changed, 45 insertions(+), 5 deletions(-)
create mode 100644 README.md
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8592fdc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+#Collective-Risk Dilemma + Q-learning
+This repo contains files that support the project of studying Q-learning agents
+in a collective-risk dilemma.
+
+---
+
+To test the data of the thesis, **uncomment any code blocks in main.py/main()**
+ and run:
+
+$ python3 main.py
+
+---
+
+Most methods in main.py have the flexibility of passing different number of
+parameters in **kwargs. If not specified, a parameter will be defaulted with
+the value defined in __init__() methods.
+
+To extend the tests, stackBar() and t_test() in main.py were implemented
+with the flexibility of specifying which parameter is of interest.
+Simply pass a list or tuple to the method with the interested keyword, as
+part of **kwargs.
+
+E.g. `stackBar(0, Actions, repeat=repeat, alpha=[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0
+.6, 0.7, 0.8, 0.9, 1])`
+compares on different alpha value, while
+
+`stackBar(0, Actions, repeat=repeat, threshold=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6,
+0.7, 0.8, 0.9, 1])` compares on thresholds.
+
+
+---
+
+The graph.py implemented a 'small-world network' model for agent pairing.
+Current tests found no significant effect on observed results. The model is
+kept for further study, but only well-mixed graphs were deployed so far.
+
+---
+
+Author: Liyao Zhu `liyaoz@student.unimelb.edu.au`
+
+Last Update: 11 Jun. 2019
+
diff --git a/main.py b/main.py
index 923934e..1146634 100644
--- a/main.py
+++ b/main.py
@@ -275,9 +275,9 @@ def main():
"""Fig. 2"""
- # data = rep(repeat=repeat, N=100, alpha=0.8, R=8)
- # stackPlot(data, r=0, Iterations=I, Actions=Actions,
- # legendLoc='lower right')
+ data = rep(repeat=repeat, N=100, alpha=0.8, R=8)
+ stackPlot(data, r=0, Iterations=I, Actions=Actions,
+ legendLoc='lower right')
"""Fig. 3"""
@@ -370,7 +370,5 @@ def main():
# print(stats.ttest_ind(base, compare))
-
-
if __name__ == '__main__':
main()
\ No newline at end of file
--
GitLab