def __init__(self, location_set, 
                 run_config=None, 
                 estimate_config=None, 
                 variable_package = "urbansim", 
                 *args,
                 **kwargs):
        """
        :number_of_units_string:
          number of units string is used to determine whether a choice is over-filled, 
          by comparing it with number_of_agents_string in get_locations_vacancy().  
          TODO: How does it differ from capacity_string?
           
        """
        if (run_config is not None) and not isinstance(run_config, Resources):
            run_config = Resources(run_config)
        if (estimate_config is not None) and not isinstance(estimate_config, Resources):
            estimate_config = Resources(estimate_config)
        self.add_prefix_to_variable_names(["capacity_string", "number_of_agents_string", "number_of_units_string"],
                                           location_set, variable_package, run_config)
        self.add_prefix_to_variable_names("weights_for_estimation_string",
                                           location_set, variable_package, estimate_config)

        LocationChoiceModel.__init__(self, 
                                     location_set=location_set, 
                                     run_config=run_config,
                                     estimate_config=estimate_config,
                                     *args, **kwargs
                                    )
    def __init__(self, location_set, model_name=None, short_name=None,
                        sampler="opus_core.samplers.weighted_sampler", utilities="opus_core.linear_utilities",
                        probabilities="opus_core.mnl_probabilities", choices="opus_core.random_choices",
                        filter=None, submodel_string=None, location_id_string = None,
                        run_config=None, estimate_config=None, debuglevel=0, dataset_pool=None,
                        variable_package = "urbansim", **kwargs):
        """
        :number_of_units_string:
          number of units string is used to determine whether a choice is over-filled, 
          by comparing it with number_of_agents_string in get_locations_vacancy().  
          TODO: How does it differ from capacity_string?
           
        """
        if model_name is not None:
            self.model_name = model_name
        if short_name is not None:
            self.model_short_name = short_name
        if (run_config is not None) and not isinstance(run_config, Resources):
            run_config = Resources(run_config)
        if (estimate_config is not None) and not isinstance(estimate_config, Resources):
            estimate_config = Resources(estimate_config)
        self.add_prefix_to_variable_names(["capacity_string", "number_of_agents_string", "number_of_units_string"],
                                           location_set, variable_package, run_config)
        self.add_prefix_to_variable_names("weights_for_estimation_string",
                                           location_set, variable_package, estimate_config)

        LocationChoiceModel.__init__(self, location_set=location_set, sampler=sampler, utilities=utilities,
                        probabilities=probabilities, choices=choices,
                        filter=filter,
                        submodel_string=submodel_string, location_id_string=location_id_string,
                        run_config=run_config, estimate_config=estimate_config,
                        debuglevel=debuglevel, dataset_pool=dataset_pool, **kwargs)
Beispiel #3
0
    def __init__(self,
                 location_set,
                 project_type,
                 units,
                 developable_maximum_unit_variable_full_name,
                 developable_minimum_unit_variable_full_name=None,
                 model_name=None,
                 **kargs):
        """
        'project_type' is a string such as 'Residential', or 'Commercial'.
        """
        self.project_type = project_type
        self.units = units
        if model_name is not None:
            self.model_name = model_name
        else:
            self.model_name = "%s %s" % (self.project_type, self.model_name)
        self.model_short_name = "%s %s" % (self.project_type[:3],
                                           self.model_short_name)

        self.developable_maximum_unit_full_name = developable_maximum_unit_variable_full_name
        self.developable_maximum_unit_short_name = VariableName(
            self.developable_maximum_unit_full_name).get_alias()
        self.developable_minimum_unit_full_name = developable_minimum_unit_variable_full_name
        if self.developable_minimum_unit_full_name is not None:
            self.developable_minimum_unit_short_name = VariableName(
                self.developable_minimum_unit_full_name).get_alias()
        else:
            self.developable_minimum_unit_short_name = None
        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)
    def __init__(self, location_set, model_name=None, short_name=None, **kargs):
        if model_name is not None:
            self.model_name = model_name
        if short_name is not None:
            self.model_short_name = short_name

        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)
    def __init__(self, location_set, opus_package, model_name, **kargs):
        """

        """

        self.opus_package = opus_package
        self.model_name = model_name
        self.max_runs = 100
        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)
    def __init__(self, location_set, opus_package, model_name, **kargs):
        """

        """

        self.opus_package = opus_package
        self.model_name = model_name
        self.max_runs = 100
        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)
    def __init__(self,
                 location_set,
                 model_name=None,
                 short_name=None,
                 sampler="opus_core.samplers.weighted_sampler",
                 utilities="opus_core.linear_utilities",
                 probabilities="opus_core.mnl_probabilities",
                 choices="opus_core.random_choices",
                 filter=None,
                 submodel_string=None,
                 location_id_string=None,
                 run_config=None,
                 estimate_config=None,
                 debuglevel=0,
                 dataset_pool=None,
                 variable_package="urbansim",
                 **kwargs):
        """
        :number_of_units_string:
          number of units string is used to determine whether a choice is over-filled, 
          by comparing it with number_of_agents_string in get_locations_vacancy().  
          TODO: How does it differ from capacity_string?
           
        """
        if model_name is not None:
            self.model_name = model_name
        if short_name is not None:
            self.model_short_name = short_name
        if (run_config is not None) and not isinstance(run_config, Resources):
            run_config = Resources(run_config)
        if (estimate_config
                is not None) and not isinstance(estimate_config, Resources):
            estimate_config = Resources(estimate_config)
        self.add_prefix_to_variable_names([
            "capacity_string", "number_of_agents_string",
            "number_of_units_string"
        ], location_set, variable_package, run_config)
        self.add_prefix_to_variable_names("weights_for_estimation_string",
                                          location_set, variable_package,
                                          estimate_config)

        LocationChoiceModel.__init__(self,
                                     location_set=location_set,
                                     sampler=sampler,
                                     utilities=utilities,
                                     probabilities=probabilities,
                                     choices=choices,
                                     filter=filter,
                                     submodel_string=submodel_string,
                                     location_id_string=location_id_string,
                                     run_config=run_config,
                                     estimate_config=estimate_config,
                                     debuglevel=debuglevel,
                                     dataset_pool=dataset_pool,
                                     **kwargs)
Beispiel #8
0
    def __init__(self,
                 location_set,
                 model_name=None,
                 short_name=None,
                 **kargs):
        if model_name is not None:
            self.model_name = model_name
        if short_name is not None:
            self.model_short_name = short_name

        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)
    def __init__(self, location_set, project_type, units,
                 developable_maximum_unit_variable_full_name,
                 developable_minimum_unit_variable_full_name=None,
                 model_name=None, **kargs):
        """
        'project_type' is a string such as 'Residential', or 'Commercial'.
        """
        self.project_type = project_type
        self.units = units
        if model_name is not None:
            self.model_name = model_name
        else:
            self.model_name = "%s %s" % (self.project_type, self.model_name)
        self.model_short_name = "%s %s" % (self.project_type[:3], self.model_short_name)

        self.developable_maximum_unit_full_name = developable_maximum_unit_variable_full_name
        self.developable_maximum_unit_short_name = VariableName(self.developable_maximum_unit_full_name).get_alias()
        self.developable_minimum_unit_full_name = developable_minimum_unit_variable_full_name
        if self.developable_minimum_unit_full_name is not None:
            self.developable_minimum_unit_short_name = VariableName(self.developable_minimum_unit_full_name).get_alias()
        else:
            self.developable_minimum_unit_short_name = None
        LocationChoiceModel.__init__(self, location_set=location_set, **kargs)