From d2abac6ebd86b0898f325f00765999e8c6dcbf76 Mon Sep 17 00:00:00 2001 From: tafit0902 Date: Sun, 26 May 2024 01:55:40 +0200 Subject: [PATCH] roslina umiera po zlym nawiezieniu --- Tractor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tractor.py b/Tractor.py index 1312092..21744ac 100644 --- a/Tractor.py +++ b/Tractor.py @@ -194,11 +194,15 @@ class Tractor: def snake_move_predict_plant(self, pole, model): initPos = (self.slot.x_axis, self.slot.y_axis) + count = 0 for i in range(initPos[1], dCon.NUM_Y): for j in range(initPos[0], dCon.NUM_X): if self.slot.imagePath != None: predictedLabel = nn.predictLabel(self.slot.imagePath, model) print(str("Coords: ({:02d}, {:02d})").format(self.slot.x_axis, self.slot.y_axis), "real:", self.slot.label, "predicted:", predictedLabel, "correct" if (self.slot.label == predictedLabel) else "incorrect", 'nawożę za pomocą:', nn.fertilizer[predictedLabel]) + if self.slot.label != predictedLabel: + self.slot.mark_visited() + count += 1 self.move_forward(pole, False) if i % 2 == 0 and i != dCon.NUM_Y - 1: self.turn_right() @@ -208,6 +212,7 @@ class Tractor: self.turn_left() self.move_forward(pole, False) self.turn_left() + print(f"źle nawiezionych roślin: {count}") def snake_move(self,pole,x,y): next_slot_coordinates=(x,y)