Skip to content

Distribute target amounts (e.g. wood harvest area) per region and variable over the clusters (weight: their capacity, e.g. forest land), so the totals of the regions with capacity above zero reach their target exactly. A cluster can never physically receive more than its capacity. Each cluster first receives its own share: the region's target distributed over the region's clusters proportional to their capacity. Shares are not capped at the cluster's capacity. A region whose target exceeds its region's total capacity gives its clusters more than their capacity, on purpose, and the caller has to account for the excess. Targets > 0 of regions without any capacity are pooled globally and spread over the remaining room (capacity minus own share) of all clusters, so borrowed amounts never push a cluster past its capacity. If the global room is too small for the whole stranded pool, the remainder is not allocated and has to be accounted for by the caller.

Usage

toolAllocateRegionTotals(
  targetRegionAmount,
  clusterCapacity,
  warnMessage = "Regions with target totals > 0 have receiving capacity"
)

Arguments

targetRegionAmount

target amount total per region and variable, e.g. wood harvest area

clusterCapacity

capacity per cluster, doubling as the distribution weight, e.g. forest land

warnMessage

message of the warn check whether regions with target amounts > 0 have receiving capacity > 0

Value

amounts per cluster, proportional to their capacity

Details

This is a helper function for harmonization, not a general tool to disaggregate region totals over clusters.

Author

Pascal Sauer