A fog-based hybrid intelligent system for energy saving in smart buildings