intrazonal_cost_infill#
- caf.toolkit.cost_utils.intrazonal_cost_infill(cost, multiplier=0.5, min_axis=1)[source]#
Infill the intra-zonal costs of a cost matrix.
The intra-zonal costs are usually the diagonal of a cost matrix. Standard TAG procedure for infilling these costs is to take half the minimum cost for each zone. By default, this function takes the minimum value from each row (ignoring 0s) and multiplies that by 0.5 to get the infill value for each intra-zonal. Note that if any costs already exist for the intra-zonals, they will be overwritten. The diagonal infill is calculated similar to: cost.min(axis=min_axis * multiplier
- Parameters:
- Returns:
A copy of the input cost, but with the diagonal infilled.
- Return type:
infilled_cost