## 5 Case Study: Experimental Validation in a Representative Smart Building Scenario
### FML-Based Representation of the Fuzzy Rule-Based System  
To ensure standardization, portability, and interoperability across heterogeneous platforms, the FRBS defined in the previous subsection is encoded using the FML, as specified in the IEEE std 1855-2016. FML is an XML-based language that provides a structured and formalized representation of fuzzy systems, including their variables, membership functions, and rule bases. \begin{table}
\begin{tabular}{l l} \hline \hline
**Rule** & **Fuzzy Rules** \\ \hline R01 & IF RoomTemperature1 IS High AND Occupancy1 IS True THEN HVACControl IS Max, VentilationControl IS Moderate \\ R02 & IF RoomTemperature1 IS Medium AND Occupancy1 IS True THEN HVACControl IS Low \\ R03 & IF RoomTemperature1 IS Low AND Occupancy1 IS True THEN HVACControl IS Max, VentilationControl IS Moderate \\ R04 & IF RoomTemperature1 IS High AND Occupancy2 IS True THEN HVACControl IS Max, VentilationControl IS Moderate \\ R05 & IF RoomTemperature1 IS Medium AND Occupancy2 IS True THEN HVACControl IS Low \\ R06 & IF RoomTemperature1 IS Low AND Occupancy2 IS True THEN HVACControl IS Max, VentilationControl IS Moderate \\ R07 & IF Illuminancel1 IS High THEN LightingControl1 IS Off \\ R08 & IF Illuminancel1 IS Medium AND Occupancy1 IS True THEN LightingControl1 IS Dim \\ R09 & IF Illuminancel1 IS Low AND Occupancy1 IS True THEN LightingControl1 IS Bright \\ R101 & IF Illuminancel2 IS High THEN LightingControl2 IS Off \\ R11 & IF Illuminancel2 IS Medium AND Occupancy2 IS True THEN LightingControl2 IS Dim \\ R12 & IF Illuminancel2 IS Low AND Occupancy2 IS True THEN LightingControl2 IS Bright \\ R13 & IF Illuminancel1 IS Low AND Occupancy1 IS False AND Occupancy2 IS True THEN LightingControl1 IS Dim \\ R14 & IF Illuminancel2 IS Low AND Occupancy2 IS False AND Occupancy1 IS True THEN LightingControl2 IS Dim \\ R15 & IF CO\({}_{2}\)Level IS High THEN VentilationControl IS Max \\ R16 & IF CO\({}_{2}\)Level IS Medium THEN VentilationControl IS Moderate, HVACControl IS Low \\ R17 & IF CO\({}_{2}\)Level IS Low THEN VentilationControl IS Off \\ R18 & IF CO\({}_{2}\)Level IS High AND Occupancy2 IS True THEN VentilationControl IS Max \\ R19 & IF RoomHumidity1 IS High AND Occupancy1 IS True AND RoomTemperature1 IS Medium THEN HVACControl IS High \\ R20 & IF RoomHumidity1 IS High AND Occupancy1 IS True AND RoomTemperature1 IS Medium THEN HVACControl IS High \\ R21 & IF RoomHumidity12 IS High AND RoomTemperature1 IS High THEN HVACControl IS High \\ R22 & IF RoomHumidity1 IS High AND Occupancy2 IS True AND RoomTemperature2 IS Medium THEN HVACControl IS High \\ R23 & IF RoomHumidity1 IS Low OR RoomHumidity2 IS Low THEN HVACControl IS High \\ R24 & IF Occupancy1 IS True OR Occupancy2 IS True THEN HVACControl IS Medium, VentilationControl IS Moderate, LightingControll IS Dim, LightingControl2 IS Dim \\ R25 & IF Occupancy1 IS False AND Occupancy2 IS False THEN HVACControl IS Off, VentilationControl IS Off, LightingControl1 IS Off, LightingControl2 IS Off \\ R26 & IF Occupancy1 IS False AND Occupancy2 IS False AND CO\({}_{2}\)Level IS Low THEN HVACControl IS Off, VentilationControl IS Moderate, LightingControl1 IS Off, LightingControl2 IS Off \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Final fuzzy rules defined by the expert panel. Figure 3: Membership functions defined for the case study. The use of FML enables seamless integration with the JFML-IoT framework and ensures that the designed fuzzy logic controllers can be interpreted, validated, and executed by compliant software components across embedded and distributed systems. The structure of the FML document used in this case study consists of three main blocks:  
* **Knowledge Base:** It defines all model input and output variables, specifying for each the linguistic terms and the corresponding membership functions as determined by the expert panel (see Figure 3). Each variable corresponds to a physical parameter described in Section 5.1.