Results 1 to 8 of 8
  1. #1
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Round Robin algorithm

    Hello ,

    I have an java array with 10 players and i want to create a tournament .
    First i need the Round Robin scheduler. is there any example of Round Robin very simple in java example ??????

    Thank you in advanced.

  2. #2
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: Round Robin algorithm

    any idea ????????????????

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,348
    Blog Entries
    7
    Rep Power
    20

    Default Re: Round Robin algorithm

    Java Code:
    int current= ...;
    int next= (current+1)%array.length;
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: Round Robin algorithm

    I didn't understand please can you explain ???

    i have this array with 6 player.

    static String RoundRob [] = new String[6];
    how i have to do it????

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,348
    Blog Entries
    7
    Rep Power
    20

    Default Re: Round Robin algorithm

    Quote Originally Posted by ki_ha1984 View Post
    I didn't understand please can you explain ???

    i have this array with 6 player.

    static String RoundRob [] = new String[6];
    how i have to do it????


    Java Code:
    int current= ...;
    int next= (current+1)%RoundRob.length;
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: Round Robin algorithm

    Sorry jos but i am very new in Java the variable current what should content????

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,348
    Blog Entries
    7
    Rep Power
    20

    Default Re: Round Robin algorithm

    Quote Originally Posted by ki_ha1984 View Post
    Sorry jos but i am very new in Java the variable current what should content????
    'current' is an index in your array and 'next' is the next index, calculated in a round robin way (i.e. the value wraps around).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    ki_ha1984 is offline Member
    Join Date
    Aug 2011
    Posts
    74
    Rep Power
    0

    Default Re: Round Robin algorithm

    thank you very much but i think that i find the solution.
    i will post it when is rady.

Similar Threads

  1. help with math.round
    By talia in forum New To Java
    Replies: 4
    Last Post: 12-14-2011, 02:04 PM
  2. Round of help
    By micolord in forum New To Java
    Replies: 5
    Last Post: 10-08-2011, 05:56 AM
  3. Using math.round
    By Hype in forum New To Java
    Replies: 3
    Last Post: 01-30-2011, 11:57 PM
  4. going round and round in class..
    By sonny in forum New To Java
    Replies: 52
    Last Post: 04-02-2010, 10:56 AM
  5. How to round a double?
    By Valeriano in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 03:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •