Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyConditioner < Conditioner
- end
- class MyHeater < Heater
- def set_tact new_tact
- @tact = new_tact
- end
- def tact #для проверки
- @tact
- end
- end
- class MyClimateControl < ClimateControl
- def check_heater
- if @home.temperature > @heater_start # если превышен темп. барьер
- @home.heater[0].set_off # не уверена, что будет работать
- @home.heater[1].set_off # не уверена, что будет работать
- else
- # @home.heater.set_on # перевести в режим работы
- if @home.temperature + 4 < @heater_start
- @home.heater[1].set_on
- else
- @home.heater[0].set_on
- end
- end
- end
- end
- class MyReporter < Reporter
- def heater_status_s
- "heater 1: " + bool_to_on_off_s(@home.heater[0].status)
- "heater 2: " + bool_to_on_off_s(@home.heater[1].status)
- end
- end
- class MyWeather < Weather
- end
- class MyCyclon < Cyclon
- MyCyclons = Cyclons + [[-2.8, -2.1, -1.4, -0.7, 0, 0.7, 1.4, 2.1]]
- end
- class MyGlasshouse < Glasshouse
- def set_glasshouse
- @conditioner = MyConditioner.new self
- @heater = [MyHeater.new(self), MyHeater.new(self)]
- @heater[0] = @heater[0].set_tact(0.4)
- @heater[1] = @heater[1].set_tact(0.2)
- @climate_control = MyClimateControl.new(self, 15, 25)
- @reporter = MyReporter.new self
- end
- end
Add Comment
Please, Sign In to add comment