How fzohra-ux/code-organisee works
Purpose and Execution Surfaces
This is a Python building-energy project that identifies room thermal RC models, adds ML residual correction, and simulates HVAC load-shedding (“effacement”) control. It is organized as several related experiment pipelines rather than one packaged service. Primary runnable surfaces are RC_model_identification/main_train.py, RC_model_identification/main_validation.py, and pilotage/main.py; alternative identification and corrector implementations live in Identification 2R2C/ and corrector*/.
Input Data Boundary
The system operates offline on historical CSV telemetry: room temperature, CO₂, airflow, HVAC/radiator measurements, AHU signals, and outdoor weather. Room-specific sources are under data/rooms/4A014/, data/rooms/4A015/, etc.; weather is under data/weather/. The data-loading boundary is centralized per pipeline, notably RC_model_identification/data_loading.py and pilotage/data_loading.py. There is no indicated live BMS, database, API, or cloud integration.
RC Thermal Model and Parameter Identification
The core physics model is an R4C3 resistance-capacitance thermal network, implemented independently in RC_model_identification/R4C3.py and pilotage/R4C3.py. Identification trains model parameters against measured building trajectories through RC_model_identification/identification.py, then persists learned 2022 parameters in RC_model_identification/theta_identified_2022.json. Identification 2R2C/parameters_identification.py and Identification 2R2C/model_validation.py represent a separate 2R2C-oriented identification path.
Simulation and Validation
Identified RC parameters and aligned telemetry feed forward thermal simulation. RC_model_identification/simulation.py performs the model trajectory computation, while RC_model_identification/main_validation.py evaluates the resulting fit and RC_model_identification/plotting.py produces analysis outputs. This establishes the key boundary between calibrated physical dynamics and observed measurements.
Occupancy and Internal Gains
Occupancy is estimated as a derived input to thermal/load models, with implementations in RC_model_identification/occupancy_estimation.py and pilotage/occupancy_estimation.py. Supporting occupancy labels or estimates are stored as RC_model_identification/occupants_number.csv and Identification 2R2C/occupants_number.csv. Occupancy contributes to internal-gain assumptions rather than being an external runtime service.
Hybrid ML Corrector
The corrector/ and corrector_multi_output/ pipelines learn corrections around RC-model behavior. Their central stages are RC-informed feature construction (corrector/rc_features.py), training (corrector/Training.py), and evaluation (corrector/evaluation.py). corrector_multi_output/Training.py provides a multi-output variant. The control pipeline consumes serialized per-room hybrid Ridge models from pilotage/models/hybrid_ridge_model_4A014.pkl through pilotage/models/hybrid_ridge_model_4A019.pkl.
Load-Shedding Control Pipeline
pilotage/main.py is the operational experiment entry point. It assembles dynamics in pilotage/model_builder.py and pilotage/thermal_dynamics.py, creates RC loads via pilotage/rc_load_creation.py, applies ML correction through pilotage/ml_correction.py, and solves/extracts the control result in pilotage/solve_extract.py. Inputs include identified parameter snapshots (pilotage/theta_identified_2022.json, pilotage/theta_identified_2023.json) and room models. Outputs are persisted CSV artifacts such as pilotage/results/HVAC value baseline.csv, pilotage/results/HVAC value.csv, and pilotage/results/effacement_summary.csv.
Runtime and Dependencies
The repository is Python-based, with dependencies declared in requirements.txt. It relies on local filesystem data/model artifacts and likely scientific computing, optimization, plotting, and scikit-learn-compatible pickle loading, but no deployment infrastructure or external service is represented in the tree.
Main entry points: data_loading.py Identification loader · simulation.py Thermal simulation · identification.py Parameter identification · model_builder.py Control dynamics assembly
Components 19
Offline telemetry
Historical room and weather CSV inputs.
- Room telemetry · Temperature, CO₂, airflow, and HVAC measurements by room.
- Weather telemetry
RC identification
Physics calibration and validation experiments.
- Identification loader
RC_model_identification/data_loading.py - Occupancy estimation · Estimates internal-gain occupancy inputs.
RC_model_identification/occupancy_estimation.py - R4C3 thermal model
RC_model_identification/R4C3.py - Parameter identification
RC_model_identification/identification.py - Identified parameters · Learned 2022 R4C3 parameters.
RC_model_identification/theta_identified_2022.json - Thermal simulation
RC_model_identification/simulation.py - Fit validation
RC_model_identification/main_validation.py
Hybrid correction
Residual-learning experiment pipelines.
- RC-informed features
corrector/rc_features.py - Residual corrector training
corrector/Training.py - Corrector evaluation
corrector/evaluation.py
Load-shedding control
Pilotage simulation and optimization pipeline.
- Pilotage loader
pilotage/data_loading.py - Control dynamics assembly · Builds thermal dynamics and RC loads for optimization.
pilotage/model_builder.py - Pilotage R4C3 model
pilotage/R4C3.py - Per-room hybrid models
pilotage/models/hybrid_ridge_model_4A014.pkl - Solve and extract
pilotage/solve_extract.py - Load-shedding experiment
pilotage/main.py - Control result CSVs · Baseline, controlled HVAC values, and effacement summary.
pilotage/results/effacement_summary.csv
Connections 24
- Room telemetry → Identification loader: load telemetry
- Weather telemetry → Identification loader: load weather
- Identification loader → Occupancy estimation: measurements
- Identification loader → Parameter identification: aligned trajectories
- Occupancy estimation → Parameter identification: internal gains
- R4C3 thermal model → Parameter identification: model structure
- Parameter identification → Identified parameters: persist parameters
- Identified parameters → Thermal simulation: calibration
- Identification loader → Thermal simulation: forcing and observations
- R4C3 thermal model → Thermal simulation: dynamics
- Thermal simulation → Fit validation: predicted trajectory
- Identification loader → RC-informed features: telemetry
- Thermal simulation → RC-informed features: RC behavior
- RC-informed features → Residual corrector training: features
- Residual corrector training → Corrector evaluation: trained corrector
- Room telemetry → Pilotage loader: load telemetry
- Weather telemetry → Pilotage loader: load weather
- Pilotage loader → Control dynamics assembly: scenario inputs
- Identified parameters → Control dynamics assembly: RC parameters
- Pilotage R4C3 model → Control dynamics assembly: thermal equations
- Control dynamics assembly → Solve and extract: optimization model
- Per-room hybrid models → Solve and extract: ML correction
- Load-shedding experiment → Solve and extract: run experiment
- Solve and extract → Control result CSVs: write results