Let me start with one general conclusion after this weekend: in my case it’s better to have coding sessions rarely but for longer time rather that having short sessions more often. I have accomplished more in today’s afternoon and yesterday’s evening that in last two or three weeks. But that’s just my case, not saying that’s a general rule.
Having the above said, let’s get back to real business: the ArrangerLibrary seems to be more or less completed. Of course some additions are still required (for instance a class that would generate a PNG image for calculated arrangement) but it’s core functionality (which is to calculate best arrangement of items) is finished. I haven’t thoroughly tested it yet but I am hoping to do that next week. After that, the next step would be to build a quickie demo with UI. Unfortunately, the risk is high that I will not have finished full application before GetNoticed contest is ended.
In my previous post I wrote that merging of adjacent boxes in panel had been implemented. The most important thing in this update is that now the algorithm, while placing an item into a box, looks for all possible assignments and create a separate branch in results tree for each possible assignment. Having that done at the end the algorithm can return all possible arrangements or just one which is most effective. Maybe I will change that so a new branch is created only if there are two equally good placements (utilisation-wise). I need to do a bit of testing before I make final decision.
Another important update is that now it is possible to set a margin for every item and decide if an item can be rotated.
Here are screenshots of results of two test cases:
1) Panel size is 8 units high and 14 units wide2) Panel size is 1500 units high and 3000 units wide
As you can see results look acceptable but these test cannot be considered as reliable, next week I’ll try to conduct more test with inputs from real life (or at least more plausible) but I don’t expect the results to worsen or get significantly better. We’ll see…