piegy 2.3.3__tar.gz → 2.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {piegy-2.3.3/src/piegy.egg-info → piegy-2.3.4}/PKG-INFO +1 -1
- {piegy-2.3.3 → piegy-2.3.4}/pyproject.toml +1 -1
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/sim_funcs.h +19 -18
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/__version__.py +2 -1
- {piegy-2.3.3 → piegy-2.3.4/src/piegy.egg-info}/PKG-INFO +1 -1
- {piegy-2.3.3 → piegy-2.3.4}/LICENSE.txt +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/MANIFEST.in +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/README.md +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/setup.cfg +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/setup.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/Makefile +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/model.c +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/model.h +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/patch.c +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/patch.h +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/runner.c +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/C_core/sim_funcs.c +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/__init__.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/analysis.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/build_info.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/data_tools.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/figures.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/simulation.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/simulation_py.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/test_var.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/tools/__init__.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/tools/figure_tools.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/tools/file_tools.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/tools/find_C.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy/videos.py +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy.egg-info/SOURCES.txt +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy.egg-info/dependency_links.txt +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy.egg-info/requires.txt +0 -0
- {piegy-2.3.3 → piegy-2.3.4}/src/piegy.egg-info/top_level.txt +0 -0
@@ -36,7 +36,7 @@
|
|
36
36
|
#define SMALL_MAXTIME 2
|
37
37
|
#define SIM_OVERFLOW 3
|
38
38
|
|
39
|
-
// where
|
39
|
+
// where exp(x) is considered overflow
|
40
40
|
// below the actual bound (709) because the large numbers will be computed with close-to-0 ones (payoff rates), so higher accuracy is needed
|
41
41
|
#define EXP_OVERFLOW_BOUND 500
|
42
42
|
|
@@ -116,19 +116,19 @@ static inline void update_pi_k(patch_t* restrict p, const double* restrict M_sta
|
|
116
116
|
|
117
117
|
double U = (double) p->U;
|
118
118
|
double V = (double) p->V;
|
119
|
-
double sum = U + V
|
120
|
-
|
121
|
-
|
119
|
+
double sum = U + V;
|
120
|
+
double U_ratio = U / sum;
|
121
|
+
double V_ratio = V / sum;
|
122
122
|
|
123
123
|
if (sum > 0) {
|
124
124
|
if (U > 0) {
|
125
|
-
p->U_pi =
|
125
|
+
p->U_pi = U_ratio * M_start[0] + V_ratio * M_start[1];
|
126
126
|
} else {
|
127
127
|
p->U_pi = 0.0;
|
128
128
|
}
|
129
129
|
|
130
130
|
if (V > 0) {
|
131
|
-
p->V_pi =
|
131
|
+
p->V_pi = U_ratio * M_start[2] + V_ratio * M_start[3];
|
132
132
|
} else {
|
133
133
|
p->V_pi = 0.0;
|
134
134
|
}
|
@@ -141,8 +141,8 @@ static inline void update_pi_k(patch_t* restrict p, const double* restrict M_sta
|
|
141
141
|
p->pi_death_rates[0] = fabs(U * p->U_pi);
|
142
142
|
p->pi_death_rates[1] = fabs(V * p->V_pi);
|
143
143
|
|
144
|
-
p->pi_death_rates[2] = P_start[4] * U *
|
145
|
-
p->pi_death_rates[3] = P_start[5] * V *
|
144
|
+
p->pi_death_rates[2] = P_start[4] * U * sum;
|
145
|
+
p->pi_death_rates[3] = P_start[5] * V * sum;
|
146
146
|
|
147
147
|
p->sum_pi_death_rates = 0.0;
|
148
148
|
for (size_t i = 0; i < 4; i++) {
|
@@ -153,6 +153,7 @@ static inline void update_pi_k(patch_t* restrict p, const double* restrict M_sta
|
|
153
153
|
|
154
154
|
|
155
155
|
static inline void update_mig_just_rate(patch_t* restrict p, const double* restrict P_start) {
|
156
|
+
// BUGGY - not using
|
156
157
|
// update migration weight for patch p, in location loc. Only rate is updated
|
157
158
|
// used by last-changed patch, when there is only one last-changed patch
|
158
159
|
double* p_U_weight = p->U_weight;
|
@@ -195,20 +196,20 @@ static inline uint8_t update_mig_weight_rate(patch_t* restrict p, const double*
|
|
195
196
|
|
196
197
|
switch(loc) {
|
197
198
|
case MIG_UP:
|
198
|
-
p_U_weight[MIG_UP] =
|
199
|
-
p_V_weight[MIG_UP] =
|
199
|
+
p_U_weight[MIG_UP] = exp(w1_Upi);
|
200
|
+
p_V_weight[MIG_UP] = exp(w2_Vpi);
|
200
201
|
break;
|
201
202
|
case MIG_DOWN:
|
202
|
-
p_U_weight[MIG_DOWN] =
|
203
|
-
p_V_weight[MIG_DOWN] =
|
203
|
+
p_U_weight[MIG_DOWN] = exp(w1_Upi);
|
204
|
+
p_V_weight[MIG_DOWN] = exp(w2_Vpi);
|
204
205
|
break;
|
205
206
|
case MIG_LEFT:
|
206
|
-
p_U_weight[MIG_LEFT] =
|
207
|
-
p_V_weight[MIG_LEFT] =
|
207
|
+
p_U_weight[MIG_LEFT] = exp(w1_Upi);
|
208
|
+
p_V_weight[MIG_LEFT] = exp(w2_Vpi);
|
208
209
|
break;
|
209
210
|
default:
|
210
|
-
p_U_weight[MIG_RIGHT] =
|
211
|
-
p_V_weight[MIG_RIGHT] =
|
211
|
+
p_U_weight[MIG_RIGHT] = exp(w1_Upi);
|
212
|
+
p_V_weight[MIG_RIGHT] = exp(w2_Vpi);
|
212
213
|
break;
|
213
214
|
}
|
214
215
|
p->sum_U_weight += p_U_weight[loc];
|
@@ -255,8 +256,8 @@ static inline uint8_t init_mig(patch_t* restrict p, const double* restrict P_sta
|
|
255
256
|
if (w2_Vpi > EXP_OVERFLOW_BOUND) {
|
256
257
|
return SIM_OVERFLOW;
|
257
258
|
}
|
258
|
-
p_U_weight[i] =
|
259
|
-
p_V_weight[i] =
|
259
|
+
p_U_weight[i] = exp(w1_Upi);
|
260
|
+
p_V_weight[i] = exp(w2_Vpi);
|
260
261
|
|
261
262
|
p->sum_U_weight += p_U_weight[i];
|
262
263
|
p->sum_V_weight += p_V_weight[i];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = '2.3.
|
1
|
+
__version__ = '2.3.4'
|
2
2
|
|
3
3
|
'''
|
4
4
|
version history:
|
@@ -40,4 +40,5 @@ version history:
|
|
40
40
|
2.3.2: allow play-with-self in payoff calculation. Changed migration function to e^(w*pi) (removed "1+" term).
|
41
41
|
Simplified update-migration functions, improve speed by ~10%. Add -march=native flag to Makefile.
|
42
42
|
2.3.3: fix error in calculation of migration rates.
|
43
|
+
2.3.4: change back to the mig & payoff rules in version 2.3.2
|
43
44
|
'''
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|