events.py 638 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. import scipy.io as sio
  3. from app.core.config import settings
  4. q_learning_models = {}
  5. ahu_supply_air_temp_set_dict = {}
  6. async def load_q_learning_model():
  7. base_path = settings.PROJECT_DIR
  8. summer_model_path = (
  9. f"{base_path}/app/resources/ml_models/equipment/fcu/q_learning/net_1_summer.mat"
  10. )
  11. winter_model_path = (
  12. f"{base_path}/app/resources/ml_models/equipment/fcu/q_learning/net_1_winter.mat"
  13. )
  14. q_learning_models.update({"summer": sio.loadmat(summer_model_path)["net"][0, 0][0]})
  15. q_learning_models.update({"winter": sio.loadmat(winter_model_path)["net"][0, 0][0]})