buildingSMART / buildingSMART/IFC4.x-development
Proposal to document the equation of a cost rate in calculating the total cost of a cost item
- Dominant language
- Python
- Stars
- 234
- Forks
- 123
- Avg merge
- 15h 4m
- Merged PRs (30d)
- 5
Description
The current description for CostValues is:
> Component costs for which the total cost for the cost item is calculated, and then multiplied by the total CostQuantities if provided. **If CostQuantities is provided then values indicate unit costs, otherwise values indicate total costs.** For calculation purposes, the cost values may be directly added unless they have qualifications. Cost values with qualifications (e.g. IfcCostValue.ApplicableDate, IfcCostValue.FixedUntilDate) should be excluded from such calculation if they do not apply.
With the current description, the following formulas are implied:
> If no cost quantities provided:
> Total cost item cost = sum(CostValues)
>
> If cost quantities are provided:
> Total cost item cost = sum(CostQuantities) * sum(CostValues)
However, what happens when there is a `UnitBasis` assigned? A `UnitBasis` is typically assigned to a schedule of rates cost item, for example if an IfcCostValue has an AppliedValue of $5 and a unit basis of 3 m2, this means that it costs 5$ per 3m2.
Therefore, what happens when this is provided alongside a cost quantity? Is the new formula:
> Total cost item cost = sum(CostQuantities) / CostValues[*].UnitBasis.ValueComponent * sum(CostValues.AppliedValue)
What happens if there are multiple unit bases? I assume this occurs:
```
total_cost = 0
for cost_value in CostValues:
if check_unit_basis_unit_component_is_compatible_with_cost_quantities_type:
total_cost += sum(CostQuantities) / cost_value.UnitBasis.ValueComponent * cost_value.AppliedValue
```
This modified equation will allow us to use cost rates. I propose to add documentation for this scenario as well as explicitly describe the equation.
Contributor guide
Assessment
This issue has not been assessed yet.