forked from ShuhuaGao/gpFlappyBird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
40 lines (34 loc) · 1.09 KB
/
settings.py
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
"""
Define some constant parameters and program settings.
"""
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 500
TITLE = 'Flappy Bird AI via Evolutionary Cartesian Genetic Programming'
FPS = 60
IMG_DIR = './img'
SND_DIR = './snd'
FONT_NAME = 'Arial'
FONT_SIZE = 20
WHITE = (255, 255, 255)
JUMP_SPEED = -3.5 # once the bird flaps, its speed becomes this value
GRAVITY_ACC = 0.35
BIRD_X_SPEED = 3 # the const horizontal speed of the bird
BIRD_MAX_Y_SPEED = 5 # the maximum downward speed
# horizontal space between two adjacent pairs of pipes
MIN_PIPE_SPACE = 165
MAX_PIPE_SPACE = 300
# gap (vertical space) between a pair of pipes
MIN_PIPE_GAP = 95
MAX_PIPE_GAP = 120
# minimum length of a pipe
MIN_PIPE_LENGTH = 100
# parameters of cartesian genetic programming
MUT_PB = 0.015 # mutate probability
N_COLS = 500 # number of cols (nodes) in a single-row CGP
LEVEL_BACK = 500 # how many levels back are allowed for inputs in CGP
# parameters of evolutionary strategy: MU+LAMBDA
MU = 2
LAMBDA = 8
N_GEN = 200 # max number of generations
# if True, then additional information will be printed
VERBOSE = False