def get_dwtype_floor_area(dwtype_floorarea_by, dwtype_floorarea_ey, sim_param):
    """Calculates the floor area per dwelling type for every year

    Parameters
    ----------
    dwtype_distr_by : dict
        Distribution of dwelling types base year
    assump_dwtype_distr_ey : dict
        Distribution of dwelling types end year
    sim_param : list
        Simulation parameters

    Returns
    -------
    dwtype_floor_area : dict
        Contains the floor area change per dwelling type
    Note
    -----
    - A linear change over time is assumed

    Example
    -------
    out = {year: {'dwtype': 0.3}}
    """
    dwtype_floor_area = {}

    for curr_yr in sim_param['sim_period']:
        nr_sim_yrs = curr_yr - sim_param['base_yr']

        if curr_yr == sim_param['base_yr']:
            y_distr = dwtype_floorarea_by
        else:
            y_distr = {}

            for dwtype in dwtype_floorarea_by:
                val_by = dwtype_floorarea_by[dwtype]
                val_ey = dwtype_floorarea_ey[dwtype]
                diff_val = val_ey - val_by

                # Calculate linear difference up to sim_yr
                diff_y = diff_val / sim_param['sim_period_yrs']
                y_distr[dwtype] = val_by + (diff_y * nr_sim_yrs)

        dwtype_floor_area[curr_yr] = y_distr

    return dwtype_floor_area