emptymiles

Deadhead math for freight trips: empty-mile share, quoted vs all-in rate per mile, and the linehaul needed to hit a target.
https://truckleap.com/deadhead-miles-calculator

To install, run:

haxelib install emptymiles 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

emptymiles

A small Haxe class for the math behind a number every driver argues about: the rate per mile after the empty miles to the pickup are counted.

var trip = new emptymiles.Trip(80, 420, 1260);
trip.quotedRatePerMile();   // 3.0  (what the broker says)
trip.allInRatePerMile();    // 2.52 (what the truck actually earns)
trip.deadheadPercent();     // 16.0
trip.linehaulForTarget(2.8) // 1400 (what the load must pay to clear $2.80 all-in)

Install: haxelib install emptymiles

If you would rather not write code, there is a browser version of the same arithmetic: https://truckleap.com/deadhead-miles-calculator

Written by George Green at TruckLeap. Owners of tractors who pull someone else's trailer run into the same empty-mile question every week; some of the thinking behind that is written up as how a desk keeps tractors loaded when the trailer is not theirs.

MIT licensed.

Contributors
truckleap
Version
0.1.0
Published
2 weeks 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

⌂