A Genetic Algorithm (GA) is an optimization process inspired by natural systems ability of surviving in many different environments through the mechanisms of natural selection and genetics. The pairing of GA-based optimization techniques with dynamic energy models is a common and effective practice to find energy efficient design solutions. In this paper is implemented an optimization tool that use a GA and a dynamic energy model. Efficiency of GAs depends largely on the coding strategy and on the parameters selection. In order to test the code and to find the best combination of parameters, a parametric analysis of GA's performances is carried out. The algorithm, coded in Matlab, works with populations of strings. Each string, that represents a complete design solution, is initially randomly generated by the GA and evaluated in terms of energy performances by the dynamic thermal simulator. A new population is then generated using three different GA stochastic operators: reproduction, crossover and mutation, by selecting, mixing and randomly modifying the fittest solutions of the previous generation. Each generation is energetically evaluated and thus the fitness of the strings, that represent the energy efficiency of the design solutions, improves every cycle till eventually converge to the best solution. This whole methodology is well documented and applied in residential buildings design but can be easily extended to livestock housing. In this paper the algorithm is coded to be applied on a simple sheepfold model in order to optimize only passive design solutions.