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 | |
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.
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.
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.
lalburst.packing.Packer.bins |
Definition at line 142 of file packing.py.