This repository features a solver for simple binpacking problems done in approx. 1h30 as a task to join KREATIZE for a summer internship
The task is clearly discribed in KREATIZE Technical Task - Bin Packing Problem.pdf
This solver contains three classes in src/binpacking.
SPACE - represents the space contained within a bound box. Has the following methods :
- a constructor
- three getters (
getX()
,getY()
,getZ()
) fit(int[])
: tests if a given volume can fit into the spacebestFit(int[])
: finds the best rotation for a given volume (to maximise the number of this volume that can be fitted in the space)
PROBLEM - represents an optimization problem, given the space contained within the machine bound box and the dimensions of the part. Has the following methods :
- a constructor
- two getters (
getS()
,getPart()
) solve()
: solve the problem
PARSER - reads the data file, and translates it into a list of Problem. Has the following methods :
- a constructor
solve()
: solve the problems of the instance
binpacking/Parser.java feaures a main in which you can launch the solver for istances stored in a .csv file. A .csv file is provided as an example : data.csv
public static void main(String[] args) {
Parser p = new Parser("data.csv");
p.solve();
}