|
27 | 27 | import numpy as np
|
28 | 28 | import seaborn as sns
|
29 | 29 | from matplotlib import pyplot as plt
|
| 30 | + |
| 31 | +SMALL_SIZE = 12 |
| 32 | +MEDIUM_SIZE = 16 |
| 33 | +BIGGER_SIZE = 20 |
| 34 | + |
| 35 | +plt.rc('font', size=SMALL_SIZE) # controls default text sizes |
| 36 | +plt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes title |
| 37 | +plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labels |
| 38 | +plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels |
| 39 | +plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels |
| 40 | +plt.rc('legend', fontsize=SMALL_SIZE) # legend fontsize |
| 41 | +plt.rc('figure', titlesize=BIGGER_SIZE) |
30 | 42 | # Import the model to be simulated
|
31 | 43 | from model import Environment, Parameters
|
32 | 44 |
|
@@ -112,18 +124,18 @@ def run_multiple_retries():
|
112 | 124 |
|
113 | 125 | fig, ax = plt.subplots()
|
114 | 126 |
|
115 |
| -model.Parameters.POPULATION_SIZE = 200 |
| 127 | +model.Parameters.POPULATION_SIZE = 266 |
116 | 128 | for ht in [0.20,0.35,0.50,0.65,0.80,0.95]:
|
117 | 129 | model.Parameters.HAPPINESS_THRESHOLD = ht
|
118 | 130 | run_multiple_retries()
|
119 | 131 |
|
120 |
| -plt.legend(loc="upper right", fontsize=15, ncol=2) |
| 132 | +plt.legend(loc="upper right", ncol=2) |
121 | 133 | plt.xlim((0,40))
|
122 | 134 | plt.ylim((0,100))
|
123 |
| -plt.xticks(fontsize=25) |
124 |
| -plt.yticks(fontsize=25) |
125 |
| -plt.xlabel("Time", fontsize=35) |
126 |
| -plt.ylabel("Unhappy agents (%)", fontsize=35) |
| 135 | +# plt.xticks(fontsize=25) |
| 136 | +# plt.yticks(fontsize=25) |
| 137 | +plt.xlabel("Time") |
| 138 | +plt.ylabel("Unhappy agents (%)") |
127 | 139 | plt.tight_layout()
|
128 | 140 | plt.savefig("results/scheling-%d-%d-%d-%.2f-%.2f.png" % (model.Parameters.POPULATION_SIZE, model.Parameters.GRID_SIZE[0], model.Parameters.GRID_SIZE[1], model.Parameters.RED_PROBABILITY, model.Parameters.HAPPINESS_THRESHOLD))
|
129 | 141 | plt.show()
|
|
0 commit comments