Description Usage Arguments Value Examples
Perform Box Packing
| 1 2 | PerformBoxPacking(containers, boxes, n_iter, population_size, elitism_size,
  crossover_prob, mutation_prob, verbose = FALSE, plotSolution = FALSE)
 | 
| containers | A list of objects of class Container | 
| boxes | A list of objects of class Box | 
| n_iter | An integer; Number of iterations | 
| population_size | An integer; Number of Chromosomes in each generation | 
| elitism_size | An integer; Number of the best chromosomes to be choosen to next generaion | 
| crossover_prob | A numeric in [0; 1]; A probability for chromosome crossover | 
| mutation_prob | A numeric in [0; 1]; A probability for chromosome mutation | 
| verbose | Logical; Whether to print info during program execution | 
| plotSolution | Logical; Whether to plot a Packing Solution | 
A Packing Solution list
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # create containers
c1 <- Container(length = 2, height = 2, width = 2)
c2 <- Container(length = 2, height = 2, width = 2)
# create boxes
b1 <- Box(length = 0.5, height = 0.5, width = 0.5)
b2 <- Box(length = 1, height = 0.5, width = 0.5)
b3 <- Box(length = 0.5, height = 0.5, width = 0.5)
b4 <- Box(length = 0.5, height = 0.5, width = 0.5)
b5 <- Box(length = 0.5, height = 0.5, width = 0.5)
b6 <- Box(length = 2, height = 0.5, width = 0.5)
b7 <- Box(length = 1, height = 0.5, width = 0.5)
b8 <- Box(length = 1, height = 0.5, width = 0.5)
b9 <- Box(length = 0.5, height = 0.5, width = 0.5)
b10 <- Box(length = 0.5, height = 0.5, width = 0.5)
b11 <- Box(length = 1.5, height = 1.5, width = 1.5)
b12 <- Box(length = 1.5, height = 0.5, width = 0.5)
b13 <- Box(length = 1, height = 1, width = 1)
b14 <- Box(length = 1, height = 1, width = 1)
boxes <- list(b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14)
containers <- list(c1, c2)
# Box Packing
solution <-
     PerformBoxPacking(containers = containers,
                       boxes = boxes,
                       n_iter = 4,
                       population_size = 30,
                       elitism_size = 5,
                       crossover_prob = 0.5,
                       mutation_prob = 0.5,
                       verbose = TRUE,
                       plotSolution = TRUE
                       )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.