Bin object for use in packing algorithm implementations.
A Bin instance has two attributes: size, which is the total "size" of the contents of the Bin, and objects, which is a list of the Bins contents.
Example:
strings = Bin() s = "hello" strings.add(s, len(s)) s.objects ['hello'] s.size 5
Definition at line 66 of file packing.py.
Inherits object.
Inherited by lalburst.cafe.LALCacheBin.
Public Member Functions | |
def | __init__ (self) |
Initialize a new Bin instance. More... | |
def | add (self, obj, size) |
Add the object, whose size is as given, to the bin. More... | |
def | __iadd__ (self, other) |
Add the contents of another Bin object to this one. More... | |
def | __lt__ (self, other) |
def | __le__ (self, other) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __ge__ (self, other) |
def | __gt__ (self, other) |
def | __repr__ (self) |
A representation of the Bin object. More... | |
Data Fields | |
objects | |
size | |
def lalburst.packing.Bin.__init__ | ( | self | ) |
Initialize a new Bin instance.
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 70 of file packing.py.
def lalburst.packing.Bin.add | ( | self, | |
obj, | |||
size | |||
) |
Add the object, whose size is as given, to the bin.
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 77 of file packing.py.
def lalburst.packing.Bin.__iadd__ | ( | self, | |
other | |||
) |
Add the contents of another Bin object to this one.
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 85 of file packing.py.
def lalburst.packing.Bin.__lt__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 94 of file packing.py.
def lalburst.packing.Bin.__le__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 97 of file packing.py.
def lalburst.packing.Bin.__eq__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 100 of file packing.py.
def lalburst.packing.Bin.__ne__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 103 of file packing.py.
def lalburst.packing.Bin.__ge__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 106 of file packing.py.
def lalburst.packing.Bin.__gt__ | ( | self, | |
other | |||
) |
Reimplemented in lalburst.cafe.LALCacheBin.
Definition at line 109 of file packing.py.
def lalburst.packing.Bin.__repr__ | ( | self | ) |
A representation of the Bin object.
Definition at line 115 of file packing.py.
lalburst.packing.Bin.objects |
Definition at line 71 of file packing.py.
lalburst.packing.Bin.size |
Definition at line 72 of file packing.py.