Re: [UrbanSim-Users] San Francisco business model

From: Zuccarello Philippe <philippe.zuccarello_at_wanadoo.fr>
Date: Wed, 9 Jan 2008 12:00:21 -0000

Hi,

I progress since yesterday.

The transition model run but not the location choice model.

For the location choice model, Iinitialized the
annual_relocation_rates_for_business,
business_location_choice_model_coefficients and
business_location_choice_model_specification tables with dummy values, is it
possible to have a data dump of this ?.

CREATE TABLE annual_relocation_rates_for_business
(
sector_id int(32) default NULL,
business_relocation_probability double default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE business_location_choice_model_specification
(
sub_model_id int(32) default NULL,
equation_id int(32) default NULL,
coefficient_name text default NULL,
variable_name text default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE business_location_choice_model_coefficients
(
t_statistic double default NULL,
sub_model_id int(32) default NULL,
estimate double default NULL,
coefficient_name text default NULL,
standard_error double default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

My last error is:
File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\models\location_choi
ce_model.py", line 135, in run_chunk

self.capacity = ma.filled(self.determine_units_capacity(agent_set,
agents_index), 0.0)

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\models\location_choi
ce_model.py", line 204, in determine_units_capacity

capacity = self.choice_set.compute_variables(self.capacity_string,
dataset_pool=self.dataset_pool, resources=resources)

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 336, in compute_variables

(versions, value) =
self.compute_variables_return_versions_and_final_value(names, dataset_pool,
resources, quiet)

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 363, in compute_variables_return_versions_and_final_value

resources=resources, quiet=quiet, version=version))

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 1169, in _compute_if_needed

return self._compute_one_variable(variable_name, dataset_pool,
resources=resources, quiet=quiet)

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 1102, in _compute_one_variable

index_name=id_name)

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\variables\variable_
factory.py", line 65, in get_variable

% (dataset_name, short_name))

LookupError: Incomplete variable specification for
'building.non_residential_sqft' (missing package name).

Running UrbanSim for year 1981 in new process: completed................23.0
sec

Traceback (most recent call last):

File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\tools\start_run.py"
, line 75, in <module>

run_manager.run_run(config)

Thanks in advance for your Help.

Philippe ZUCCARELLO

  -----Message d'origine-----
  De : Philippe ZUCCARELLO [mailto:philippe.zuccarello_at_wanadoo.fr]
  Envoyé : vendredi 2 février 2007 10:35
  À : users_at_urbansim.org; Liming Wang
  Objet : Re: [UrbanSim-Users] San Francisco business model

  Liming,

  Thanks a lot for your help. I understand the confidentiality reason for
SanFrancisco data.

  ** Data model
  That about the other tables ?

  Table business:
  business_id int(32) default NULL,
  building_id int(32) default NULL,
  sector_id int(32) default NULL, -- link with employment_sectors or
sectors table ?
  sqft int(32) default NULL,
  employment int(32) default NULL

  Table annual_business_control_totals:
      year int(32) default NULL,
      sector_id int(32) default NULL,
      total_number_of_businesses int(32) default NULL

  Table parcels:
      parcel_id int(32) default NULL,
      zone_id int(32) default NULL

  Table sectors : is if usefull ? (It seams that Py script use directly
sector_id of business table to do agregation)

  Table business_for_estimation : not initialized at this time.

  Table persons : not initialized at this time.

  Table business_location_choice_model_coefficients : not initialized at
this time.

  Table business_location_choice_model_specification : not initialized at
this time.

  Do I need to use SQL script located in sanfrancisco\sql directory ?
(update buildings ...)

  ** Project Python scripts

  I can progress adding the "datasets_to_preload" settings in my baseline.py
file.

  Now I have an other error :
  ...
   File
"C:\Dev\_eclipse_workspace\Urbansim41\lyonprototype41\models\business_transi
tion_model.py", line 56, in run
      resources = compute_resources)
    File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 336, in compute_variables
      (versions, value) =
self.compute_variables_return_versions_and_final_value(names, dataset_pool,
resources, quiet)
    File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 363, in compute_variables_return_versions_and_final_value
      resources=resources, quiet=quiet, version=version))
    File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 1169, in _compute_if_needed
      return self._compute_one_variable(variable_name, dataset_pool,
resources=resources, quiet=quiet)
    File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\datasets\abstract_d
ataset.py", line 1102, in _compute_one_variable
      index_name=id_name)
    File
"C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\opus_core\variables\variable_
factory.py", line 83, in get_variable
      (true_short_name, directory_path, time))
  NameError: Opus variable 'is_of_sector_DDD' does not exist for dataset
'lyonprototype41.business' in year 1981
  Running UrbanSim for year 1981 in new process:
completed.................2.8 sec
  Traceback (most recent call last):
  ...

  Note the script business\is_of_sector_DDD.py is installed in my Project. I
think the reason is other, data perhaps.

  Regards,
  Philippe.

    ----- Original Message -----
    From: Liming Wang
    To: users_at_urbansim.org
    Sent: Tuesday, January 08, 2008 9:41 AM
    Subject: Re: [UrbanSim-Users] San Francisco business model

    Zuccarello,

    You encountered the error because business table hasn't been loaded into
the memory at the point of running business transition model. To fix this
problem, add this line

    'business':{'package_name':'sanfrancisco'},

    to the "datasets_to_preload" dictionary in your configuration file. You
can refer to baseline.py in sanfrancisco/configs.

    Unfortunately, the Sanfrancisco business table is confidential thus we
cannot provide it. But its main columns are as below:

    business_id, int(11)
    building_id, int(11)
    sector_id, int(11)
    sqft, double
    employment, int(11)

    where the business_id is its id field.

    Liming.

    On Jan 7, 2008 11:17 PM, Zuccarello Philippe <
philippe.zuccarello_at_wanadoo.fr> wrote:

      Hi All,

      First have a happy new Year 2008 !

      For this begin of Year, I try to implement the "business" model
existing in
      sanfrancisco project in SVN (opus_trunk\sanfrancisco\models).
      I start to initiate some of the necessary tables data (business,
      annual_business_control_totals, parcels,sectors ...) but not all, for
this
      my alone solution it to look the Python code because I don't find Sql
script
      in the project sql directoy for create them.

      At this time, I block with the following error for the
      business_transition_model :

      ...
      Traceback (most recent call last):
       File
      "C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\model_coordina
tors\m
      odel_system.py", line 572, in <module>
         s.run(resources)
       File
      "C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\model_coordina
tors\m
      odel_system.py", line 137, in run
         write_datasets_to_cache_at_end_of_year=write_datasets_to_cache_at_e
nd_of
      _year)
       File
      "C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\model_coordina
tors\m
      odel_system.py", line 363, in _run_year
         self.vardict[outputvar] = self.do_process(locals())
       File
      "C:\Dev\_eclipse_workspace\Urbansim41\opus-4.1\urbansim\model_coordina
tors\m
      odel_system.py", line 441, in do_process
         return eval(ev)
       File "<string>", line 1, in <module>
      NameError: name 'business' is not defined
      ...

      Probably reason of my small input data that are not sufficient for run
the
      simulation correctly.

      It should be very helpfull for me, if I can have a description of the
      "business" data model or a sample of San Francisco baseyear_cache
directory
      data like the eugene_1980_baseyear_cache_version_4_1_2.zip we can
download
      from the http://www.urbansim.org/download/ page.

      Regards and thanks in advance for your Help,

      Philippe ZUCCARELLO.
      PS: I work for Fabrice Marchal Team.

      _______________________________________________
      Users mailing list
      Users_at_urbansim.org
      http://www.urbansim.org/mailman/listinfo/users

----------------------------------------------------------------------------

    _______________________________________________
    Users mailing list
    Users_at_urbansim.org
    http://www.urbansim.org/mailman/listinfo/users
Received on Wed Jan 09 2008 - 03:02:23 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 09 2008 - 03:02:25 PST