An abstract instance of boxologic.
+ * + *{@link st_Instance} represents a physical, tangible instance of 3-dimension.
+ * + * @author Jeongho NamPacker is a facade class supporting packing operations in user side. You can solve a packing problem + * by constructing Packer class with {@link WrapperArray wrappers} and {@link InstanceArray instances} to + * pack and executing {@link optimize Packer.optimize()} method.
+ * + *In background side, deducting packing solution, those algorithms are used.
+ *Deduct + * + */ + optimize(): WrapperArray; + /** + * @brief Initialize sequence list (gene_array). + * + * @details + *
Deducts initial sequence list by such assumption:
+ * + *Method {@link initGenes initGenes()} constructs {@link WrapperGroup WrapperGroups} corresponding + * with the {@link wrapperArray} and allocates {@link instanceArray instances} to a {@link WrapperGroup}, + * has the smallest cost between containbles.
+ * + *After executing packing solution by {@link WrapperGroup.optimize WrapperGroup.optimize()}, trying to + * {@link repack re-pack} each {@link WrapperGroup} to another type of {@link Wrapper}, deducts the best + * solution between them. It's the initial sequence list of genetic algorithm.
+ * + * @return Initial sequence list. + */ + protected initGenes(): GAWrapperArray; + /** + * Try to repack each wrappers to another type. + * + * @param $wrappers Wrappers to repack. + * @return Re-packed wrappers. + */ + protected repack($wrappers: WrapperArray): WrapperArray; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + toXML(): samchon.library.XML; + } +} +declare namespace flex { + class TabNavigator extends React.ComponentA set of programs that calculate the best fit for boxes on a pallet migrated from language C.
+ * + *A facade class of boxologic.
+ * + *The Boxologic class dudcts the best solution of packing boxes to a pallet.
+ * + *All different lengths of {@link box_array all box} dimensions along with evaluation values.
+ * + *In other word, the layer_map stores those entries; each {@link Boxbox}'s length on each + * axis as a key (width, height or length) and evaluation value as a value. The evaluation + * value means sum of minimum gaps between the key and other {@link Box boxes}' width, height and length + *
+ * + *
+ FOR i := 0 to box_array.size()
+ WHILE key IN width, length and height in box_array[i]
+ BEGIN
+ value := 0
+ FOR j to box_array.size()
+ value += min
+ (
+ abs(key - box_array[j].width),
+ abs(key - box_array[j].height),
+ abs(key - box_array[j].length)
+ )
+ layer_map.insert({key, value});
+ END
+ *
+ *
+ * Whether the packing is on progress.
+ * + *The {@link packing} is a flag variable for terminating iterations in + * {@link iterate_orientations iterate_orientations()}, who deducts the best packing solution.
+ */ + private packing; + /** + * Whether packing a layer is done. + */ + private layer_done; + /** + * Whether the current packing layer is evened. + */ + private evened; + /** + * Whether the best solution is deducted. + */ + private packing_best; + /** + * Whether the utilization degree of pallet space is 100%. + */ + private hundred_percent; + /** + * The best orientation of the pallet, which can deduct the {@link best_solution_volume}. + */ + private best_orientation; + /** + * The best layer, which can deduct the {@link best_solution_volume}. + */ + private best_layer; + /** + * The best volume, fit the best utilization degree of the pallet space. + */ + private best_solution_volume; + /** + * Construct from a wrapper and instances. + * + * @param wrapper A Wrapper to pack instances. + * @param instanceArray Instances trying to put into the wrapper. + */ + constructor(wrapper: bws.packer.Wrapper, instanceArray: bws.packer.InstanceArray); + /** + *Encode data
+ * + *Encodes {@link bws.packer Packer}'s data to be suitable for the + * {@link boxologic Boxologic}'s parametric data.
+ */ + private encode(); + /** + *Decode data
+ * + *Decodes the Boxologic's optimization result data to be suitable for the Packer's own.
+ */ + private decode(); + private inspect_validity(); + /** + *Pack instances to the {@link wrapper}.
+ * + *The {@link Boxologic.pack} is an adaptor method between {@link bws.packer Packer} and + * {@link boxologic}. It encodes data from {@link bws.packer Packer}, deducts the best packing + * solution decodes the optimization result and returns it.
+ * + *The optimization result is returned as a {@link Pair} like below:
+ *Execute iterations by calling proper functions.
+ * + *Iterations are done and parameters of the best solution are found.
+ */ + private iterate_orientations(); + /** + * Iterate a layer. + * + * @param thickness Thickness of the iterating layer. + */ + private iterate_layer(thickness); + /** + *Construct layers.
+ * + *Creates all possible layer heights by giving a weight value to each of them.
+ */ + private construct_layers(); + /** + *Packs the boxes found and arranges all variables and records properly.
+ * + *Update the linked list and the Boxlist[] array as a box is packed.
+ */ + private pack_layer(); + /** + * Find the most proper layer height by looking at the unpacked boxes and + * the remaining empty space available. + */ + private find_layer(thickness); + /** + *Determine the gap with the samllest z value in the current layer.
+ * + *Find the most proper boxes by looking at all six possible orientations, + * empty space given, adjacent boxes, and pallet limits.
+ * + * @param hmx Maximum available x-dimension of the current gap to be filled. + * @param hy Current layer thickness value. + * @param hmy Current layer thickness value. + * @param hz Z-dimension of the current gap to be filled. + * @param hmz Maximum available z-dimension to the current gap to be filled. + */ + private find_box(hmx, hy, hmy, hz, hmz); + /** + *Analyzes each unpacked {@link Box box} to find the best fitting one to the empty space.
+ * + *Used by {@link find_box find_box()} to analyze box dimensions.
+ * + * @param x index of a {@link Box box} in the {@link box_array}. + * + * @param hmx Maximum available x-dimension of the current gap to be filled. + * @param hy Current layer thickness value. + * @param hmy Current layer thickness value. + * @param hz Z-dimension of the current gap to be filled. + * @param hmz Maximum available z-dimension to the current gap to be filled. + * + * @param dim1 X-dimension of the orientation of the box being examined. + * @param dim2 Y-dimension of the orientation of the box being examined. + * @param dim3 Z-dimension of the orientation of the box being examined. + */ + private analyze_box(index, hmx, hy, hmy, hz, hmz, dim1, dim2, dim3); + /** + * After finding each box, the candidate boxes and the condition of the layer are examined. + */ + private check_found(); + /** + * After packing of each box, 100% packing condition is checked. + */ + private volume_check(); + /** + *Find the first to be packed gap in the layer edge.
+ * + *Determine the gap with the {@link scrap_min_z smallest z} value in the current layer.
+ */ + private find_smallest_z(); + /** + *Determine {@link box_arrray boxes}.
+ * + *Using the parameters found, packs the best solution found and reports.
+ */ + private report_results(); + /** + *Determine a {@link Box}.
+ * + *Transforms the found co-ordinate system to the one entered by the user and write them to the + * report.
+ */ + private write_box_file(); + } +} +declare namespace boxologic { + /** + * A pallet containing boxes. + * + * @author Bill Knechtel,Cumulated lengths of current layer.
+ * + *{@link Scrapped} represents an edge of the current layer under construction.
+ * + * @author Bill Knechtel,A repeated Instance.
+ * + *InstanceForm is an utility class for repeated {@link Instance}. It is designed for shrinking + * volume of network message I/O by storing {@link count repeated count}.
+ * + * @author Jeongho NamRepeated {@link instance} to {@link InstanceArray}. + * + * @details + *
Contains the {@link instance repeated instance} to an {@link InstanceArray} to make
+ * {@link instance} to participate in the packing process. The returned {@link InstanceArray} will be
+ * registered on {@link Packer.instanceArray}.
+ *
+ * @return An array of instance containing repeated {@link instance}.
+ */
+ toInstanceArray(): InstanceArray;
+ }
+}
+declare namespace bws.packer {
+ class WrapperArray extends samchon.protocol.EntityArrayCollection A type, identifier of derived class. Name, key of the Product. The name must be unique because a name identifies a {@link Product}. Wrap represents an act wrap(ping). {@link Wrap} is a class represents an act wrapping an {@link Instance} to an {@link Wrapper}.
+ * To represent the relationship, Wrap uses Bridge and Capsular patterns to links and intermediates
+ * relationship between Wrapper and Instance. Wrap also helps packing optimization and 3d-visualization with its own members
+ * {@link orientation} and position variables {@link x}, {@link y} and {@link z}. Name, key of the Wrapper. The name represents a type of Wrapper and identifies the Wrapper. Thickness, margin of a Wrapper causes shrinkness of containable volume. The thickness reduces each dimension's containable size (dimension - 2*thickness),
+ * so finally, it reduces total containable volume (-8 * thickness^3). Get (calculate) containable width, length on the X-axis in 3D. Calculates containable width considering the {@link thickness}. Get (calculate) containable height, length on the Y-axis in 3D. Calculates containable height considering the {@link thickness}. Get (calculate) containable length, length on the Z-axis in 3D. Calculates containable length considering the {@link thickness}. Get (calculate) volume. If {@link thickness} of the Wrapper is not 0, the volume does not mean containable volume.
+ * In that case, use {@link containableVolume} instead. Get (calculate) containable volume. Calculates containable volume considering the {@link thickness}. Wrapper is enough greater? Test whether the Wrapper is enough greater than an Instance to contain. Convert to a canvas containing 3D elements. A sample, standard of the WrapperGroup. The sample represents what type of Wrappers are grouped into the WrapperGroup. Allocate instance(s) to the WrapperGroup. Inspect the instance is enough small to be wrapped into an empty wrapper. If the instance
+ * is enough small, registers the instance (or repeated instances) to the {@link reserveds} and
+ * returns The word the instance is enough small to be wrapped into the empty wrapper means
+ * the instance can be contained into an empty, a new wrapper contaning nothing literally. In the method allocate(), it doesn't consider how many instances are wrapped into ordinary
+ * wrapper and how much volumes are consumed. Run optimization in level of the group. The optimization routine begins by creating a {@link Wrapper} like the {@link sample}. Then
+ * try to pack {@link allocatedInstanceArray allocated instances} to the {@link Wrapper} as a lot as
+ * possible. If there're some {@link Wrappers} can't be packed by overloading, then create a new
+ * {@link Wrapper} again and try to pack {@link allocatedInstanceArray instances} again, too. Repeats those steps until all {@link alloctedInstanceArray instances} are {@link Wrap packed}
+ * so that there's not any {@link Instance instance} left. When call this {@link optimize optimize()} method, ordinary children {@link Wrapper} objects
+ * in the {@link WrapperGroup} will be substituted with the newly optimized {@link Wrapper} objects. Wrap allocated instances into a new {@link Wrapper}. {@link Wrap Wraps} instances to a new Wrapper which is copied from the sample. After the wrapping is done, the new {@link Wrapper} is registered to the {@link WrapperGroup}
+ * as a child and instances failed to wrap by overloading is returned. Derived types
+ *
+ *
+ */
+ TYPE(): string;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * An array of Instance objects.
+ *
+ * @author Jeongho Nam
Notice
+ * true. If the instance is too large to be capsuled, returns false. Note
+ * Warning
+ *