## 3 The Proposed Solution
### Fuzzy Logic Controller  
Fuzzy logic controllers (FLCs) [30] are becoming increasingly popular in everyday life. Home automation, health, industry and intelligent transportation systems (ITS) are some examples of application fields. In fact, FLCs can be appropriate for various engineering problems, especially for several problems where classical control methods do not achieve comparatively favorable results. A general representation of the FLC introduced in this work is depicted in Figure 4. Although the representation is simple and general, it shows clearly what are the input parameters of the FCL and also the one that returns as output. The proposed system involves small data exchanges, because the data to be transferred to the controller are the calculated scheduled delay and the value of the consumer feedback related to the considered appliance. These inputs are used to update the value of the scheduled delay, returned as the output of the FLC, taking into account the feedback provided by the consumer. This fact entails a lower computational cost than, for instance, other approaches based on more complex fuzzy controllers (such as Type-2 fuzzy, Petri net, _etc._), other approaches that use different controllers in parallel (for instance, a controller in each cluster in the network) or other approaches that consider several parameters as input to the controller. These properties of the proposed FLC not only allow one to implement the solution introduced in this paper on low cost hardware, but are also expected to be beneficial in terms of lower data processing times and lower control actuation times for the fuzzy logic controllers. Figure 4: Proposed fuzzy logic controller (FLC) architecture. A FLC is based on membership functions (MFs), which are curves that define how each point in the input space is mapped to a membership value (or degree of membership) between zero and one. The input space is sometimes referred to as the universe of discourse. An MF can have different shapes; however, in this paper, triangular MFs have been considered. Considering a generic variable \(x\) containing a range of values from the minimum to the maximum value that the variable itself can assume, each membership function can be represented by the generic triangular-shaped membership function [31] as follows:  
\[\mu_{A}(x)= \begin{cases}0&\text{if }x\leq a\\ \dfrac{x-a}{m-a}&\text{if }a<x\leq m\\ \dfrac{b-x}{b-m}&\text{if }m<x<b\\ 0&\text{if }x\geq b\end{cases}  \tag{1}\]  
where \(a\) is a lower limit; \(b\) is an upper limit and \(m\) is a value, with \(a<m<b\). A generic triangular-shaped MF is depicted in Figure 5.  
The proposed FLC considers three membership functions (Low, Medium, High) for the scheduled time, both for the input variable and for the output one. These functions fuzzify the crisp inputs, while the ranges of which depend on the appliance type. In fact, each appliance has different values of maximum allowable delay. For instance, considering a generic appliance with a maximum allowable delay of 10 h, the triangular membership functions of the scheduled time are depicted in Figure 6, where the degree of membership is represented by normalized values \([0,1]\). Figure 5: Generic triangular-shaped membership function. Figure 6: Triangular membership functions for the scheduled time of the input and output parameters for the FLC. Regarding the feedback provided by the consumer, it is not possible to obtain a numerical value. In fact, the consumer can accept or deny the schedule proposed by the algorithm. For this reason, in order to determine the value of the consumer feedback to use as the input parameter of the FLC, the inference rules shown in Table 2 are used. For instance, considering the rule \(3\), if the consumer decision is Accept and the scheduled delay is High, then the feedback value will be High. The feedback value is updated each time the consumer makes a decision and will be used by the algorithm and by the FLC later when the same appliance will be re-used.