SciELO - Scientific Electronic Library Online

vol.22 issue3Effect of Fat Sources and Emulsifier Supplementation in Broiler Starter, Grower and Finisher Diets on Performance, Nutrient Digestibility, and Carcass Parameters author indexsubject indexarticles search
Home Pagealphabetic serial listing  

Services on Demand




Related links


Brazilian Journal of Poultry Science

Print version ISSN 1516-635XOn-line version ISSN 1806-9061

Braz. J. Poult. Sci. vol.22 no.3 Campinas  2020  Epub Nov 20, 2020 

Original Article

Optimization Algorithm Applied to Environmental Control in Broiler Houses

IGraduate Program in Production Engineering, Universidade Paulista, São Paulo, Brazil.

IIFaculdade Anhanguera, Campinas, SP, Brasil.


The present study aimed to apply the Simulated Annealing (SA) optimization algorithm to find the ideal control of broiler housing rearing environment at 21, 28, 35, and 42 days of growth. Data from four types of houses using environmental control and similar flock density were recorded weekly in the morning and afternoon, during two seasons (summer and winter). The variables related to environmental and air quality data (temperature, relative humidity, air velocity, ammonia, and carbon dioxide concentrations) were registered and organized into the database to provide a descriptive analysis. The ideal rearing conditions were established as a goal, and we used the Simulated Annealing optimization algorithm to process the data. Such an approach may be applied in the cases that the ideal condition of optimization has multiple objectives, and when each variable is the result of a process. The model was implemented considering the optimal controlled environmental condition that depends on the age of broilers. Results indicated that there was a large dispersion of the data collected from the environmental variables. The process suggested that the optimized functions lead to absolute values obtained by the algorithm for each of the environmental factors of the controlled environmental system, representing the optimal condition of the environment found for each broiler age, considering the interactions of the variables. The maximum optimization was prominent to 21 and 35-d old birds, representing 40-48% of the improvement of the process. 28 and 42-d old birds might benefit from the controlled environmental optimization process by up to 30%.

Keywords: Broiler rearing; broiler production; heat stress mitigation; Simulated Annealing


The ideal conditions of air temperature and relative humidity for broiler chickens rearing throughout the growth allows the best performance. In current literature (Yahav, 2000; Quinteiro-Filho et al., 2012; Olfati et al., 2018; Yousaf et al., 2019), authors state the importance of maintaining the proper thermoneutral zone for allowing the birds to avoid heat or cold stress according to the stage of growth. Such conditions demand the use of controlled environmental systems tuned to the age of the broilers.

According to Meluzzi & Sirri (2008), when the outside temperature is above 30 °C, the temperature inside the house must not exceed 3°C concerning the outside temperature, whereas if the outside temperature is below 10 °C, the humidity must not exceed 70%. When the relative humidity is below 50%, there is an increase in dust and microorganism dispersion in the air, leading to respiratory diseases (Yahav, 2000). Relative humidity above 80% hinders the latent heat loss of the birds, generated by an environment with a high flock density in a cooler period. Therefore, controlling the relative humidity using adequate airflow is essential to achieve thermal comfort inside broiler housing.

Ventilation rate and distribution is a critical aspect in controlled environmental systems in broiler houses. Inadequate ventilation might lead to high concentrations of noxious gases, impairing the birds’ breathing and damaging the eyes with serious welfare consequences (Oyetunde et al., 1978; Nääs et al., 2007; Nassem & King, 2018). The association with proper ventilation to remove gases and dust and evaporative cooling to reduce the air temperature is the best solution. However, for each week of growth, the needs of broilers change, making the design of an adequate environmental system a big challenge.

According to Kirkpatrick et al. (1983), Simulated Annealing (SA) or simulated tempering, is a technique that simulates the process of annealing metals, in which the metal is heated to high temperatures and a systematic cooling of it is carried out in order to reach an equilibrium point characterized by an orderly and stable microstructure. Before processing the SA, it is necessary to define the cooling chrono-gram determined by the Temperature Decline Scheme (TDS). The TDS defines how the temperature is decreased and the number of iterations performed at each temperature. The convergence of the SA, the processing time, and the probability of acceptance are directly linked to the adopted TDS. Oysu & Bingul (2009) point out that one of the difficulties in determining TDS is that each problem requires a type of temperature variation, similarly to the broiler rearing conditions.

Since the variation of broiler housing cooling depends on the birds’ age and a proper balance of environmental and air quality variables, we aimed to apply the Simulated Annealing (SA) optimization algorithm to find the ideal control of broiler housing rearing environment.


The study was based on four types of houses (blue-house, dark-house, masonry walls, and wide). The blue-house (A) had eight exhaust fans in the air outlet, open-sided walls closed with two layers of blue polypropylene curtains, a mean flow of 22000 m3 h-1, and the evaporative cooling pads were located at the front of the house. The dark-house (B) had had ten exhaust fans, open-sided walls closed with two layers of black polypropylene curtains, and a mean flow of 34000 m3 h-1. The mansory walls (C) house had 16 exhaust fans and a mean flow of 41100 m³ h-1. The wide broiler house (D) had 15 exhaust fans and flow of 50460 m³ h-1. All houses had similar flock density. Houses B, C, and D had lateral evaporative cooling pads in the air inlet.

Environmental and air quality data (temperature, Tbs; relative humidity, RH; air velocity, Var; ammonia, NH3; and carbon dioxide, CO2) were collected weekly, twice a day (morning and afternoon) and in two seasons (winter and summer) during the medium to the last stage of growth (21-d to 42-d old broilers).

The Simulated Annealing (SA) algorithm

Table 1 shows the parameters used to define the TDS and the value adopted for each of them in this study.

Table 1 Parameters used to define the Temperature Decline Scheme (TDS). 

Parameter Value
Initial temperature (Temp0) 1.000.000
The function of temperature decrease (Temp) Temp (i+1) = Temp (i)-1
Number of iterations in each temperature 1
The criterion to stop the algorithm process Temp = 0

The function of the decrease in temperature (Table 1) determines a linear decrease. Figure 1 (Vasan & Raju, 2009) illustrates the main steps of the process optimization technique through Simulated Annealing.

Figure 1 Flowchart of the optimization strategy using the Simulated Annealing. Adapted from Vasan & Raju (2009). 

In the flowchart of Figure 1, the variable number of iterations (NI) refers to the number of iterations or cycles that the algorithm will repeat. The “Metropolis criterion,” according to Vasan & Raju (2009), is the probability that the next point will be at x (t’ + 1). It varies on the difference in values depending on these two points or ΔE = E (t’ + 1) - E (t’). The probability of P (E (t’ + 1)) is calculated using Boltzmann probability distribution (Eq. 1).

P(E(t+1))=min(1,e(ΔE/kbT)) (1)

where e (-ΔE/kbT) indicates the speed of the temperature decrease.

The basic scheme of the experiment can be described as follows: f(x) is the studied phenomenon that is the maximization of the environmental variables of broiler housing (variables x1, x2, x3, x4, x5).

The environmental and air quality variables (temperature, Tbs; relative humidity, RH; air velocity, Var; ammonia, NH3; and carbon dioxide, CO2) were considered dependent variables, and the response variable was estimated as the performance of the broilers in each breeding period (21, 28, 35 and 42 days of growth). The ideal rearing conditions were considered, according to the current literature (Yahav, 2000, Yahav et al., 2001; Nääs et al., 2010; Quinteiro-Filho et al., 2012; Yousaf et al., 2019).

The optimization of the model was performed using the metaheuristic algorithm Simulated Annealing (SA) (Eq. 2). The model was implemented in cases of optimization with multiple objectives when each variable is the result of a process (Kikpatrick et al., 1983). Seven design variables were considered in the time of data collection (x1), Tbs (x2), UR (x3), Var (x4), NH3 (x5), CO2 (x6).

f(x)=i=1nWiEixi (2)

where xi= variables, and Wi=weight of each variables. Wi is the weight adopted for each xi, as W1 = 3, W2 = 1, W3 = 2, W4 = 4, and W5 = 1.

The interval of xi variation and the domain range of the environmental variables involved in the optimization model is shown in Table 2. These data are considered by the optimization algorithm, which must not exceed the limits of this established domain when assigning values for each of the variables.

Table 2 Interval domain of the variable xi by the age of broilers. 

Variables domain
Day of growth Limit Time Tbs (°C) UR (%) Var (m/s) NH3 (ppm) CO2 (ppm)
21 Min. 1 24 50 0.50 1 1500
Max. 2 26 60 0.80 10 2500
28 Min. 1 20 50 1.50 1 1500
Max. 2 24 65 2.50 10 2500
35 Min. 1 20 50 1.75 1 1500
Max. 2 24 70 2.50 10 2500
42 Min. 1 18 50 1.75 1 1500
Max. 2 24 70 2.50 10 2500

Simulated Annealing is a technique that simulates the forging of metals, followed by a systematic change of temperature in order to reach an equilibrium point characterized by a stable microstructure (Kirkpatrick et al., 1983). Before processing the SA, the cooling schedule determined by the Temperature Decline Scheme (TDS) is defined. The TDS refers to the temperature decrease and the number of iterations performed at each temperature. The convergence of the SA, the processing time, and the probability of acceptance are directly linked to the adopted TDS (Linden, 2008). In the present study, the variable Ei is the scaling weight for each variable xi (Eq. 2) changed by the age of the bird (21, 28, 35, and 42 days) (Table 3).

The scaling weights (Table 3) balances equivalent possible differences in scales between the variables that make up the multiobjective function. If any variable is on a scale different from the others, any increase or decrease in the value of these, even if relatively insignificant, can dominate any other variable disproportionately (Linden, 2008; Gandomi et al., 2013).

Table 3 Scaling weight of each variable xi 

Weight (age of broiler, day) Tbs (°C) UR (%) Var (m/s) NH3 (ppm) CO2 (ppm)
E1(21) 3.1 10-2 1.3 10-2 1.0 0.08 3.2 10-4
E2(28) 8.3 10-2 3.1 10-2 0.8 0.20 8.0 10-4
E3(35) 8.310-2 2.8 10-2 0.8 0.20 8.0 10-4
E4(42) 8.3 10-2 2.9 10-2 0.8 0.20 8.0 10-4

Experimental procedure

Experimental tests were treated separately for the domain values of the process variables obtained from the databases by the age of the birds. For this, an application was developed that represented the SA algorithm in VBA/Excel language. This application was selected due to the simplicity in generating and tabulating data in tables and updating graphs. The optimization of the model was done using the metaheuristic algorithm Simulated Annealing (SA) (Akay & Karaboga, 2012).

The parameterization of SA requires the selection of the variables that influence the behavior of the algorithm, which are its processing parameters (Kirkpatrick et al., 1983; Mezura-Montes & Colle, 2005). Those were considered the SA parameters, as follows:

  • 1) Initial Temperature = 100; the number of cycles that will be processed in a loop of repetition of the algorithm;

  • 2) TDS = 1; the Temperature Decline Scheme and defines how the temperature is decreased, and the number of iterations performed for each temperature.

The temperature decrease function is represented in Eq. 3, using the number of iterations in each temperature = 1.

Tempi+1=Tempi1(Lineardecline) (3)


The environmental data of the studied houses were tabulated and organized, and the descriptive analysis is presented in Figure 2.

Figure 2 Boxplot of the environmental variables recorded in the studied broiler houses. Tbs (a), UR (b), Var (c), CO2 (d), and NH3 (e). 

Figure 5 shows the dispersion of the data collected from the environmental variables by each studied broiler house with the information of the median and quartiles. The first quartiles represent the bases of the rectangles. Below, these points are located 25% of the observations in the ordered series. The rectangles (or boxes) are divided by a line segment, representing the median (as 50% of the observations are below and 50% above). The top of the rectangles corresponds to the third quartile. Below this point is 75% of the observations and above 25%. The ends of the line segments above and below represent the maximum and minimum points of the ordered series. Table 4 shows the comparison of the data using measures of the central position.

Table 4 Measurement of the environmental variables inside the blue-house, dark-house, giant, and masonry walls house. 

Measurement Blue-house Dark-house Masonry walls Giant
Tbs (ºC)
Mean 25.69 24.20 24.81 25.38
Median 24.55 24.08 25.00 29.55
SD 2.73 1.91 1.76 3.28
Mini 19.23 17.36 21.14 15.52
Max 31.96 28.71 29.56 32.94
UR (%)
Mean 59.53 72.37 73.97 71.65
Median 59.70 54.40 66.10 73.60
SD 11.94 10.99 10.73 11.76
Mini 28.60 30.10 40.40 35.40
Max 88.20 98.30 95.00 93.20
Var (m s-1)
Mean 0.79 0.97 0.71 0.74
Median 0.15 1.35 0.25 0.70
SD 0.51 0.45 0.39 0.45
Mini 0.04 0.10 0.00 0.01
Max 2.65 2.65 2.14 2.66
CO2 (ppm)
Mean 99.71 192.59 158.71 433.97
Median 0.00 0.00 0.00 0.00
SD 180.53 296.91 202.29 481.84
Mini 0.00 0.00 0.00 0.00
Max 900.00 1750.00 1000.00 2500.00
NH3 (ppm)
Mean 4.89 4.67 7.19 8.24
Median 4.00 2.00 3.00 4.00
SD 3.24 3.04 4.32 6.13
Mini 0.00 0.00 0.00 0.00
Max 18.00 15.00 19.00 32.00

After processing the experimental tests performed separately according to the age of the birds (21, 28, 35, and 42 days), the results were collected, and it was possible to identify the improvement rates of the combined environmental conditions obtained in the optimization process. Figure 3 shows the behavior of the curves resulting from the improvement index data between the first obtained results at each age of the birds (21-d to 42-d). The data refer to results obtained by the optimization algorithm to estimate the optimal variables of the controlled environment factors and the borderline values of these values for the domain range.

Figure 3 Results of the application of the SA algorithm for describing the improvement (%) of the combined environmental variables vs. the number of interactions. 

Each experimental trial, performed by the Simulated Annealing algorithm, occurred in a total of 3,000 iterations. Finally, the most valuable data are the absolute values obtained by the algorithm for each of the environmental factors of the controlled environmental system, which, combined with the objective function used in this research, represent the optimal condition of the environment found for each broiler age (Table 5). The maximum optimization was noticeable to 21 and 35-d old birds, representing 30-48% of the increase in the efficiency of the process. 28 and 42-d old birds might profit from the controlled environmental optimization process by up to 30%.

Table 5 Results of the optimization of the broiler housing environmental conditions. 

Age (day) Time Tbs_int UR_int Var_int NH3_int CO2_int
21 2 25.85 59.35 0.77 9.99 1945.02
28 2 23.60 63.64 2.38 9.76 2185.31
35 2 23.51 67.76 2.39 9.57 2163.63
42 2 23.52 68.60 2.42 9.95 1940.18

Tbs_int=optimized value of Tbs; UR_int= optimized value of UR; Var_int= optimized value of Var; NH3_int= optimized value of NH3; CO2_int= optimized value of CO2.

The data from the optimization results presented in Table 5 provide the farmer with optimum environmental values of the variables that might minimize cost and maximize production (Vasan & Raju, 2009).

Heat stress is a challenge in tropical countries such as Brazil. Broilers exposed to heat stress impact performance (Zhou &Yamamoto, 1997; Quinteiro-Filho et al., 2012; Baracho et al., 2019) and decrease the relative weight of the lymphoid organs (Niu et al., 2009; Quinteiro-Filho et al., 2012). Usually, a controlled environment system is used by farmers to mitigate heat stress (Zhao et al., 2013). However, when not properly designed, the system might use energy but does not remove the excess of heat inside the housing. On the other hand, excess ventilation might increase the dust distribution, reducing air quality (Banhazi et al., 2008).

Another critical issue inside broiler housing is the noxious gases from the built-up litter and the broilers respiration. Both ammonia and carbon dioxide need to be removed by the ventilation to reduce the risk of respiratory diseases and improve air quality (Yahav et al., 2001; Nääs et al., 2007). The harmful effects of ammonia on broiler chicken performance have been previously studied (Naseem & King, 2018).

Chronic e xposure to NH3 may provoke a compen-satory response to the pollutant and lessen its harmful effect (Yahav, 2004). Exposure to ammonia leads to changes in the pulmonary function that supports the broiler respiratory system, which plays a significant part in controlling body temperature (by panting) at high environmental temperatures. The effect of ammonia on the ability of broiler chickens to thermoregulate was studied by Yahav (2004). The author concluded that different ammonia concentrations significantly reduce broiler performance. Therefore, proper ventilation of the poultry house is essential to maintain air quality.

The search for more efficient solutions in broiler production requires optimizing a set of processes, which depend mainly on monitoring by sensors and equipment. In practice, it improves the use of tools by increasing precision, reducing errors, and supporting decision making (Sinduja et al., 2016; Amir et al., 2016; Yasmeen et al., 2019). The results of the present study suggest that this approach has the potential to improve strategies for controlling environmental conditions on farms during the production process, supporting automatic control.


A metaheuristic optimization algorithm Simulated Annealing (SA) was proposed to improve the multivariable issue of developing an environmental control system for poultry houses. The results found suggest that it is possible to reach up to 48% improvement in the system.


We thank CAPES for the doctoral scholarship of the first author. The authors acknowledge FACTA for the Lamas Award 2020 - ‘Honorable Mention’ received on the preliminary results of this study.


Akay B, Karaboga D. Artificial bee colony algorithm for large-scale problems and engineering design optimization. Journal Intelligent Manufacturing 2012;21(4):1001-1014. [ Links ]

Amir NS, Abas AMFM, Azmi NA, Abidin ZZ, Shafie AA. Chicken farm monitoring system. Proceeding of the 2016 International Conference on Computer and Communication Engineering; 2016 Jul 26-27; Kuala Lumpur. Malaysia: IEEE, 2016. p.132-137. [ Links ]

Banhazi TM, Seedorf J, Laffrique M, Rutleya DL. Identification of the risk factors for high airborne particle concentrations in broiler buildings using statistical modeling. Biosystems Engineering 2008;101:100-110. [ Links ]

Baracho MS, Nääs IA, Lima NDS, Cordeiro AFS, Moura DJ. Factors affecting broiler production: A meta-analysis. Brazilian Journal of Poultry Science 2019;21(3):1052. [ Links ]

Gandomi AH, Yang XS, Alavi AH. Cuckoo search algorithm: a metaheuristic approach to solve structural optimization problems. Engineering with Computers 2013;29(1):17-35. [ Links ]

Kirkpatrick S, Gelatti CD, Vecchi MP. Optimization by simulated annealing. Science1983;220(4598):671-680. [ Links ]

Linden R. Algoritmos genéticos - uma importante ferramenta de inteligência computacional. 2nd ed. Rio de Janeiro: Brasport; 2008. [ Links ]

Mezura-Montes E, Coello CAC. Useful infeasible solutions in engineering optimization with evolutionary algorithms. Proceedings of the 4th Mexican International Conference on Advances in Artificial Intelligence; 2005; Berlin, Heidelberg: Spring-Verlag; 2005. p.652-662. [ Links ]

Nääs IA, Romanini CEB, Neves DP, Nascimento GR, Vercellino RA. Broiler surface temperature distribution of 42-day old chickens. Scientia Agricola 2010;67(5):497-502. [ Links ]

Nääs IA, Miwa YM, Baracho MS, Moura DJ. Ambiência aérea em alojamento de frangos de corte: poeira e gases. Engenharia Agrícola 2007;27(2):326-335. [ Links ]

Naseem S, King AJ. Ammonia production in poultry houses can affect health of humans, birds, and the environment-Techniques for its reduction during poultry production. Environmental Science and Pollution Research 2018;25:15269-15293. [ Links ]

Niu ZY, Liu FZ, Yan QL, Li WC. Effects of different levels of vitamin E on growth performance and immune responses of broilers under heat stress. Poultry Science 2009;88:2101-2107. [ Links ]

Olfati A, Mojtahedin A, Sadeghi T, Akbari M, Martínez-Pastor F. Comparison of growth performance and immune responses of broiler chicks reared under heat stress, cold stress and thermoneutral conditions. Spanish Journal of Agricultural Research 2018;16(2):1-7. [ Links ]

Oyetunde OOF, Thomson RG, Carlson HC. Aerosol exposure of ammonia, dust and Escherichia coli in broiler chickens. Canadian Veterinary Journal 1978;19:187-193. [ Links ]

Oysu C, Bingul Z, Application of heuristic and hybrid-GASA algorithms to tool-path optimization problem for minimizing airtime during machining. Engineering Applications of Artificial Intelligence 2009;22(3):389-396. [ Links ]

Quinteiro-Filho WM, Gomes AV, Pinheiro ML, Ribeiro A, Ferraz de Paula V, Astolfi Ferreira CS, et al. Heat stress impairs performance and induces intestinal inflammation in broiler chickens infected with Salmonella enteritidis. Avian Pathology 2012;41:421-427. [ Links ]

Sinduja K, Jenifer SS, Abishek MS, Sivasankari B. Automated control system for poultry farm based on embedded system. International Research Journal of Engineering and Technology 2016;3(3):620-624. [ Links ]

Vasan A, Raju KS. Comparative analysis of Simulated Annealing, Simulated Quenching and Genetic Algorithms for optimal reservoir operation. Applied Soft Computing 2009;9(1):274-281. [ Links ]

Yahav S. Relative humidity at moderate ambient temperatures: Its effect on male broiler chickens and turkeys. British Poultry Science 2000;41:94-100. [ Links ]

Yahav S, Straschnow A, Vax E, Razpakovski V, Shinder D. Air velocity alters broiler performance under harsh environmental conditions. Poultry Science 2001;80(6):724-726. [ Links ]

Yahav S. Ammonia affects performance and thermoregulation of male broiler chickens. Animal Research 2004;53:289-293. [ Links ]

Yasmeen R, Ali Z, Tyrrel S, Nasir ZA. Estimation of particulate matter and gaseous concentrations using low-cost sensors from broiler houses. Environmental Monitoring and Assessment 2019;191:470. [ Links ]

Yousaf A, Jabbar A, Rajput N, Azizullah M, Shahnawaz R, Mukhtar N, et al. Effect of environmental heat stress on performance and carcass yield of broiler chicks. World's Veterinary Journal 2019;9(1):26-30. [ Links ]

Zhao Y, Xin H, Shepherd TA, Hayes MD, Stinn J, Li H. Thermal environment, ammonia concentrations, and ammonia emissions of aviary houses with white laying hens. Transaction of the ASABE 2013;56:1145-1156. [ Links ]

Zhou WT, Yamamoto S. Effects of environmental temperature and heat production due to food intake on abdominal temperature, shank skin temperature and respiration rate of broilers. British Poultry Science 1997;38:107-114. [ Links ]

Received: August 01, 2020; Accepted: September 22, 2020

Corresponding author e-mail address Nilsa DS Lima Universidade Paulista. Rua Dr. Bacelar 1212, São Paulo, SP, Brazil. Phone: +55 11 5586-4145

Creative Commons License This is an open-access article distributed under the terms of the Creative Commons Attribution License