*4.2. Scenario 2: Resource Allocation Using MGs and Power Storage Devices*

The second use case scenario for the proposed framework is demonstrated in Figure 12. In this scenario, a power storage system (i.e., a battery system) is integrated for improving the RT, PT and cost of the consumers' requests. The components of the system are smart homes, power storage devices, smart solar panel, wind power, electric vehicle and retail super store. The smart homes' users request the electricity from the fog at the regional level where fog is installed to fulfill their demands. Fog is connected to the MGs, electric vehicles and battery storage resources which are used to facilitate the consumers' requests. Fog first sends requests to MGs or battery storage devices to fulfill the demands of the consumers. If these are sufficient then it does not take any power from the utility. In the case that there is surplus power, then it is stored in the batteries and it can be sold back to the utility for the sake of the power trading. The stored power is also utilized in the peak hours in this work. Power trading is not the focus of this work. Here, the focus of this work is making the power system more sustainable and flexible for residential buildings. Electric vehicle and retail super store are directly connected to the fog and are solely based on the MGs and battery storage devices for procuring electricity services. Because of this, these are considered as sustainable stations in any region. Electric vehicles are used for fulfilling the travel requirements of the consumers in any residential region. These are not directly connected to the main grid for utilizing the power from main grid. These are consumers and prosumers

of the residential area. The parameters are considered as the same as those considered in scenario *1(1)* and *1(2)*.

**Figure 12.** Working of Scenario 2 in Residential Buildings using Battery Storage.
