calculiva-waste-benchmark (Haxe)
Dependency-free Haxe library that embeds the 42-row summary table of the Calculiva plank waste study, version 1.0.0, published on Harvard Dataverse as doi:10.7910/DVN/8VL3MW.
The study counts source planks and offcut area with the Calculiva flooring layout engine for 1,369 rectangular rooms, 3 sourced and 3 parametric plank formats, row offsets 1/2 and 1/3 (0 as a reference only), offcut reuse on (kerf 0 and 3 mm) and off (worst case), and compares the result with flat 5, 8, 10 and 15 % waste allowances. Each row gives the minimum, median, mean and maximum waste percentage and, for each allowance, how many rooms the order falls short of, matches or exceeds the counted planks.
The package is a read-only lookup and computes nothing: the layout engine is not included. To lay out a room, use the Calculiva flooring calculator.
import calculiva.WasteBenchmark;
var table = WasteBenchmark.rows(); // 42 rows, order of summary.csv
var r = WasteBenchmark.lookup("48x7.5in", "1/2", true, 0); // null when the combination is absent
if (r != null) {
var pct = WasteBenchmark.shortfallPct(r, 10); // % of rooms where a flat 10 % order is short
} // other allowances than 5, 8, 10, 15 throw
Install: haxelib install calculiva-waste-benchmark, then -lib calculiva-waste-benchmark.
Data and tests
The embedded table (src/calculiva/WasteBenchmarkData.hx) and the test vectors (test/vectors.json) are generated by a script from summary.csv of the
published dataset; no value is typed by hand. haxe test.hxml compares every row, every allowance and the error cases.