House API - CompteCO2/Carbon-Weight GitHub Wiki

Class: default

Type aliases

Types

Ƭ Types: Object

Type declaration

Name Type
DataE DataE
HeaterE HeaterE
HouseE HouseE
HouseT HouseT
YearE YearE

Table of contents

Constructors

Properties

Methods

Constructors

constructor

• new default(dataSet, data)

warning Should not be used : please use the static build method using dataset enum type DataE

Parameters

Name Type
dataSet DataE
data DataI

Properties

avgEmission

• Private avgEmission: undefined | number


avgEmissionByHouse

• Private avgEmissionByHouse: undefined | number


data

• Private data: DataI


dataSet

• Private dataSet: DataE


emissionFromStudy

• Private emissionFromStudy: undefined | { apartmentEmission: number ; houseEmission: number }

Methods

computeStudy

▸ Private computeStudy(study): Object

Return the total co2 estimation from house/apartment study in kgCO2e/year.

warning Implementation is defined as a lazy singleton that compute only once.

Parameters

Name Type Description
study ConsumptionFactorsT the raw study data

Returns

Object

The estimated co2 emission in kgCO2e/year

Name Type
apartmentEmission number
houseEmission number

getData

▸ getData(): DataI

Return constants data loaded

Returns

DataI

constant data loaded


getDataset

▸ getDataset(): DataE

Return dataset name

Returns

DataE

constant dataset loaded


getEmissionAvg

▸ getEmissionAvg(): number

Return the average co2 estimation from housing heating in kgCO2e/year (per person).

warning Implementation is defined as a lazy singleton that compute only once.

Returns

number

The estimated co2 emission in kgCO2e/year (per person)


getEmissionAvgByHouse

▸ getEmissionAvgByHouse(): number

Return the average co2 estimation from housing heating in kgCO2e/year (per house-apartment).

warning Implementation is defined as a lazy singleton that compute only once.

Returns

number

The estimated co2 emission in kgCO2e/year (per house-apartment), -1 if information is not available.


getEmissionConsumed

▸ getEmissionConsumed(consumptions, heater): number

Compute the co2 emission consumed in kgCO2e from a list of consumed ressources Negative values are allowed (this could be due to energy provider correction)

Parameters

Name Type Description
consumptions number[] list consumptions made in unit depending on heater type
heater HeaterE type of heater in use

Returns

number

the real emission consummed from bills consumptions in kgCO2e -1 in case of error (constants not available from dataset)


getEmissionEstimated

▸ getEmissionEstimated(house): number

Compute the CO2 emissions estimation for a house in kgCO2e/year

description We compute here the CO2e emission estimation from heating housing with this simple computation:

  • Emission = Surface * ConsumptionFactor * CombustibleFactor * ClimateCoef
  • [kgCO2e/year] = [m²] * [kWh/(m².year)] * [kgCO2e/kW] * Cste

If the region or region correction factor is not found - ClimateCoef = 1 is applied.

Parameters

Name Type Description
house HouseT the house

Returns

number

the estimated house emissions in kgCO2e/year -1 in case of error (constants not available from dataset)


build

▸ Static build(dataset):

Create new instance from dataset

Parameters

Name Type Description
dataset DataE the dataset to be used with this calculator

Returns

new House calculator - Throw error if dataset not loaded.