Operational Reliability Reports
Capacity Margin Report
Label Reserve
Capacity reports often turn demand and capacity into a reserve label that operators can scan quickly.
Program
Play the script to choose demand and inspect the reserve label.
capacity_margin_report.R
demand <-
capacity <- 100
reserve <- capacity - demand
status <- if (reserve >= 25) "stable" else if (reserve >= 10) "watch" else "tight"
line <- paste(demand, reserve, status)
cat(line, "\n", sep = "")
demand <-
capacity <- 100
reserve <- capacity - demand
status <- if (reserve >= 25) "stable" else if (reserve >= 10) "watch" else "tight"
line <- paste(demand, reserve, status)
cat(line, "\n", sep = "")
demand <-
capacity <- 100
reserve <- capacity - demand
status <- if (reserve >= 25) "stable" else if (reserve >= 10) "watch" else "tight"
line <- paste(demand, reserve, status)
cat(line, "\n", sep = "")
reserve
`capacity - demand` creates the margin used by the rest of the report.
tiered labels
The nested `if` expression maps reserve ranges to stable, watch, or tight.
operator output
The printed line keeps the raw demand and derived reserve visible.