From b7b9e8e97ce11d099075ab7d4f221d848ac4d70c Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Fri, 19 May 2023 15:49:17 +0200 Subject: [PATCH] changes --- decisionTree/decision_tree_model.pkl | Bin 2249 -> 1897 bytes decisionTree/prepare.py | 2 +- domain/commands/vacuum_move_command.py | 10 ++++++---- domain/entities/garbage.py | 2 +- domain/world.py | 7 +++---- main.py | 2 ++ 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/decisionTree/decision_tree_model.pkl b/decisionTree/decision_tree_model.pkl index 20bfa43d45f0d5a7063ccf3eb0062beee452ce67..46c6a169f5ef18219f08c8abce7d5a44739f017a 100644 GIT binary patch delta 400 zcmX>p_>zyMfn}=JMiwi^$^OhblLHx}WSLs0^swd^rKA>3>0xvRvQtVb3sR?K$Ydx_ zo-%nVvkG4iS7J_1etCRuZeqcdj>*3ml^D4uA7c(-RG%!(;$kKdS^s>D*$O9piT`S?F-}^v`s1Xw(yo=^cDbG0QZ*w%wHgS^BGot dCM7g4c{6%5wZj4=60C9ZU-sjyMpH_Y^Zl#p?x)&0%yG%PI`@>mwV=y(X z7eI-7H^Ze5VSEVVV|eLP=&(ezJs0zRlXJe4^Y?4{M^-+UC)uy^bCk^<6C((H(sB)l z^jaO4QS`2w8t^FT`EBC!2ptIC4*FffX^w6&9^q=4k1s~N##Jp5p;KO|R1SX&iy!Sp zz|BZ8Y}oX`$BhVL7FrR5XLb9;dwT7d%6EJ|_P zGcO=b8UVIhme(d$Pa*D2PGRM0Cy+76O~|UcEHw4b2Ldy(5LL4yuMqfO>I;78zN2>cqIN$hCI~DVpAD$HS+@HZ??RG^H=H-QF!!s2F*B_ NeOdUP+~c8H_yf 0: + for t in tmp: + if self.vacuum.get_container_filling() < 1000: + self.vacuum.increase_container_filling() + self.world.dust[end_x][end_y].remove(t) if self.world.is_docking_station_at(end_x, end_y): self.vacuum.dump_trash() diff --git a/domain/entities/garbage.py b/domain/entities/garbage.py index 2273cc7..f451dd1 100644 --- a/domain/entities/garbage.py +++ b/domain/entities/garbage.py @@ -6,6 +6,6 @@ class Garbage(Entity): super().__init__(x, y, "PEEL") self.wet = False self.size = 0 - self.props = [2,2,0,0,1,5,24,1] + self.props = [2,2,0,0,1,4,24,1] # TODO GARBAGE: add more properties diff --git a/domain/world.py b/domain/world.py index b46eb44..fd72812 100644 --- a/domain/world.py +++ b/domain/world.py @@ -32,11 +32,10 @@ class World: def is_obstacle_at(self, x: int, y: int) -> bool: return bool(self.obstacles[x][y]) - def is_garbage_at(self, x: int, y: int) -> bool: + def is_garbage_at(self, x: int, y: int): if len(self.dust[x][y]) == 0: - return False - tmp = evaluate([self.dust[x][y][0].props]) - return bool(tmp[0]) + return [] + return [i for i in self.dust[x][y] if evaluate([i.props])[0] == 1] def is_docking_station_at(self, x: int, y: int) -> bool: return bool(self.doc_station.x == x and self.doc_station.y == y) diff --git a/main.py b/main.py index 80fbe71..03e2830 100644 --- a/main.py +++ b/main.py @@ -150,7 +150,9 @@ def generate_world(tiles_x: int, tiles_y: int) -> World: world.add_entity(Entity(3, 4, "PLANT2")) world.add_entity(Entity(8, 8, "PLANT2")) world.add_entity(Entity(9, 3, "PLANT3")) + world.add_entity(Earring(9, 7)) world.add_entity(Earring(5, 5)) + world.add_entity(Earring(4, 6)) for x in range(world.width):