Simulation and Optimization of Energy Requirements for Livestock Housing