18
Gianluca Costa TwoBinPack Scala architecture for two-dimensional packing http://gianlucacosta.info/

TwoBinPack - Scala architecture for two-dimensional packing

Embed Size (px)

Citation preview

Page 1: TwoBinPack - Scala architecture for two-dimensional packing

Gianluca Costa

TwoBinPackScala architecture for two-dimensional packing

http://gianlucacosta.info/

Page 2: TwoBinPack - Scala architecture for two-dimensional packing

Two-dimensional packing problems

Knapsack:

Strip:

Page 3: TwoBinPack - Scala architecture for two-dimensional packing

There are several algorithms, but...

...what about human reasoning?

Page 4: TwoBinPack - Scala architecture for two-dimensional packing

Main requirements

We need a dedicated software tool

Create probleminstances

Let users play andfind solutions

Gather solutions andconsult analytics

We need to…

Page 5: TwoBinPack - Scala architecture for two-dimensional packing

TwoBinPack – ScalaFX apps

TwoBinManager

Create problem instances

Export problem bundles

Import solutions created by TwoBinGame

Consult analytics

TwoBinGame

Play with two-dimensional packing problems

Create solution files for TwoBinManager

Page 6: TwoBinPack - Scala architecture for two-dimensional packing

TwoBinPack – Basic workflow

TwoBinManager TwoBinGame

Problem Bundle

User Solutions

Page 7: TwoBinPack - Scala architecture for two-dimensional packing

TwoBinManager – Main window

Page 8: TwoBinPack - Scala architecture for two-dimensional packing

TwoBinGame – Game window

Page 9: TwoBinPack - Scala architecture for two-dimensional packing

Architecture layers

Page 10: TwoBinPack - Scala architecture for two-dimensional packing

Architecture details

● Written in Scala, with just a handful of POJOs (Plain Old Java Objects)

● Extensive test coverage; tests are all based on the expressive Scalatest framework

● Open source, published on GitHub under the GPLv3 license

OOP FPHybrid

Architecture

Page 11: TwoBinPack - Scala architecture for two-dimensional packing

Integration with external systems

TwoBinManager

External system

Standard Problem

Page 12: TwoBinPack - Scala architecture for two-dimensional packing

Extensible architecture

TwoBinManager

Generators Importers

Analytics Providers

Page 13: TwoBinPack - Scala architecture for two-dimensional packing

First tests – Setup

● 8 bundles, then 16● Each bundle contains 7 problems of different

estimated difficulty – from fairly easy (but not trivial) to very difficult

● Each problem has a time limit, according to the above difficulty

● User base of ~200 students, at the universities of Bologna and Reggio Emilia

These data are courtesy of the Operations Research groups at Unibo and Unimore.

Page 14: TwoBinPack - Scala architecture for two-dimensional packing

First tests – Result excerpts

Frame height% of optimal

solutions

10 40%

15 21%

20 6%

Rotation % of optimal solutions

No 19%

Yes 26%

Time limit (in minutes)

Average % gap from optimal solution

4 9.8%

5 8.7%

6 6.6%

7 6.7%

These data are courtesy of the Operations Research groups at Unibo and Unimore.

Medium-difficulty problem, assigned to everyone

Page 15: TwoBinPack - Scala architecture for two-dimensional packing

Official website

http://gianlucacosta.info/TwoBinPack

Page 16: TwoBinPack - Scala architecture for two-dimensional packing

Conclusions

Gnoseologicalresults

Enhanced algorithms

Open sourceframework

Plugins &New apps

Page 17: TwoBinPack - Scala architecture for two-dimensional packing

Special thanks

● Special thanks, for their valuable advice and suggestions, to:

– Professor Silvano Martello

– Prof. Manuel Iori

– Prof. Enrico Malaguti

– Dr. Maxence Delorme

Page 18: TwoBinPack - Scala architecture for two-dimensional packing

Elegance always mattersThanks for your attention! ^__^!