calculiva-waste-benchmark

Read-only lookup of the Calculiva plank waste study v1.0.0 summary (42 rows: plank format, offset, offcut reuse, kerf; waste statistics and how often flat 5/8/10/15 % allowances fall short). Data CC BY 4.0, doi:10.7910/DVN/8VL3MW. Computes nothing.
https://calculiva.com/data-sources/#waste-study

To install, run:

haxelib install calculiva-waste-benchmark 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

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.

Licence

  • Code: MIT, see LICENSE.
  • Data: CC BY 4.0. Attribution: Calculiva plank waste study v1.0.0, doi:10.7910/DVN/8VL3MW, https://calculiva.com/data-sources/#waste-study
Contributors
calculiva
Version
0.1.0
Published
1 week ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂