Skip to content
forked from yetzt/boxing

quick and dirty php implementation for a box packing problem

Notifications You must be signed in to change notification settings

davidalves1/boxing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

boxing.class.php

this some kind of box packing algorithm, check if n boxes fit in n bigger boxes. i use this for checking if items will fit a packaging box. if this algorithm says true: they do definitely fit, if this algorithm says false: they most probably will not fit, but this is a program, not a cop.

disclaimer

this is not an accurate solution for knapsack or any of those fancy np-complete combinatory problems. i am not a mathematican, i have no idea what i am talking about, and also the german wikipedia sucks on this topic. quick and dirty, works for me, public domain, donations very welcome.

author

sebastian vollnhals

usage:

$b = new boxing();

$b->add_outer_box(40,30,30); // our quantum box; l, w, h

$b->add_inner_box(20,30,40); // schroedingers cat; l, w, h
$b->add_inner_box(10,5,5); // the poison; l, w, h
$b->add_inner_box(5,5,10); // some katzenstreu; l, w, h

if ($b->fits()) {

	// schroedingers cat and schroedingers stuff do fit in the box

}

About

quick and dirty php implementation for a box packing problem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%