Repair: Repair elements by expected cost at a grade

Description Usage Arguments Details Value Examples

Description

Given the current state of the buildings, this function outputs the element- level status after repairing components within budget.

Usage

1
Repair(element.data, repair.money, grade.order = c("E", "D", "C", "B"))

Arguments

element.data

An element-level data frame.

repair.money

A number.

grade.order

(Optional) A vector of character strings from "E", "D", "C" and "B" in any order. This determines the priority for repairs. The first character gives the first grade that will be repaired. By default, E is repaired first, then D, then C, then B.

Details

The repairing gives priority to repairing those components with the highest expected cost at grade E, then grade D, then grade C, then grade B, although this order can be adjusted using the arguement grade_order. It calls the same RecursiveBudgeting recursive algorithm used by Rebuild to efficiently identify the most at risk components within budget.

This function does NOT update the repair costs, only the grade proportions. Therefore UpdateElementRepairs and UpdateBlockRepairs should be called on the element- and block- level objects afterwards to ensure the repair costs and totals are correct.

Value

An element-level data frame with the grade proportions amended accordingly.

Examples

1
2
3
4
5
6
7
# Repair elements with a budget of £100,000
repaired_elements <- blockbuster2:::Repair(simulated_elements, 100000)
# IMPORTANT - This does not update repair costs
blockbuster2:::UpdateElementRepairs(repaired_elements)
# UpdateBlockRepairs uses the updated element-level data to update the block-
# level data frame so it should also be run.
blockbuster2:::UpdateBlockRepairs(simulated_blocks, repaired_elements)

DFE-Capital/Blockbuster-2 documentation built on May 26, 2019, 7:23 a.m.