Structure - ptidejteam/tools4cities-metamenth GitHub Wiki
The Structure of MetamEnTh consists of spatial entities such as Building, Floor, Room, and OpenSpace
and their relationships with themselves and other entities. These entities are relevant to recording
the spatial locations of other entities (like Appliance, BuildingControlSystem, Sensor, and Actuator)
and for tracking occupancy within the buildings.
Figure 1.0: MetamEnTh Structure, showing the various classes and their relationships
Figure 2.0: MetamEnTh Structure, showing the methods (behaviours) of various classes
Classes and Their Relationships
All classes (entities) have auto-generated IDs (UID) to uniquely identify objects created from them.
Building
The building class models different kinds of buildings with the following attributes and behaviours (methods).
Parent class
None
Relationships
Buildinghas one-to-many relationship withWeatherStation.Buildinghas one-to-one relationship withSchedulableEntity.Buildinghas one-to-many relationship withFloorand must have at least oneFloor.Buildinghas one-to-many relationship withMeter.Buildinghas one-to-many relationship withZone.Buildinghas one-to-one relationship withAddress.Buildinghas one-to-one relationship withEnvelope.Buildinghas one-to-many relationship withBuildingControlSystem.
Attributes
construction_year:integer, the year of construction of the buildingheight:AbstractMeasure, consisting of a value and unit of measurement (e.g., meters) for the height of the buildingfloor_area:AbstractMeasure, consisting of a value and unit of measurement (e.g., meters) for the floor area of the buildinginternal_mass:AbstractMeasure, consisting of a value and unit of measurement for internal massaddress:Address, a class that defines the address of a building with additional attributesbuilding_type:BuildingType, a list (enumeration) of possible values of building typesterrain:TerrainType (optional), the terrain of the building, e.g., SUBURBSsolar_distribution:SolarDistributionType (optional), the solar distribution of the building, e.g., FULL_EXTERIORschedulable_entity:SchedulableEntity (optional), an object that models the operational schedules of a buildingenvelope:Envelope (optional), a class with additional attributes that define the envelope of a buildingfloors:List[Floor], a list of floors (a class with additional attributes) of a buildingmeters:List[Meter] (optional), a list of meters (a class with additional attributes) in a buildingweather_stations:List[WeatherStation] (optional), a list of weather stations (a class with additional attributes) a building haszones:List[Zone] (optional), a list of various zones (a class with additional attributes) in the buildingcontrol_systems:List[BuildingControlSystem]a list of control systems that the building havetrack_state:bool (default is False), if set to true, keep track of value changes for building instance attributes
Behaviours (Methods)
add_weather_station(weather_station: WeatherStation): adds a weather station to the buildingremove_weather_station(weather_station: WeatherStation): removes a weather station from the buildingadd_meter(meter: AbstractReader): adds a meter to the buildingremove_meter(meter: AbstractReader): removes a meter from the buildingadd_floors(floors: List[Floor]): adds a floor to the buildingremove_floor(floor: Floor): removes a floor from the buildingget_floor_by_uid(uid: str) -> Floor: searches for a floor by its unique identifierget_floor_by_number(floor_number: int) -> Floor: searches for a floor by its floor numberget_floors(search_terms: Dict) -> [Floors]: search for floors based on attribute values, e.g., {'number':2, 'floor_type':FloorType.REGULAR}get_weather_station_by_name(name: str) -> WeatherStation: searches for a weather station by nameget_weather_station_by_uid(uid: str) -> WeatherStation: searches for a weather station by its unique identifierget_weather_stations(search_terms: Dict) -> [WeatherStation]: searches for weather stations based on attribute values, e.g., {'name': 'WS 1'}get_meter_by_uid(uid: str) -> AbstractReader: searches for a meter by its unique identifierget_meter_by_type(meter_type: MeterType) -> [AbstractReader]: searches for meters based on themeter_typeattributeget_meters(search_terms: Dict) -> [AbstractReader]: searches for meters based on all meter attribute values, e.g., {'meter_type': MeterType.ELECTRICITY}get_zone_by_name(name: str) -> Zone: searches for a zone in a building given the name of the zoneget_zone_by_uid(uid: str) -> Zone: searches for a zone in a building given the unique identifier of the zoneget_zones(search_terms: Dict) -> Zone: searches for zone in a building based on all zone attribute values, e.g., {'zone_type': ZoneType.HVAC}add_room(floor_uid: str, name: str, area: AbstractMeasure, room_type: RoomType, location: str): adds a room to a building flooradd_open_space(floor_uid: str, name: str, area: AbstractMeasure, space_type: OpenSpaceType, location: str): adds an open space to a building floor
Envelope
This class defines a building's outer (and inner) covering with multiple Covers.
Parent Class
None
Relationships
An Envelope has a one-to-many relationship with a Cover.
Attributes
covers:List[Cover], a list of covers (e.g., wall, roof) associated with the building.
Behaviours (Methods)
add_cover(cover: Cover): adds a cover to the buildingget_covers_by_uid(uid: str) -> Cover: retrieves a cover by its unique identifierget_covers(search_terms: Dict) -> [Cover]: retrieves covers based on specified attributes and their values
Cover
This class defines the cover that makes up the envelope of a building.
Parent Class
None
Relationships
A Cover has a one-to-many relationship with Layer.
Attributes
cover_type:CoverType, the type of building coverbuilding_orientation:BuildingOrientation, the direction of the buiilding for the defined cover, e.g., BuildingOrientation.NORTHfloor_number:int: the floor where the cover is locatedneighbours:Dict: defines the neighbour covers that sorround a coverlayers:List[Layer], a list of layers (e.g., external wall) in the building cover
Behaviours (Methods)
add_layer(layer: Layer): adds a layer (e.g., external wall) to the building coverget_layer_by_uid(uid: str) -> Layer: retrieves a layer by its unique identifierget_layers(search_terms: Dict) -> [Layer]: retrieves layers based on specified attributes and their valuesadd_neighbours(cover: Cover, neighbour_type: str): adds a neighbour to a coverget_neighbour(neighbour_type: str) -> Union[str, None]: returns the UID of a neighbour cover
Layer
This class defines a layer in the cover of a building.
Parent Class
None
Relationships
A Layer has a one-to-one relationship with Material.
Attributes
height:AbstractMeasure, consisting of a value and unit of measurement (e.g., cm) for the height of the layerlength:AbstractMeasure, consisting of a value and unit of measurement (e.g., cm) for the length of the layerthickness:AbstractMeasure, consisting of a value and unit of measurement (e.g., cm) for the thickness of the layermaterial:Material, the material that makes up the layerroughness:LayerRoughness, the roughness of the layerhas_vapour_barrier:bool, indicates whether the layer has a vapour barrierhas_air_barrier:bool, indicates whether the layer has an air barrier
Behaviours (Methods)
- No specific methods provided.
Material
The Material class defines the material a layer in a building cover comprises.
Parent Class
None
Attributes
description:string, a description of the materialmaterial_type:MaterialType, the type of materialdensity:AbstractMeasure, consisting of a value and unit of measurement (e.g., kg/m^3) for the density of the materialheat_capacity:AbstractMeasure, consisting of a value and unit of measurement (e.g., J/kg·K) for the heat capacity of the materialthermal_transmittance:AbstractMeasure, consisting of a value and unit of measurement (e.g., W/m^2·K) for the thermal transmittance of the materialthermal_resistance:AbstractMeasure, consisting of a value and unit of measurement (e.g., m^2·K/W) for the thermal resistance of the materialthermal_conductivity (optional):AbstractMeasure, consisting of a value and unit of measurement (e.g., W/m.K) measuring the thermal conductivity of the materialsolar_heat_gain_coefficient:float (optional), the solar heat gain coefficient of the materialthermal_absorptance:float (optional), a value from 0 to 1 measuring the thermal absorptance of the materialsolar_absorptance:float (optional), a value from 0 to 1 measuring the solar absorptance of the materialvisible_absorptance:float (optional), a value from 0 to 1 measuring the visible absorptance of the material
Behaviours (Methods)
- No specific methods provided.
AbstractSpace
This abstract class defines attributes and methods common to all space entities: Floor, Room and OpenSpace.
Parent Class
Relationships
- All
AbstractSpacehave one-to-many relationship withZone. - All
AbstractSpacehave one-to-one relationship withSchedulableEntity.
Attributes
area:AbstractMeasure, a value and measurement unit for the area of the spacelocation:str (optional), what word location of the spacezones:List[Zone] (optional), a list of zones (a class with additional attributes) associated with the spaceschedules:List[OperationalSchedule] (optional), a list of operational schedules for the space
Behaviours (Methods)
None. This class inherit methods from the parent class.
AbstractFloorSpace
This class defines common properties (attributes) and behaviours common to spaces on a building floor.
It inherits all the attributes and behaviours of AbstractSpace.
Parent Class
AbstractSpace AbstractDynamicEntity
Relationships
- All
AbstractFloorSpacehave one-to-many relationships withAbstractFloorSpace(a space on a floor can have another space as an adjacent space) andAbstractTransducer. AbstractFloorSpacehas one-to-many relationship withAppliance.AbstractFloorSpacehas one-to-many relationship withAbstractCommonEnergySystem.AbstractFloorSpacehas one-to-many relationship withAbstractVentilationSystem.AbstractFloorSpacehas one-to-many relationship withAbstractHVACComponent.AbstractFloorSpacehas one-to-one relationship withMeter.
Attributes
area:AbstractMeasure, representing the area of the floor space with a value of measurement unitname:string, the name of the floor spacelocation:string (optional), the location of the floor spaceadjacent_spaces:List[AbstractFloorSpace] (optional), a list of adjacent floor spacestransducers:List[AbstractTransducer] (optional), a list of transducers associated with the floor spacemeter:Meter (optional), the meter in this spacehvac_components:Union[List[AbstractHVACComponent], List[AbstractVentilationComponent]], the HVAC entities that are located within floor spacesenergy_systems:[AbstractCommonEnergySystem], the energy systems that are located within floor spaces
Behaviours (Methods)
add_adjacent_space(adjacent_space: AbstractFloorSpace): adds an adjacent floor spaceremove_adjacent_space(adjacent_space: AbstractFloorSpace): removes an adjacent floor spaceadd_transducer(new_transducer: AbstractTransducer): adds a transducer to the floor spaceremove_transducer(new_transducer: AbstractTransducer): removes a transducer from the floor spaceadd_appliance(appliance: Appliance): adds an appliance to floor spaces, e.g., roomremove_appliance(appliance: Appliance): removes an appliance from floor spacesadd_hvac_component(hvac_component: Union[AbstractHVACComponent, AbstractVentilationComponent]): adds an HVAC component to floor spacesremove_hvac_component(hvac_component: Union[AbstractHVACComponent, AbstractVentilationComponent]): removes an HVAC component from floor spacesget_hvac_components(search_terms: Dict = None) -> Union[List[AbstractHVACComponent], List[AbstractVentilationComponent]]: searches for HVAC components in floor spaces based on attributes and their valuesget_adjacent_space_by_name(name: str) -> AbstractFloorSpace: searches for adjacent spaces in floor spaces given the nameget_adjacent_space_by_uid(uid: str) -> AbstractFloorSpace: searchers for adjacent spaces in floor spaces given their unique identifierget_adjacent_spaces(search_terms: Dict = None) -> [AbstractFloorSpace]: searches for adjacent spaces in floor spaces based on attributes and their valuesget_appliance_by_name(name: str) -> Appliance: searches for an appliance in floor spaces given the name of the applianceget_appliance_by_uid(uid: str) -> Appliance: searches for an appliance in floor spaces given the unique identifier of the applianceget_appliances(search_terms: Dict = None) -> [Appliance]: searches for appliances in floor spaces based on attributes and their valuesadd_energy_system(self, energy_system: AbstractCommonEnergySystem): adds an energy system to floor spacesremove_energy_system(self, energy_system: AbstractCommonEnergySystem): removes an energy system from floor spacesget_energy_systems(self, search_terms: Dict = None) -> [AbstractCommonEnergySystem]: searches for energy systems in floor spaces based on attributes and their values
Floor
This class defines a building's floor. The Floor class inherits all the properties and behaviours from AbstractSpace.
Parent Class
Relationships
Floorhas a one-to-many relationship withRoomand a one-to-many relationship withOpenSpace.
Attributes
description:string, a description of the floornumber:integer, the floor numberfloor_type:FloorType, the type of flooropen_spaces:List[OpenSpace], a list of open spaces on the floorrooms:List[Room], a list of rooms on the floorlocation: what word location of the floorheight:AbstractMeasure, the height of the floor
NB: A Floor must have at least one RoomorOpenSpace.`
Behaviours (Methods)
add_open_spaces(open_spaces: List['OpenSpace']): Adds one or multiple OpenSpaces to the flooradd_rooms(rooms: List['Room']): Adds one or multiple rooms to the floorremove_open_space(open_space: OpenSpace): Removes an open space from the floorremove_room(room: Room): Removes a room from the floorget_open_space_by_uid(uid: str) -> OpenSpace: Retrieves an open space given the UIDget_room_by_uid(uid: str) -> Room: Retrieves a room given the UIDget_open_space_by_name(name: str) -> OpenSpace: Retrieves an open space given the nameget_room_by_name(name: str) -> Room: Retrieves a room given the nameget_rooms(search_term: Dict) -> [Room]: Retrieves rooms based on attribute valuesget_open_spaces(search_term: Dict) -> [OpenSpace]: Retrieves open spaces based on attribute values
Room
Room defines a room on the Floor of a Building. Room inherits all the properties and behaviours of AbstractFloorSpace.
Parent Class
Attributes
name:string, the name of the roomroom_type:RoomType, the type of the room
Behaviours (Methods)
None.
OpenSpace
OpenSpace defines open spaces, e.g., corridors, on the Floor of a Building. OpenSpace inherits all the properties and behaviours of AbstractFloorSpace.
Parent Class
Attributes
space_type:OpenSpaceType, the type of open space
Behaviours (Methods)
None