dev = developer.Developer(feasibility.to_frame())
target_units = dev.\
compute_units_to_build(len(agents),
buildings[supply_fname].sum(),
target_vacancy)
new_buildings = dev.pick(forms,
target_units,
parcel_size,
ave_unit_size,
total_units,
max_parcel_size=max_parcel_size,
drop_after_build=True,
residential=residential,
bldg_sqft_per_job=bldg_sqft_per_job)
if year is not None:
new_buildings["year_built"] = year
if form_to_btype_callback is not None:
new_buildings["building_type_id"] = new_buildings["form"].\
apply(form_to_btype_callback)
all_buildings = dev.merge(buildings.to_frame(buildings.local_columns),
new_buildings[buildings.local_columns])
sim.add_table("buildings", all_buildings)
I would like to make this consistent with calls to other urbansim models in utils.py, such as hedonic_simulate. The function could look something like this:
As a modeler, I should be able to use the developer model in a consistent manner with other urbansim models. Consistent with #10.
Overview
Current workflow is as follows:
I would like to make this consistent with calls to other urbansim models in
utils.py
, such ashedonic_simulate
. The function could look something like this:Details
Very similar to #10. Essentially moving all these steps into the Developer class. A couple of specifics:
pick()
method should be moved into aadd_new_buildings()
method that takes the results ofpick
and registers new buildings.run_developer
function inutils.py
should become YAML config variables.