Algorithm:
The job_set is required to have a primary attribute
``building_type'' with values that correspond to values of the unique identifier of job_building_types.
The algorithm invokes a computation of variables
``is_in_employment_sector_
_home_based'' and
``is_in_employment_sector_
_non_home_based'' implemented in the package
given by the class property variable_package (by default
``urbansim'').
in the variable names is the sector id. If you use
the default urbansim implementation of those variables, they require
a primary attributes ``home_based'' of the dataset job_building_types
and a primary attribute ``sector_id'' of job_set. Each job is set to be home based if its building
type is home based, otherwise the job is non-home based.
The method iterates over sectors given in control_totals. For each
sector it determines the number of jobs of that sector that are home based
(non-home based) using the above variables. It then compares those numbers to
the control totals. If the difference
(
) is positive, new home
based (non-home based) jobs are created, if it is negative, home based
(non-home based) jobs are removed, if it is zero, nothing is done.
Jobs that are created get the corresponding values for the attribute ``sector_id''. For each combination of (sector id, home based) and (sector id, non-home based) it is determined, if there are any jobs of this group previously available. In such a case, the distribution of ``building_type'' among those jobs is determined and the values for ``building_type'' of the new jobs are sampled from this distribution. If there are no existing jobs in this group, it is sampled from the ``building_type'' distribution obtained over all home based (non-home based) jobs, regardless of the sector id.
To remove home based (non-home based) jobs from a sector, first unplaced home
based (non-home based) jobs of this sector are removed. If the number
(
) of those unplaced jobs is larger than
(
), only
(
) jobs are randomly sampled for deletion. If
(
) is smaller than
(
), then
(
) jobs from the set of placed jobs of that sector are
randomly sampled and deleted. Jobs are considered as unplaced if their
attribute given by the class property location_id_name (which is by
default ``grid_id'') is smaller equal zero.
Output:
The method returns the total difference between the sizes of the job
dataset after and before the model run. Thus, a positive value means that in
total there were more jobs added than removed, a negative value means
the opposite.