-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
69 lines (51 loc) · 1.39 KB
/
common.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <list>
#include <thread>
#include <mutex>
#include <algorithm>
#ifndef COMMON_H
#define COMMON_H
const int WINDOW_WIDTH = 800;
const int WINDOW_HEIGHT = 400;
const bool GROW_OR_DIE = true;
const int WORLD_LENGTH = 200;
const int MAX_CELLS = 30;
const int MAX_CREATURE_AGE = 30;
const bool CONTRAINT_NEED_SUN = true;
const float MIN_ENERGY_PER_CELL = .5;
const float SUNLIGHT_LOSS_RATIO = 0.15;
const bool CONSTRAINT_BALANCING = true;
const int BALANCING_THRESHOLD = 6*6;
const bool LOCALITY_ENABLED = true;
const int LOCALITY_RADIUS = 8;
const bool PROGRESSIVE_DNA = false;
const float REPRODUCTION_RATE = 0.1;
const float MUTATION_RATE = 0.01;
// 2.5 = attempt to create on average 2.5 species per cycle
// <=> 2 attempts ; and another one with 50% chances
const float SPONANEOUS_SPECIES_PER_CYCLE = 1.0;
const int NB_THREADS = 3;
const bool DEBUG = false;
const bool OUT_SUMMARY = false;
const bool LOG_SPECIES_EXTINCTION_CAUSES = false;
const long UPDATE_UI_EVERY_CYCLES = 300;
#include "utils.h"
using namespace std;
class World;
class Species;
class Creature;
class Cell;
class CellRegistry;
class Timer;
class Clocks;
extern World world;
extern Clocks CLOCKS;
const int CLOCK_LIFECYCLE = 10;
const int CLOCK_DEATH = 0;
const int CLOCK_REPRODUCTION = 1;
const int CLOCK_GROWTH = 2;
const int CLOCK_SUNSHINE = 4;
#endif