## 3 Framework Implementation
### Consumer Digital Twin  
Consumer preferences constitute a set of decision criteria that reflect the consumer's prioritized demand response potential within an LEM. As such, the consumer defines the subjective intensity of importance for each residential flexible load, i.e., HVAC system, heat pump, EV charger, battery storage unit, dishwasher, and washing machine, and the desired operation time window of each load, to generate a priority vector as input to the LEM. Additionally, the boundaries of the consumer's thermal comfort tolerance are defined, adhering to [PERSON]'s 7-point thermal sensation scale [40], as depicted in Figure 3. In this scale, each state of thermal sensation corresponds to a numerical value between \(-3\) and \(+3\), where \(-3\) and \(+3\) denote the cold and hot thermal states, respectively, and \(0\) denotes the neutral state. The hierarchical ordering of consumer preferences needs to be arranged through a formal methodological approach. Therefore, the Analytical Hierarchy Process (AHP), which is a decision-making framework that allocates weights to a set of N decision criteria and produces a priority vector imposing pairwise comparisons between them, is employed. A 9-pointed balanced importance scale is utilized, in which the consumer defines whether a criterion is superior or inferior to the compared one in terms of verbal appreciation. More specifically, the scale's values come under the discrete set of \(\Delta_{1}\) = {1, 3, 5, 7, 9} and indicate equal, moderate, strong, very strong, and extreme importance, respectively, whereas intermediate values of the discrete set \(\Delta_{2}\) = {2, 4, 6, 8} are omitted as they represent a compromise between the compared criteria. To a superior criterion, the corresponding numerical value of the verbal response is assigned as priority value \(a_{ij}\), while the reciprocal \(a_{ij}^{-1}\) one is assigned to the inferior one. The priority values are allocated to a squared decision matrix \(A_{N\times N}\) to derive the normalized priority vector for the set of decision criteria (preferences). To evaluate whether the obtained weights from the AHP method are plausible, the consistency ratio metric (CR) is applied to the normalized priority vector. This metric employs the random consistency index, whose value results from a predefined set of constant values with respect to the number of decision criteria. The results of the method are considered sufficiently consistent and acceptable if the CR index is less than 0.1. If this condition is not met, the stakeholder should revise the intensity of importance for each pairwise comparison, and the process of the method is iterated. CDT provides two matrices as input to LEM; the load flexibility matrix, denoted by \(\mathbf{LF}\), whose elements represent the relative importance of each flexible load as determined by the AHP method along with the operating time window of each flexible load as defined by the consumer, and the thermal flexibility matrix, denoted by \(\mathbf{TF}\), whose elements include the consumer's current thermal comfort level and thermal comfort tolerance deviation. The \(\mathbf{LF}\) matrix allocates to each row the weight of the corresponding flexible load and the operating time window intervals, respectively, so that the first column vector \(\mathbf{lf}_{\mathbf{z,1}}\) of \(\mathbf{LF}\) matrix represents the priority vector determined by the AHP method. For instance, the vector \(\mathbf{lf}_{\mathbf{z,1}}\) = {0.2, 2, 7} represents a weight of 0.2 assigned to the corresponding load and a desired load's operating time window between 2:00 a.m. and 7:00 a.m., whereas the vector \(\mathbf{lf}_{\mathbf{z,1}}\) = {0.2, 0.1, 0.1, 0.3, 0.1, 0.2} indicates weights of 0.2, 0.1, 0.1, 0.3, 0.1, 0.2 to the HVAC system, the heat pump, the EV charger, the battery storage unit, the dishwasher and the washing machine, respectively.