next up previous index
Next: Model Configuration Up: Scaling Jobs Model Previous: Initialization   Index

The Run Method

Input:
location_set
- an instance of Dataset containing the set of all locations for locating jobs.
agent_set
- an instance of Dataset containing the set of all jobs. It must have an attribute ``sector_id'' and attribute of the same name as the unique identifier of the location_set.
agents_index
- indices of members of the agent_set for which the model runs. If it is None, the whole agent_set is considered.
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 location_set is expected to have implemented variable ``number_of_jobs_of_sector_$ n$'' in the package given by the class property variable_package (default is ``urbansim''). $ n$ is an integer giving sector IDs.

The method filters out jobs that are supposed to be located using agents_index and the 'membership' of jobs given by 'group_member'. (If 'group_member' is None the group membership is ignored.) Then it determines distinct sectors of those jobs and their count in each of these sectors. It iterates over those sectors. In each iteration it randomly samples (with replacement) the desired count of locations weighted by the number of existing jobs of that sector in each location. If there are no existing jobs in that sector, it samples with equal weights for all locations. It then modifies the location attribute of the job set by storing the sampled location IDs.

Output
The method returns an array of the new locations, i.e. of size agents_index. For entries in verb|agents_index| that do not belong to this group member, the values are -1.


next up previous index
Next: Model Configuration Up: Scaling Jobs Model Previous: Initialization   Index
info (at) urbansim.org