Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.654.264 Times

Algorithm::BinPack 0.5

  Date Added: January 17, 2010  |  Visits: 758

Algorithm::BinPack

Report Broken Link
Printer Friendly Version


Product Homepage
Download (83 downloads)



Algorithm::BinPack is a Perl module that can efficiently pack items into bins. SYNOPSIS Algorithm::BinPack efficiently packs items into bins. The bins are given a maximum size, and items are packed in with as little empty space as possible. An example use would be backing up files to CD, while minimizing the number of discs required. my $bp = Algorithm::BinPack->new(binsize => 4); $bp->add_item(label => "one", size => 1); $bp->add_item(label => "two", size => 2); $bp->add_item(label => "three", size => 3); $bp->add_item(label => "four", size => 4); for ($bp->pack_bins) { print "Bin size: ", $_->{size}, "n"; print " Item: ", $_->{label}, "n" for @{ $_->{items} }; } METHODS new Creates a new Algorithm::BinPack object. The maximum bin size is specified as a named argument binsize, and is required. A fudge factor may be specified as a named argument fudge. If a fudge factor is specified, item sizes will be rounded up to a number divisible by the fudge factor. This can help keep items with similar sizes in order by their labels. my $bp = Algorithm::BinPack->new(binsize => 4); my $bp = Algorithm::BinPack->new(binsize => 100, fudge => 10); add_item Adds an item to be packed into a bin. Required named arguments are label and size, but any others can be specified, and will be saved. An optional bin argument can be used to manually put an item into the specified bin. $bp->add_item(label => one, size => 1); $bp->add_item(label => two, size => 2, desc => The second numeral); $bp->add_item(label => zero, size => 3, bin => 0); $bp->add_item(qw(label three size 3)); $bp->add_item(qw(label four size 4 random key)); prefill_bin (Deprecated method) add_item now knows how to handle the bin argument directly, so this method is redundant. pack_bins Packs the items into bins. This method tries to leave as little empty space in each bin as possible. It returns a list of hashrefs with the key size containing the total bin size, and items containing an arrayref holding the items in the bin. Each item is in turn a hashref containing the keys label, size, and any others added to the item. If a fudge factor was used, each item will contain a key fudgesize, which is the size this item was fudged to. for my $bin ($bp->pack_bins) { print "Bin size: ", $bin->{size}, "n"; for my $item (@{ $bin->{items} }) { printf " %-6s %-20sn", $_, $item->{$_} for keys %{ $item }; print " ---n"; } }.

Requirements: No special requirements
Platforms: Linux
Keyword: Algorithmbinpack Bin Binpack Bins Fudge Factor Item Items Label Libraries Perl Module Programming Size
Users rating: 0/10

License: Freeware Size: 4.1 KB
USER REVIEWS
More Reviews or Write Review


ALGORITHM::BINPACK RELATED
Libraries  -  Convert::Wiki::Node::Item 0.05
Convert::Wiki::Node::Item is a Perl module that represents an item in a list (aka or *). SYNOPSIS use Convert::Wiki::Node::Item; my $para = Convert::Wiki::Node->new( txt => Foo is a foobar., type => item ); print $para->as_wiki(); #...
19.46 KB  
Libraries  -  List::MRU 0.04
List::MRU is a Perl module that implements a simple fixed-size MRU-ordered list. SYNOPSIS use List::MRU; # Constructor $lm = List::MRU->new(max => 20); # Constructor with explicit eq subroutine for obj equality tests $lm =...
4.1 KB  
Libraries  -  Gtk2::Ex::MindMapView::ItemHotSpot 0.000001
Gtk2::Ex::MindMapView::ItemHotSpot is a Perl module to manage a "hot spot" on a view item. SYNOPSIS use Gtk2::Ex::MindMapView::ItemHotSpot; Four Gtk2::Ex::MindMapView::ItemHotSpots are created for each Gtk2::Ex::MindMapView::Item. The...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::Connection 0.000001
Gtk2::Ex::MindMapView::Connection is a Perl module to draw connections between view items. HEIRARCHY Glib::Object +----Gtk2::Object +----Gnome2::Canvas::Item +----Gnome2::Canvas::Shape +----Gnome2::Canvas::Bpath...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip is a Perl module to manage a grip type "hot spot" on a view item. SYNOPSIS use base Gtk2::Ex::MindMapView::HotSpot::Grip; The Gtk2::Ex::MindMapView::HotSpot::Grip defined grip type hotspots. This kind of...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip::Round 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip::Round is a Perl module to manage a round grip type "hot spot" on a view item. SYNOPSIS use Gtk2::Ex::MindMapView::HotSpot::Grip::Round; The Gtk2::Ex::MindMapView::HotSpot::Grip::Round is a round grip...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip::Lentil 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip::Lentil is a Perl module to manage a lentil shaped grip "hot spot" on a view item. SYNOPSIS use Gtk2::Ex::MindMapView::HotSpot::Grip::Lentil; A LentilGrip hotspot may be used to resize a...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip::EllipseRound 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip::EllipseRound is a Perl module to manage a round grip type "hot spot" on a ellipse item. This grip differs from the standard grip with respect to where it is placed on the Gtk2::Ex::MindMapView::Item....
50.18 KB  
Modules  -  Special menu items module 7.x-1.0
Special menu items is a Drupal module that provides placeholder and separator menu items.A placeholder is a menu item which is not a link. It is useful with dynamic drop down menus where we want to have a parent menu item which is not linking to a...
10 KB  
Libraries  -  Gtk2::Ex::MindMapView::Graph 0.000001
Gtk2::Ex::MindMapView::Graph is a Perl module that manages a directed graph. SYNOPSIS use Gtk2::Ex::MindMapView::Graph; This is internal to Gtk2::Ex::MindMapView. Its a wrapper around Jarkko Heitaniemis nice Graph module. This module is...
50.18 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB