pythonfuzzy-logicskfuzzy

'<' not supported between instances of 'numpy.ndarray' and 'str'


im doing a project about temperature and humidify control system. Im using skfuzzy as tool. I met some errors, after i try to edit with my own preference.

fanspeed = ctrl.ControlSystemSimulation(fanspeed_ctrl)

fanspeed.input['temperature'] = 40
fanspeed.input['humidify'] = 10

fanspeed.compute()
fanspeed.output['fan']
fan.view(sim=fanspeed)
print("Fan speed =",fanspeed.output['fan'])

Code above is working well but when i want it to accept user input instead of put the input in the code, so i try to change like this

fanspeed = ctrl.ControlSystemSimulation(fanspeed_ctrl)

temp = input("temp=")
hum = input("hum=")
fanspeed.input['temperature'] = temp
fanspeed.input['humidify'] = hum
fanspeed.compute()
fanspeed.output['fan']
fan.view(sim=fanspeed)
print("Fan speed =",fanspeed.output['fan'])

Anyone can give some advice will be nice :D Thanksssss


Solution

  • User input is str type. use temp = int(input("temp=")) and hum = int(input("hum="))