SmartBuildSim

Building Information Models

The smartbuildsim.bim package defines the building information model (BIM) that powers every simulation. BIM documents describe buildings, zones, and sensors and can be loaded from YAML or built from presets.

Key models

Loading and writing schemas

smartbuildsim.bim.loader provides helpers for turning YAML into strongly validated BIM objects:

CLI usage

The Typer CLI exposes these helpers via the bim init sub-command. Using the provided examples/configs/default.yaml configuration, you can export either a preset or the default schema:

smartbuildsim bim init outputs/schema.yaml --scenario office-small

This mirrors the first step in examples/scripts/run_example.py where the office-small scenario is loaded and reused across modules.

Python example

from pathlib import Path
from smartbuildsim.bim.loader import load_building, write_default_schema

schema_path = Path("examples/outputs/schema.yaml")
schema_path.parent.mkdir(parents=True, exist_ok=True)
write_default_schema(schema_path)
building = load_building(schema_path)

print(building.name)
for zone in building.zones:
    sensor_names = [sensor.name for sensor in zone.sensors]
    print(f"{zone.name}: {sensor_names}")

The resulting Building instance can be passed directly to the data generation pipeline or to a preset scenario described in scenarios.