## 4 Results and Discussion  
The effects of flat pricing versus implementation of demand response programs and renewable energy sources by both end users and the DSO on total energy consumption can be seen in Figure 2. In general, it can be seen that the cumulative consumption peaks are between 4:00 a.m. and 5:00 a.m. This is due to the fact that consumers switch on geysers to heat water for bathing and in some cases washing within this time interval in a typical winter day in Johannesburg. In Figure 2a, the end user consumption profile can be seen to increase sharply during peak periods of the winter day. However, \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Setting** \\ \hline Number of feature evaluations (FEs) & 10,000 \\ Number of particles & 500 \\ Mutation rate & 1/n \\ Cross over rate & 0.5–1.0 \\ Number of dimensions & 50 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameter setting for the genetic algorithm. with implementation of both DR and RES by end users and the DSO, the energy use profile begins to flatten (Figure 2b,c). In Figure 2c, the energy profile is very flat during peak hours due to the fact that the electric vehicles are mostly in V2G mode during these periods. This demonstrates the effectiveness of plug-in electric vehicles as an alternative source of energy since excess energy generated by the battery during charging is fed back into the grid during V2G mode. Therefore, from this research, end user utilization of DR programs and RES is more beneficial to the DSO. The inelasticity coefficient is used to describe the cost of electricity demand for all the end users in Figure 3. This is important because this analysis depicts how load shifting and curtailment strategies benefit both end users and the DSO. In particular, it highlights the importance of the DR aggregator as a middleman between the end users and the DSO. Since the DR aggregator receives information from the DSO regarding optimal energy usage strategies as informed by energy operators in the DA markets, it can be seen that this results in less money being spent as the end users increase their participation in DR programs. It can also be seen that the end users' implementation of RES is more beneficial as the discomfort level of the end users increases. The cost savings for end user implementation of RES is 27.7%, while that for DSO implementation is 23%. It is also important to examine the unit energy savings for various hours within the winter day based on our knowledge of the unit cost of energy during peak and off-peak periods of the winter day (Figure 4). According to City Power energy rates, peak and off-peak unit energy charges are 374.01 c/KWh and 108.11 c/KWh, respectively [37]. Again, we see that unit energy savings from the DA market are higher for end user utilization of DERs compared to DER utilization by the DSO. In particular, for the peak hour of 14:00, unit savings for the DR aggregator for DSO and end user DER utilization is 13.3% and 21%, respectively. At this time of day, it is assumed that the households with  
Figure 2: Net energy consumption of 2500 households for **(a)** No implementation of DR program; **(b)** Last optimization iteration using a DR program and utilization of renewable energy sources (RES) by the DSO; and **(c)** Last optimization iteration using a DR program and utilization of RES by the end user. six occupants have at least three children of school age. Therefore, as they return home, they begin to operate appliances which will cause demand to increase. Overall, DR programs and DER utilization increase financial benefits to end users and aggregators. Figure 5 shows the ability of the GA to optimize the parameters of Equation (40) subject to specified constraints. It can be seen that the search particles gradually settle on the optimal solution over the specified number of feature evaluations. The convergence measure indicates the distance between the initial solution and the final optimal solution.