GravityModelBase#

class caf.distribute.gravity_model.core.GravityModelBase(cost_function, cost_matrix, cost_min_max_buf=0.1, unique_id='')#

Bases: ABC

Base Class for gravity models.

Contains any shared functionality needed across gravity model implementations.

Attributes Summary

achieved_band_share

The achieved band share values during the last run.

Methods Summary

estimate_optimal_cost_params(init_params, ...)

Guesses what the initial params should be.

Attributes Documentation

Parameters:
achieved_band_share#

The achieved band share values during the last run.

Methods Documentation

estimate_optimal_cost_params(init_params, target_cost_distribution)#

Guesses what the initial params should be.

Uses the average cost in each band to estimate what changes in the cost_params would do to the final cost distributions. This is a very coarse-grained estimation, but can be used to guess around about where the best init params are.

Parameters:
  • init_params (dict[str, Any])

  • target_cost_distribution (CostDistribution)

Return type:

dict[str, Any]