classification_ann_controller

Modules

classification_ann_controller_system module

class ClassificationAnnControllerSystem(room_identifier=None, **kwargs)[source]

Bases: System

ANN-based controller for predicting damper position in ventilated rooms.

This class implements an artificial neural network-based controller that predicts optimal damper positions for room ventilation based on CO2 concentration and time embeddings. The controller uses a feedforward neural network with 3 layers and ReLU activation functions.

Inputs:
  • Room identifier (0-19)

  • CO2 concentration

  • Time embeddings (time of the day, time of the year, day of the week)

Output:
  • Damper position (0-1)

Network Architecture:
  • Input and output sizes are fixed to 12 and 20, respectively

  • Network architecture is fixed to 12-50-100-20

  • The model weights are loaded from a file named “room_controller_classification_net_room{room_identifier}.pth” in the “saved_networks” folder

Data Processing:
  • The CO2 data is normalized using the mean and standard deviation of the CO2 data for each room. The mean and standard deviation are hardcoded in the “normalize_co2_data” function

  • The time embeddings are extracted from the simulation timestamp and include the time of the day, time of the year, and day of the week

Note

A road map to extend the idea of an ANN-based controller for building energy systems is expected to be developed in the future.

Parameters:
  • room_identifier (int) – Room identifier (0-19) used to load the appropriate pre-trained model and normalization parameters

  • **kwargs – Additional keyword arguments passed to the parent System class

do_step(secondTime, dateTime, step_size, stepIndex)[source]

Do a single step of the system.

Parameters:
  • secondTime (float) – The current time in seconds.

  • dateTime (datetime.datetime) – The current date and time.

  • step_size (int) – The step size of the simulation in seconds.

  • stepIndex (int) – The current step index.

Return type:

None

initialize(start_time, end_time, step_size, simulator)[source]

Initialize the system.

Parameters:
  • start_time (datetime.datetime) – The start time of the simulation.

  • end_time (datetime.datetime) – The end time of the simulation.

  • step_size (int) – The step size of the simulation in seconds.

  • simulator (core.Simulator) – The simulator.

Return type:

None

normalize_co2_data(room, co2_concentration)[source]

room 0: co2_mean: 487.44831648462457 co2_std: 30.339372824816042 room 1: co2_mean: 517.6011272124435 co2_std: 62.44622430595211 room 2: co2_mean: 503.275009561795 co2_std: 79.25997188443297 room 3: co2_mean: 532.9186420552495 co2_std: 77.48523587317794 room 4: co2_mean: 366.82634861682925 co2_std: 66.57726832988382 room 5: co2_mean: 502.24242795058024 co2_std: 70.67566502968417 room 6: co2_mean: 420.70573520926814 co2_std: 56.10775742008361 room 7: co2_mean: 545.5623315863077 co2_std: 102.70715619859574 room 8: co2_mean: 457.87479920901734 co2_std: 75.1616908362888 room 9: co2_mean: 428.0474030227456 co2_std: 15.646712694277939 room 10: co2_mean: 470.83303275491016 co2_std: 49.51922150786335 room 11: co2_mean: 491.0285326339487 co2_std: 48.6202179703961 room 12: co2_mean: 496.9776380926451 co2_std: 53.60251104644996 room 13: co2_mean: 501.99778467480616 co2_std: 58.151236658135886 room 14: co2_mean: 485.41123619760845 co2_std: 43.1011251325834 room 15: co2_mean: 501.5831298984028 co2_std: 51.30480696887379 room 16: co2_mean: 410.66069431936035 co2_std: 53.173559427276956 room 17: co2_mean: 532.7565586771808 co2_std: 43.53018793206768 room 18: co2_mean: 474.61733262387884 co2_std: 27.786654824704172 room 19: co2_mean: 442.9465092733341 co2_std: 17.03559498220718

time_embedding(timestamp)[source]
property config
class room_controller_net(input_size, output_size)[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

load(filename, input_size, output_size, device)[source]