Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALBurst 2.0.7.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Macros Modules Pages
lalburst.packing.Packer Class Reference

Detailed Description

Parent class for packing algorithms.

Specific packing algorithms should sub-class this, providing implementations of the pack() and packlist() methods.

Definition at line 137 of file packing.py.

Inherits object.

Inherited by lalburst.cafe.CafePacker, and lalburst.packing.BiggestIntoEmptiest.

Public Member Functions

def __init__ (self, bins)
 Set the list of bins on which we shall operate. More...
 
def pack (self, size, obj)
 Pack an object of given size into the bins. More...
 
def packlist (self, size_object_pairs)
 Pack a list of (size, object) tuples into the bins. More...
 

Data Fields

 bins
 

Constructor & Destructor Documentation

◆ __init__()

def lalburst.packing.Packer.__init__ (   self,
  bins 
)

Set the list of bins on which we shall operate.

Definition at line 141 of file packing.py.

Member Function Documentation

◆ pack()

def lalburst.packing.Packer.pack (   self,
  size,
  obj 
)

Pack an object of given size into the bins.

Reimplemented in lalburst.cafe.CafePacker, and lalburst.packing.BiggestIntoEmptiest.

Definition at line 147 of file packing.py.

◆ packlist()

def lalburst.packing.Packer.packlist (   self,
  size_object_pairs 
)

Pack a list of (size, object) tuples into the bins.

Default implementation invokes self.pack() on each pair in the the order given.

Reimplemented in lalburst.packing.BiggestIntoEmptiest.

Definition at line 156 of file packing.py.

Field Documentation

◆ bins

lalburst.packing.Packer.bins

Definition at line 142 of file packing.py.