next up previous index
Next: Model Configuration Up: Employment Transition Model Previous: Employment Transition Model   Index

The Run Method

Input:
year
- an integer indicating the simulated year.
job_set
- an instance of Dataset that contains some specific attributes (see description of the algorithm bellow).
control_totals
- an instance of ControlTotalDataset initiated for the dataset ``employment''. It must have at least attributes ``sector_id'', ``total_home_based_employment'', ``total_non_home_based_employment'' and ``year'' which specify the annual control totals per sector and employment type. The unique identifier of this dataset should be ``year'' and ``sector_id'' (for details see Section ``annual_employment_control_totals'' in 9.7).
job_building_types
- an instance of class Dataset that contains unique building types of jobs. It must contain an attribute 'home_based' determining which of the building types are home based (see ``job_building_types'' in 9.7).
data_objects
- a dictionary containing other datasets and arguments needed for computing variables.
resources
- additional Resources for controlling the simulation run. The argument is not used in this version of the model.

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_$ n$_home_based'' and ``is_in_employment_sector_$ n$_non_home_based'' implemented in the package given by the class property variable_package (by default ``urbansim''). $ n$ 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 $ d_h$ ($ d_{nh}$) 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 $ n_{h_u}$ ($ n_{nh_u}$) of those unplaced jobs is larger than $ d_h$ ($ d_{nh}$), only $ d_h$ ($ d_{nh}$) jobs are randomly sampled for deletion. If $ n_{h_u}$ ($ n_{nh_u}$) is smaller than $ d_h$ ($ d_{nh}$), then $ d_h-n_{h_u}$ ( $ d_{nh}-n_{nh_u}$) 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.


next up previous index
Next: Model Configuration Up: Employment Transition Model Previous: Employment Transition Model   Index
info (at) urbansim.org