allocateInOrder

fun allocateInOrder(amountNeeded: Int, resourceList: List<Resource>): Map<Resource, Int>

Returns a map of how many units to allocate to each resource. If a resource is not in the returned map, then it will not have any units allocated.

Parameters

amountNeeded

must be greater than 0

resourceList

the list to consider. All resources must have available unit and the total amount available within the list must be greater than or equal to the amount needed