Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Is there already an easy fit algorithm? Date: Wed, 13 Sep 2017 18:54:14 -0000 (UTC) Organization: A noiseless patient Spider Lines: 62 Message-ID: References: <137a4648-a4a2-42f9-929e-129787f79650@googlegroups.com> <284544a2-9e8a-4150-a048-c8eb30ddda6a@googlegroups.com> <16abd112-1910-42fa-b2ee-c378b9a74ce6@googlegroups.com> <3faa5b20-604d-4b18-b46b-564029238d5e@googlegroups.com> <54d15d3f-f4be-4de8-b0b9-fa2d36ac93dc@googlegroups.com> <6d1f8266-8f85-4cb2-913b-f9f50aa18c9a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 13 Sep 2017 18:54:14 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="5cad534f419f483f6b352ed744d105cb"; logging-data="20834"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+d2wbxAyX8hc7f9zV7qF8HzNHmlhdDr+E=" User-Agent: Pan/0.141 (Tarzan's Death; 168b179 git.gnome.org/pan2) Cancel-Lock: sha1:CeORnvm7OA2Fxv7+ivPu+ld5Vik= Xref: csiph.com comp.lang.java.programmer:37412 On Wed, 13 Sep 2017 10:36:41 -0700, Eric Douglas wrote: > I'm sure the traffic manager would love it if we could write a truck > packing screen as a game of 3D Tetris. > :-) FWIW, I've been maintaining a set of six club duty rosters for the last few years. These are interlinked by a set of rules: - some members are on more than one roster so must not be rostered on both rosters for the same weekend - some members (on different rosters) travel together, so should be rostered on the same day at the same time - group ownership of rather a rather expensive piece of sporting equipment means that only one group member can be rostered on a day, regardless of which rosters each of them volunteer for. ..and finally, for each roster there are rules that set the minimum gap between successive duties for a member. Before I took the task over it was handled by a massive 13 page spreadsheet (six rosters, a preferences import page for each and last season's overall roster), which did little more than record its user's input and required manual application of the above rules. I built a Java program that does all the above AND implements those rules as well as visually showing days blocked out because they are too close a member's previous duty, but this still requires duty allocation to be done manually. It uses a matrix. The X axis lists member names, the Y axis shows dates and duty allocations for that roster. The matrix body contains colour coded cells showing the status of a member vs duty allocation, e.g.: pale blue=unallocated green=allocated duty darkgreen=allocated all-day duty red=rejected allocation attempt I initially wanted to try automating duty allocation but was persuaded that this would be a nightmare to implement, while the current approach of just automating the rules to do real-time checks as duties are allocated works well and is fairly intuitive to use. I suspect you may find my rostering task has similarities to your container packing task, so making something with a UI like a 3D Tetris game with automated packing rules and manual package allocation may not be such a bad idea, particularly if it is possible to simultaneously show all the trucks currently in loading bays or all trucks taking stuff to the same destination while still having a usable screen. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |