The application of energy-efficient strategies in buildings, such as the Green Building Concept, can significantly impact human comfort and resource consumption. However, due to the complexity of decision-making factors and the variety of available materials, computational models are necessary to identify the most effective solutions and optimise building energy performance. This study presents an integrated framework that uses machine learning algorithms and a Petri Net control system to optimise the thermal, comfort, and energy efficiency of both vertical and horizontal building envelopes in semi-arid climate zones. The framework incorporates several passive techniques for building energy parameters, including material thickness and melting point, window types, wall insulation thickness and thermal emissivity, wall solar absorbance, window wall ratio, fenestration position, air tightness, roof solar reflectance, roof insulation thickness and conductivity (W/(m·°C)), and floor insulation thickness. An experiment design was developed using Box-Behnken Design-Response Surface Methodology (BBD-RSM) for statistical optimisation, which was coupled with Design Builder simulation model. The methodology was demonstrated by applying it to a residential building in Mexico. Meta Additive Regression was used to analyse the output factors, which showed higher confidence compared to REP Tree and M5P Tree algorithms in green buildings. The results demonstrate that an annual energy reduction of 50 kW/m2 per household can be achieved by using an optimised building envelope.