This commit is contained in:
Kacper 2022-06-10 02:16:56 +02:00
parent 4a5676884c
commit d7c2e446a3
5 changed files with 62 additions and 36 deletions

View File

@ -16,28 +16,6 @@
| | | | | |--- feature_1 <= 2.50 | | | | | |--- feature_1 <= 2.50
| | | | | | |--- feature_0 <= 2.50 | | | | | | |--- feature_0 <= 2.50
| | | | | | | |--- feature_1 <= 1.50 | | | | | | | |--- feature_1 <= 1.50
| | | | | | | | |--- feature_2 <= 2.50
| | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_2 > 2.50
| | | | | | | | | |--- feature_4 <= 2.00
| | | | | | | | | | |--- class: 1
| | | | | | | | | |--- feature_4 > 2.00
| | | | | | | | | | |--- class: 0
| | | | | | | |--- feature_1 > 1.50
| | | | | | | | |--- class: 0
| | | | | | |--- feature_0 > 2.50
| | | | | | | |--- feature_4 <= 2.50
| | | | | | | | |--- class: 1
| | | | | | | |--- feature_4 > 2.50
| | | | | | | | |--- feature_2 <= 2.50
| | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_2 > 2.50
| | | | | | | | | |--- class: 0
| | | | | |--- feature_1 > 2.50
| | | | | | |--- feature_0 <= 3.50
| | | | | | | |--- class: 0
| | | | | | |--- feature_0 > 3.50
| | | | | | | |--- feature_1 <= 3.50
| | | | | | | | |--- feature_4 <= 2.50 | | | | | | | | |--- feature_4 <= 2.50
| | | | | | | | | |--- class: 1 | | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_4 > 2.50 | | | | | | | | |--- feature_4 > 2.50
@ -45,8 +23,30 @@
| | | | | | | | | | |--- class: 1 | | | | | | | | | | |--- class: 1
| | | | | | | | | |--- feature_2 > 2.00 | | | | | | | | | |--- feature_2 > 2.00
| | | | | | | | | | |--- class: 0 | | | | | | | | | | |--- class: 0
| | | | | | | |--- feature_1 > 3.50 | | | | | | | |--- feature_1 > 1.50
| | | | | | | | |--- class: 0 | | | | | | | | |--- class: 0
| | | | | | |--- feature_0 > 2.50
| | | | | | | |--- feature_2 <= 2.50
| | | | | | | | |--- class: 1
| | | | | | | |--- feature_2 > 2.50
| | | | | | | | |--- feature_4 <= 2.50
| | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_4 > 2.50
| | | | | | | | | |--- class: 0
| | | | | |--- feature_1 > 2.50
| | | | | | |--- feature_1 <= 3.50
| | | | | | | |--- feature_0 <= 3.50
| | | | | | | | |--- class: 0
| | | | | | | |--- feature_0 > 3.50
| | | | | | | | |--- feature_4 <= 2.50
| | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_4 > 2.50
| | | | | | | | | |--- feature_2 <= 2.00
| | | | | | | | | | |--- class: 1
| | | | | | | | | |--- feature_2 > 2.00
| | | | | | | | | | |--- class: 0
| | | | | | |--- feature_1 > 3.50
| | | | | | | |--- class: 0
| | | | |--- feature_3 > 4.50 | | | | |--- feature_3 > 4.50
| | | | | |--- class: 0 | | | | | |--- class: 0
| |--- feature_4 > 3.50 | |--- feature_4 > 3.50
@ -59,13 +59,13 @@
| | | | | | |--- class: 1 | | | | | | |--- class: 1
| | | | |--- feature_3 > 3.50 | | | | |--- feature_3 > 3.50
| | | | | |--- feature_1 <= 2.50 | | | | | |--- feature_1 <= 2.50
| | | | | | |--- feature_0 <= 2.50 | | | | | | |--- feature_3 <= 4.50
| | | | | | | |--- class: 0 | | | | | | | |--- feature_0 <= 2.50
| | | | | | |--- feature_0 > 2.50
| | | | | | | |--- feature_3 <= 4.50
| | | | | | | | |--- class: 1
| | | | | | | |--- feature_3 > 4.50
| | | | | | | | |--- class: 0 | | | | | | | | |--- class: 0
| | | | | | | |--- feature_0 > 2.50
| | | | | | | | |--- class: 1
| | | | | | |--- feature_3 > 4.50
| | | | | | | |--- class: 0
| | | | | |--- feature_1 > 2.50 | | | | | |--- feature_1 > 2.50
| | | | | | |--- class: 0 | | | | | | |--- class: 0
| | | |--- feature_4 > 4.50 | | | |--- feature_4 > 4.50
@ -76,13 +76,13 @@
| |--- feature_4 <= 1.50 | |--- feature_4 <= 1.50
| | |--- feature_1 <= 1.50 | | |--- feature_1 <= 1.50
| | | |--- feature_2 <= 4.50 | | | |--- feature_2 <= 4.50
| | | | |--- feature_0 <= 1.50 | | | | |--- feature_3 <= 4.50
| | | | | |--- class: 0 | | | | | |--- feature_0 <= 1.50
| | | | |--- feature_0 > 1.50
| | | | | |--- feature_3 <= 4.50
| | | | | | |--- class: 1
| | | | | |--- feature_3 > 4.50
| | | | | | |--- class: 0 | | | | | | |--- class: 0
| | | | | |--- feature_0 > 1.50
| | | | | | |--- class: 1
| | | | |--- feature_3 > 4.50
| | | | | |--- class: 0
| | | |--- feature_2 > 4.50 | | | |--- feature_2 > 4.50
| | | | |--- class: 0 | | | | |--- class: 0
| | |--- feature_1 > 1.50 | | |--- feature_1 > 1.50

Binary file not shown.

View File

@ -4,7 +4,7 @@ from decision_tree import decisionTree
# klasa tworząca miasta czy też śmietniki # klasa tworząca miasta czy też śmietniki
class City: class City:
def __init__(self, x, y, dist): def __init__(self, x, y):
self.x = x self.x = x
self.y = y self.y = y
# self.dist = distance # self.dist = distance

BIN
last_map.nparr Normal file

Binary file not shown.

View File

@ -0,0 +1,26 @@
import math
from path_search_algorthms import a_star
from settings import *
def get_actions_by_coords(x, y, game):
# print('get_actions_by_coords')
# print(x, y, x/TILESIZE, y/TILESIZE)
offset_x, offset_y = game.camera.offset()
# print('offset ' + str(self.camera.offset()))
clicked_coords = [math.floor(x / TILESIZE) - offset_x, math.floor(y / TILESIZE) - offset_y]
# print(self.player.pos[0], self.player.pos[1], clicked_coords)
actions = a_star.search_path(math.floor(game.player.pos[0] / TILESIZE),
math.floor(game.player.pos[1] / TILESIZE), game.player.rotation(),
clicked_coords[0], clicked_coords[1], game.mapArray)
return actions
def get_actions_for_target_coords(x, y, game):
actions = a_star.search_path(
math.floor(game.player.pos[0] / TILESIZE),
math.floor(game.player.pos[1] / TILESIZE),
game.player.rotation(),
x / TILESIZE,
y / TILESIZE,
game.mapArray
)
return actions