## 5 The Agent-Based Model
### Simulation Phase  
In the simulation phase the system evolved as previously described: the decision regarding the installation of new panels took place between 2007 and 2013, then the simulator ran until 2036 to consider the lifetime of PV panels. As described at the beginning of Section 5, each agent had a particular desire level that encapsulates its willingness to invest in a PV panel. The desire level of each household is computed during the configuration phase (Section 5.1), depending on the agent's set of attributes and mathematically expressed as an utility function. The function is a weighted combination of different factors: household income, payback period (of the initial investment), perceived and expected environmental benefits, and the pressure from neighbours (as identified by the social network among agents). The weights were used to combine these factors depending to the household class, or category (see Section 5.1.1). The actual values of the weights cannot be analytically obtained and were instead tuned via model calibration, exploiting the real historical data about PV power installed in the Emilia-Romagna region in the 2007-2013 period (detail in Section 6). The average lifetime of a PV system was 20 years; the expenses and gains cumulated during this lifespan served to estimate the return on equity (ROE) of a PV panel. The yearly cash flow was computed by subtracting the yearly total expenses from the yearly earnings--clearly considering only PV-related financial movements. The yearly expenses can be obtained by summing the cost of the system divided by its lifetime (mortgage payment), the maintenance costs and the interests on eventual loans. Potential yearly earnings comprised the surfeit electricity sold to the national electrical grid and the electricity bill savings granted by self-production. Alongside, there could be national and/or regional incentives, with a profound impact on the overall profitability of an investment. The incentives can influence yearly cash-flows in different ways: for instance, the gains are directly linked to the Italian national feed-in tariffs, while yearly expenses depend on the initial cost (affected by regional investment grants) and loan interests (target for several incentive schemes). Each household had to find the optimal size for the PV system (the size that maximises the ROE); if the set of conditions characterizing an agent were unfavourable, the house owners can also opt not to install a PV panel. The problem was solved with an heuristic algorithm based on Simulated Annealing [59]. The proposed model assumed that households aimed at making well informed decisions, for example by getting advice from PV installers in order to properly understand the available options. Hence, agents are supposed to purchase PV panels with the goal of maximising their reward w.r.t. energy production and financial savings. One of the most important component of the proposed approach is the criterion used by agents/households to decide whether to install a PV panel. As mentioned earlier, this decision is taken by each agent based on the values of its attributes. The decision criterion for agent \(v\) is expressed by the utility function (also referred to as desire level):  
\[U(v)=w_{P}(c_{v})u_{P}(v)+w_{B}(c_{v})u_{B}(v)+w_{E}(c_{v})u_{E}(v)+w_{N}(c_{v} )u_{N}(v) \tag{1}\]  
where \(c_{v}\) is the class of the agent (details in Section 5.1.1). The utility function is a weighted combination of four components:  
1. the investment payback time \(u_{P}(v)\), representing the expected payback period of the PV panel;
2. the available budget \(u_{B}(v)\), that strongly impacts the possibility to make the initial investment (without considering external incentives);the impact of the neighbours' choices \(u_{N}(v)\);
4. the potential benefits generated by investing in a PV panel \(u_{E}(v)\) (estimated in relation to a decrease in consumption of electrical energy from other non-renewable sources).