Arrangement

A class that holds data about a combination of large, medium, and small items, knows how to alter an arrangement to fit within an available space, and can assess the arrangement's desirability according to a priority heuristic.

Constructors

Link copied to clipboard
constructor(priority: Int, targetSmallSize: Float, minSmallSize: Float, maxSmallSize: Float, smallCount: Int, targetMediumSize: Float, mediumCount: Int, targetLargeSize: Float, largeCount: Int, availableSpace: Float)
Creates a new arrangement by taking in a number of small, medium, and large items and the size each would like to be and then fitting the sizes to work within the availableSpace.

Functions

Link copied to clipboard
open fun findLowestCostArrangement(availableSpace: Float, targetSmallSize: Float, minSmallSize: Float, maxSmallSize: Float, @NonNull smallCounts: Array<Int>, targetMediumSize: Float, @NonNull mediumCounts: Array<Int>, targetLargeSize: Float, @NonNull largeCounts: Array<Int>): Arrangement
Create an arrangement for all possible permutations for smallCounts and largeCounts, fit each into the available space, and return the arrangement with the lowest cost.
Link copied to clipboard
open fun toString(): String