in reply to Fair schedule allocation?

If you assign a number to each volunteer and then make an array of total size of chunks and allocate every hour the number of the volunteer that should be able to give you the name of volunteer.

For example:

$hash = { Ben = 5, scott => 4, jim => 1 }; @names = qw( Ben Scott Jim) @array = [ 0,0,0,0,0,1,1,1,1,2]; $name = $names[$array[$_]];
You can create the @names and @array from the given data.

Replies are listed 'Best First'.
Re^2: Fair schedule allocation?
by oko1 (Deacon) on Jan 05, 2010 at 02:46 UTC
    @array = [ 0,0,0,0,0,1,1,1,1,2];

    That's exactly the kind of thing I'm trying to avoid having to do. But thanks for the suggestion, anyway. :)


    --
    "Language shapes the way we think, and determines what we can think about."
    -- B. L. Whorf