AI_PRO/convertToPrediction.py
2021-05-19 04:53:19 +02:00

55 lines
1.4 KiB
Python

def convert(field_state, weather, day_time, temperature, wind, humidy):
field_value = 0
weather_value = 0
day_time_value = 0
temperature_value = 0
wind_value = 0
humidy_value = 0
if field_state == "toPlow":
field_value = 0
elif field_state == "toWater":
field_value = 1
elif field_state == "toSeed":
field_value = 2
elif field_state == "toFertilize":
field_value = 3
elif field_state == "toCut":
field_value = 4
if weather == "Clear Sky":
weather_value = 0
elif weather == "Cloudy":
weather_value = 1
elif weather == "Rainy":
weather_value = 2
elif weather == "Hail":
weather_value = 3
if day_time == "Night":
day_time_value = 0
elif day_time == "Day":
day_time_value = 1
if temperature == "Freezing":
temperature_value = 0
elif temperature == "Cold":
temperature_value = 1
elif temperature == "Mild":
temperature_value = 2
elif temperature == "Hot":
temperature_value = 3
if wind == "Windless":
wind_value = 0
elif wind == "Strong Wind":
wind_value = 1
elif wind == "Gale":
wind_value = 2
if humidy == "Low":
humidy_value = 0
elif humidy == "High":
humidy_value = 1
return field_value, weather_value, day_time_value, temperature_value, wind_value, humidy_value