## 1 Introduction  
Microgrids are decentralized energy systems of interconnected loads and distributed energy resources (DERs) capable of operating independently or in conjunction with the main power grid. They are fundamental to the energy transition facilitating the integration of renewable energy, such as solar and wind, into the power supply. Furthermore, microgrids play a crucial role in advancing sustainable energy solutions by reducing greenhouse gas emissions and providing reliable energy access [1]. Based on their operational modes, microgrids can be divided into three main types: grid-connected, off-grid (standalone), and hybrid. Grid-connected microgrids operate in coordination with the main utility grid, allowing bidirectional energy flow. They can draw power from the main grid during periods of high demand or sell excess power generated by renewable sources back to the grid. Off-grid microgrids, on the other hand, function independently of the main grid and are often deployed in remote or isolated areas. These systems rely entirely on local energy resources, such as solar panels, wind turbines, and battery storage [2]. Hybrid microgrids combine features of both, operating autonomously when the main grid is unavailable and reconnecting seamlessly when it is restored [3]. Numerous studies focus on the planning and operation of microgrids, highlighting the critical importance of optimal sizing during the planning stage. The objective functions in these studies typically revolve around economic metrics such as the levelized cost of electricity (LCOE) or net present cost (NPC). When a second decision objective is involved, the most commonly used is the reliability goal, which is usually handled through loss of power supply probability (LPSP). Optimal sizing involves determining the appropriate capacity for DERs and other key components to ensure that the microgrid meets demand efficiently, reliably, and economically. This stage is crucial because it influences the system's cost-effectiveness and performance. Furthermore, proper sizing improves the resilience of the microgrid to uncertainties, such as fluctuating DERs and load variations [4]. The optimal sizing of microgrids is a challenging task since it often involves conflicting objectives, such as minimizing costs while ensuring a reliable energy supply. This complexity is further compounded by uncertainties in renewable energy generation, fluctuating energy demands, and varying market conditions. Due to the complexity of the problem, many authors address the optimal sizing of microgrids by employing metaheuristic techniques. In [5], the authors propose a genetic algorithm (GA) approach for the optimal design of hybrid microgrids integrating solar PV, wind, diesel generators, and battery-connected systems. In this case, both LCOE and LPSP objectives are considered. In complementary works, [6] proposes the optimal sizing of a standalone microgrid, considering droop control for better battery management, while [7] executes the study in a grid-connected network considering disconnection costs. Both flame optimization (MFO) is used in [8], while a multi-objective artificial colony system (MOACS) is developed in [9]. In the latter case, the authors implement a Weibull distribution model to simulate the uncertainty of environmental factors and a normal distribution for the load profile. The Harris hawks algorithm, a metaheuristic inspired by the cooperative hunting behavior of hawks, is employed in [10] for the optimal sizing of a microgrid in a university campus. This work differs from others by considering a number of parameters beyond the typical ones such as solar panel aging, turbine height, conversion of anemometer height to turbine hub height, terrain roughness, ground temperature and distance, power demand, battery charge energy, number of days expected to run autonomously, depth of discharge, preferred battery type, and a smart energy management system (EMS).