This: -fixed a bug where tractor_water_level and move delay was called in wrong place

This commit is contained in:
jakzar 2024-05-12 17:34:27 +02:00
parent 0b494d694d
commit 9ebac46bef

View File

@ -173,10 +173,12 @@ class Tractor:
attributes=self.get_attributes() attributes=self.get_attributes()
decision = drzewo.makeDecision(attributes) decision = drzewo.makeDecision(attributes)
self.pretty_print_tree([str("({:02d}, {:02d})").format(self.slot.x_axis, self.slot.y_axis),decision,*self.get_attributes_for_print()]) self.pretty_print_tree([str("({:02d}, {:02d})").format(self.slot.x_axis, self.slot.y_axis),decision,*self.get_attributes_for_print()])
if decision == "Podlewac": if decision == "Tak":
self.slot.irrigatePlant() self.slot.irrigatePlant()
counter += 1 counter += 1
condition.cycle() condition.cycle()
pygame.time.delay(50)
self.waterLevel=random.randint(0,100)
#condition.getCondition() #condition.getCondition()
self.move_forward(pole, False) self.move_forward(pole, False)
if i % 2 == 0 and i != dCon.NUM_Y - 1: if i % 2 == 0 and i != dCon.NUM_Y - 1:
@ -187,7 +189,6 @@ class Tractor:
self.turn_left() self.turn_left()
self.move_forward(pole, False) self.move_forward(pole, False)
self.turn_left() self.turn_left()
pygame.time.delay(50)
print("podlanych slotów: ", str(counter)) print("podlanych slotów: ", str(counter))
def snake_move(self,pole,x,y): def snake_move(self,pole,x,y):