fix path #26

Merged
s462072 merged 1 commits from decision_tree_trashbins into master 2022-05-13 12:47:36 +02:00
7 changed files with 1273 additions and 20 deletions
Showing only changes of commit f258750c1c - Show all commits

View File

@ -9,7 +9,7 @@ attributes = ["season", "trash_type", "mass", "space", "trash_mass"]
# return tree made from attributes
def tree():
dataset = pandas.read_csv('/Users/mac/Desktop/tree_dataset.csv', sep=";")
dataset = pandas.read_csv('decision_tree/tree_dataset.csv', sep=";")
x = dataset[attributes]
y = dataset[decisions]

View File

@ -4,12 +4,12 @@
| | | |--- class: 0
| | |--- feature_0 > 1.50
| | | |--- feature_3 <= 3.50
| | | | |--- feature_2 <= 2.50
| | | | |--- feature_4 <= 2.50
| | | | | |--- class: 1
| | | | |--- feature_2 > 2.50
| | | | | |--- feature_4 <= 2.50
| | | | |--- feature_4 > 2.50
| | | | | |--- feature_2 <= 2.50
| | | | | | |--- class: 1
| | | | | |--- feature_4 > 2.50
| | | | | |--- feature_2 > 2.50
| | | | | | |--- class: 0
| | | |--- feature_3 > 3.50
| | | | |--- feature_3 <= 4.50
@ -26,12 +26,12 @@
| | | | | | | |--- feature_1 > 1.50
| | | | | | | | |--- class: 0
| | | | | | |--- feature_0 > 2.50
| | | | | | | |--- feature_4 <= 2.50
| | | | | | | |--- feature_2 <= 2.50
| | | | | | | | |--- class: 1
| | | | | | | |--- feature_4 > 2.50
| | | | | | | | |--- feature_2 <= 2.50
| | | | | | | |--- feature_2 > 2.50
| | | | | | | | |--- feature_4 <= 2.50
| | | | | | | | | |--- class: 1
| | | | | | | | |--- feature_2 > 2.50
| | | | | | | | |--- feature_4 > 2.50
| | | | | | | | | |--- class: 0
| | | | | |--- feature_1 > 2.50
| | | | | | |--- feature_0 <= 3.50
@ -73,8 +73,8 @@
| | |--- feature_2 > 1.50
| | | |--- class: 0
|--- feature_2 > 3.50
| |--- feature_1 <= 1.50
| | |--- feature_4 <= 1.50
| |--- feature_4 <= 1.50
| | |--- feature_1 <= 1.50
| | | |--- feature_2 <= 4.50
| | | | |--- feature_3 <= 4.50
| | | | | |--- feature_0 <= 1.50
@ -85,7 +85,7 @@
| | | | | |--- class: 0
| | | |--- feature_2 > 4.50
| | | | |--- class: 0
| | |--- feature_4 > 1.50
| | |--- feature_1 > 1.50
| | | |--- class: 0
| |--- feature_1 > 1.50
| |--- feature_4 > 1.50
| | |--- class: 0

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -19,6 +19,7 @@ class aiPlayer():
self.game.draw()
# print(self.player.get_actual_coords())
def turn_left(self):
change = int(self.player.rotation()) - 1
if(change == -1):

11
main.py
View File

@ -113,16 +113,17 @@ class Game():
self.negative_decision.append(i)
self.negative_actions.append(i)
# j = 0
# for i in self.positive_actions:
# print(f"step {j} actions is : {i}")
# j+=1
for i in self.positive_actions:
print('----')
print(i)
print('----')
# vec = pg.math.Vector2
# for i in self.positive_actions:
# self.t.startAiController(i)
# self.player.update()
# self.player.pos = vec(32, 32)
# self.player.update()
self.t.startAiController(self.positive_actions[0])