-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrec_defs.h
47 lines (37 loc) · 939 Bytes
/
rec_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* rec_defs.h
* D. Schwilk 2000
* Definitions and helper functions for the Recombination project
*/
#include <algorithm>
#include <iostream>
#define GRID_SIZE 150
#define N_SEEDS 4
#define N_ALLELES 25
#define MORTALITY_RATE 0.1
#define _R_ 0.5
#define _r_ 0.05
#define INITIAL_TORCH_PROP 0.00
#define MUTATION_RATE 0.0001
#define BURN_NEIGHBORHOOD 1
#define SEED_NEIGHBORHOOD 1
#define POLLEN_NEIGHBORHOOD 1
#define ENV_CHANGE_PERIOD 8
#define LIGHTNING 0.01
#define MUTATE_FLIP 1 // determines environment mutation type, bit flip or random
#define N_ENV_CHANGE_LOCI 1 // number of loci to change each period
namespace DWS {
template<class T> struct print : public std::unary_function<T, void>
{
print(std::ostream& out) : os(out), count(0) {}
void operator() (T x) { os << x << ' '; ++count; }
std::ostream& os;
int count;
};
template <class T>
inline void swap(T &a, T &b)
{
T c = a;
a=b;
b=c;
}
}; // namespace