Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Algorithm::BestChoice 0.01

    Download button

    No screenshots available
    Downloads: 203  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robert Krimen | More programs
    Perl Artistic License / FREE
    June 17th, 2010, 05:04 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Algorithm::BestChoice description

    Choose the best

    Algorithm::BestChoice is a Perl object similar to a hash, except it returns a result based on a given key AND relative ranking. That is, you can associate multiple values with a single key, and differentiate them by using a rank (or weight).

    SYNOPSIS

     # Find my favorite food based on color
     my $chooser = Algorithm::BestChoice->new;
     $chooser->add( match => red, value => cherry, rank => 1 )
     $chooser->add( match => red, value => apple, rank => 10 ) # Like apples
     $chooser->add( match => red, value => strawberry, rank => -5 ) # Don't like strawberries
     $chooser->add( match => purple, value => grape, rank => 20 ) # Delicious
     $chooser->add( match => yellow, value => banana )
     $chooser->add( match => yellow, value => lemon rank => -5 ) # Too sour

     my $favorite;
     $favorite = $chooser->best( red ) # apple is the favorite red
     $favorite = $chooser->best( [ red, yellow, purple ] ) # grape is the favorite among red, yellow, and purple



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl module | Perl object | algorithm | choice | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM