This: -changed decision from int to string values
This commit is contained in:
parent
b377c5ea24
commit
d2d7a98a84
@ -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]}")
|
||||||
|
|
@ -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"
|
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user