Traktor/config.py

117 lines
2.9 KiB
Python
Raw Permalink Normal View History

2021-03-16 10:06:56 +01:00
#!/usr/bin/python3
import os
2021-03-16 10:06:56 +01:00
__all__ = (
2021-04-13 09:55:19 +02:00
'WIDTH', 'HEIGHT', 'FIELD_SIZE', 'TIME_OF_MOVING',
2021-03-16 10:06:56 +01:00
'VERTICAL_NUM_OF_FIELDS', 'HORIZONTAL_NUM_OF_FIELDS',
2021-05-05 16:59:41 +02:00
'FPS', 'CAPTION', 'RESOURCE_DIR', 'MAP_DIR', 'TRACTOR', 'PNG',
'SAND', 'CLAY', 'GRASS', 'CORN', 'SUNFLOWER',
2021-04-13 09:55:19 +02:00
'FIELD_TYPES', 'TIME_OF_GROWING', 'AMOUNT_OF_CROPS',
'M_GO_FORWARD', 'M_ROTATE_LEFT', 'M_ROTATE_RIGHT',
2021-06-23 11:07:35 +02:00
'S_AUTUMN', 'S_SPRING', 'S_SUMMER', 'S_WINTER', 'TYPES_OF_SEASON',
'W_SUNNY', 'W_CLOUDY', 'W_SNOW', 'W_RAINY', 'TYPES_OF_WEATHER',
2021-04-13 09:55:19 +02:00
'A_SOW', 'A_HARVEST', 'A_HYDRATE', 'A_FERTILIZE', 'A_DO_NOTHING',
2021-06-23 11:07:35 +02:00
'TYPES_OF_ACTION', 'D_NORTH', 'D_EAST', 'D_SOUTH', 'D_WEST',
2021-05-05 16:59:41 +02:00
'VALUE_OF_CROPS', 'VALUE_OF_PLANT', 'VALUE_OF_SAND', 'VALUE_OF_CLAY',
'MAP_FILE_NAME', 'JSON', 'SAVE_MAP', 'LOAD_MAP', 'AUTO_MODE',
2021-06-23 11:07:35 +02:00
'TRAINING_SET_DIR', 'TEST_SET_DIR', 'ADAPTED_IMG_DIR', 'MODEL_DIR',
'DATA_DIR','IMG_DECISION_TREE','MODEL_TREE_FILENAME','DATA_TRAINING_FOR_DECISION_TREE'
2021-03-16 10:06:56 +01:00
)
# Board settings:
VERTICAL_NUM_OF_FIELDS = 9
HORIZONTAL_NUM_OF_FIELDS = 12
2021-03-16 13:27:39 +01:00
FIELD_SIZE = 60
2021-03-16 10:06:56 +01:00
WIDTH = HORIZONTAL_NUM_OF_FIELDS * FIELD_SIZE
HEIGHT = VERTICAL_NUM_OF_FIELDS * FIELD_SIZE
# Other settings
FPS = 10
CAPTION = 'Tractor'
# Paths
BASE_DIR = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(BASE_DIR, 'resources')
2021-05-05 16:59:41 +02:00
MAP_DIR = os.path.join(BASE_DIR, 'maps')
2021-06-23 11:07:35 +02:00
DATA_DIR = os.path.join(BASE_DIR, 'data')
2021-05-05 16:59:41 +02:00
MAP_FILE_NAME = 'map'
TRAINING_SET_DIR = os.path.join(RESOURCE_DIR, 'smaller_train')
TEST_SET_DIR = os.path.join(RESOURCE_DIR, 'smaller_test')
2021-06-02 01:38:22 +02:00
ADAPTED_IMG_DIR = os.path.join(RESOURCE_DIR, "adapted_images")
MODEL_DIR = os.path.join(RESOURCE_DIR, 'saved_model')
2021-06-23 11:07:35 +02:00
MODEL_TREE_FILENAME = 'tree_model.joblib'
IMG_DECISION_TREE = 'decision_tree.png'
DATA_TRAINING_FOR_DECISION_TREE = 'data_training.csv'
# Picture format
PNG = "png"
2021-05-05 16:59:41 +02:00
# File format
JSON = 'json'
# Tractor settings
TRACTOR = 'tractor'
# Types of Fields
SAND = 'sand'
CLAY = 'clay'
GRASS = 'grass'
CORN = 'corn'
SUNFLOWER = 'sunflower'
FIELD_TYPES = (SAND, CLAY, GRASS, CORN, SUNFLOWER)
2021-04-13 09:55:19 +02:00
# Directions
2021-04-13 10:40:56 +02:00
D_NORTH = 0.0
D_EAST = 270.0
D_SOUTH = 180.0
D_WEST = 90.0
2021-04-13 09:55:19 +02:00
# Goal Test
AMOUNT_OF_CROPS = 5
# Movements:
M_GO_FORWARD = "go forward"
M_ROTATE_LEFT = "rotate left"
M_ROTATE_RIGHT = "rotate right"
# Actions:
A_SOW = "sow"
A_HARVEST = "harvest"
A_HYDRATE = "hydrate"
A_FERTILIZE = "fertilize"
A_DO_NOTHING = "do nothing"
2021-06-23 11:07:35 +02:00
TYPES_OF_ACTION = [A_SOW, A_HARVEST, A_HYDRATE, A_FERTILIZE, A_DO_NOTHING]
2021-04-13 09:55:19 +02:00
2021-04-28 08:50:58 +02:00
# Costs fields:
VALUE_OF_CROPS = 0.2
VALUE_OF_PLANT = 0.3
VALUE_OF_SAND = 0.4
VALUE_OF_CLAY = 0.5
2021-04-27 21:40:59 +02:00
2021-06-23 11:07:35 +02:00
# Weather
W_SUNNY = 'Sunny'
W_CLOUDY = 'Cloudy'
W_SNOW = 'Snow'
W_RAINY = 'Rainy'
TYPES_OF_WEATHER = [W_SUNNY, W_CLOUDY, W_SNOW, W_RAINY]
# Seasons
S_AUTUMN = 'Autumn'
S_WINTER = 'Winter'
S_SPRING = 'Spring'
S_SUMMER = 'Summer'
TYPES_OF_SEASON = [S_AUTUMN, S_WINTER, S_SPRING, S_SUMMER]
# Times
TIME_OF_GROWING = 2
2021-04-13 09:55:19 +02:00
TIME_OF_MOVING = 2
2021-05-05 16:59:41 +02:00
# Args
SAVE_MAP = '--save-map'
LOAD_MAP = '--load-map'
AUTO_MODE = '--auto-mode'