Merge old branches to refactor due to merge it with master #22

Merged
s481825 merged 20 commits from tree into refactor 2024-06-04 11:36:14 +02:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit d2d7a98a84 - Show all commits

View File

@ -1,5 +1,6 @@
import random import random
import Climate import Climate
import Ui
class Condition: class Condition:
def __init__(self): def __init__(self):
@ -44,4 +45,3 @@ class Condition:
def getCondition(self): def getCondition(self):
print(f"Aktualny czas: {Climate.time[self.currentTime]},opady: {Climate.rain[self.rain]},temperatura: {Climate.temperature[self.temperature]}, pora roku: {Climate.seasons[self.season]}") print(f"Aktualny czas: {Climate.time[self.currentTime]},opady: {Climate.rain[self.rain]},temperatura: {Climate.temperature[self.temperature]}, pora roku: {Climate.seasons[self.season]}")

View File

@ -22,4 +22,7 @@ class Drzewo:
plt.show() plt.show()
def makeDecision(self,values): def makeDecision(self,values):
action=self.tree.predict([values]) #0- nie podlewac, 1-podlewac action=self.tree.predict([values]) #0- nie podlewac, 1-podlewac
return action if(action==[0]):
return "Nie podlewac"
if(action==[1]):
return "Podlewac"

View File

@ -71,7 +71,7 @@ class Tractor:
attributes=[] attributes=[]
attributes=attributes+slot_attributes+[self.waterLevel]+climate_attributes attributes=attributes+slot_attributes+[self.waterLevel]+climate_attributes
print("Decyzja czy podlac:",drzewo.makeDecision(attributes),"Atrybuty tego stanu to:",attributes) print("Decyzja czy podlac:",drzewo.makeDecision(attributes),"Atrybuty tego stanu to:",attributes)
#TODO SNAKE MOVE AND USING drzewo.makeDecision(attributes)for each slot. Also we need to cycle climate for each slot change by #TODO SNAKE MOVE AND USING drzewo.makeDecision(attributes)for each slot. Also we need to cycle climate for each slot change
#condition.cycle() #condition.cycle()
#condition.getCondition() #condition.getCondition()
def turn_right(self): def turn_right(self):