set_resource_cost_unit

Set the cost per (time) unit for a resource.

The cost for the unit of a resource is as a cost incurred every time an activity uses this resource. The total cost then depends on both the duration and resource demand of the activity that makes use of this resource. For an activity that makes use of the resource, its total cost per unit cost differs between the two resource types:

  • Renewable resources: the total cost per unit is equal to the unit cost value multiplied by the activity duration and the resource demand (cost/unit x activity duration x resource demand).
  • Consumable resources: The demand of consumable resources by project activities is expressed in units that can be time units (e.g. use per hour) or different from time units (use per length). The calculation of the total per unit cost of an activity using a consumable resource can be done in two alternative ways:
    • Fixed use: The unit of resource demand is expressed in a dimension different than time. The total cost per unit is equal to the unit cost value multiplied by the resource demand (cost/unit x resource demand).
    • Variable use: The unit of resource demand is expressed as time, similar to renewable resource. The total cost per unit is equal to the unit cost value multiplied by the activity duration and the resource demand (cost/unit x activity duration x resource demand).

The fixed or variable use of a consumable resource by an activity can be determined by using the P2Schedule:set_consumable_resource_fixed_variable function.

Parameters: 
I/O Type Name Description
input integer ID resource ID
input float cost cost per unit
Learn More: 

Step inside PMKC.

Example: 
function ()
        io.write('\n')
end
Class: 
P2Resource