Go to Post You cannot change people, you can only change yourself. - KenWittlief [more]
Home
Go Back   Chief Delphi > Competition > OCCRA
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-11-2002, 07:56
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Pairings Logic Overview

The way that the code is structured(at least AFTER the Rochester HS event) is such that under a # of teams divisible by 4(since there's 4 teams in a match), you will never see an ally repeat. However, due to the nature of a 4 teams per match structure, unless you have an even multiple of 4 teams, you will see some overlap in the match sets. In an attempt to keep the pairings code from being overly restrictive and causing the program to lock up trying to meet an impossible condition, most of the pairings safeguards(ally repeat, top 4 not paired together, etc.) are disabled when generating these "overlap" matches.
Also, for those of you familiar with Visual Basic, there is a Randomize Timer line at the beginning of the generation routine. For those of you not familiar with what this does, it "seeds" the random number generator(the Randomize part) based on the # of seconds since midnight(the Timer part).

Here's a rough pseudocode of how the generation takes place:

1. Get Random Team IDs for the red alliance.
2. If one of the following conditions are true, go back to #1
-Team IDs are the same
-Teams have been allied before in this tournament
-Teams are not currently both in the top 4 of the overall rankings
-Teams are not currently in the bottom 4 of the overall rankings
-Teams are not currently used in this match set
3. Set red teams as "used" for this match set
4. Get Random Team IDs for the blue alliance.
5. If one of the following conditions are true, go back to #4
-Team IDs are the same
-Teams have been allied before in this tournament
-Teams are not currently both in the top 4 of the overall rankings
-Teams are not currently in the bottom 4 of the overall rankings
-Teams are not currently used in this match set
6. Set blue teams as "used" for this match set
7. Count Remaining teams for this set. If remaining > 4, go to 1.
8. If remaining = 0 and match sets remaining > 0, reset all team used flags and go to 1.
9. If Remaining =0 and match sets remaining = 0, then all done!
[NOTE: you only get here if there's less than 4 teams remaining to be picked from]
10. Scan through teams in internal ID order(not team # order), looking for teams without a match in this set, and assign to positions as found.
11. Clear used flags for all teams but those just found in #10, and randomly assign teams for the remaining slots.
12. Set used flags for randomly selected teams, then go back to #1

As you can see, there are some safeguards to help prevent repeat alliances. Repeat opponents I chose not to do for several reasons:

1. Due to the code preventing repeat alliances, the odds are extremely slim of a complete repeat match(same partner, BOTH opponents the same) occurring. I decided that since no match is a true repeat unless all 4 teams have played together before, a repeat opponent check would not be necessary.
2. Also, even with the existing code, I was forced to put in a counter which incremented every time the code had to restart part of the sequence because one of the conditions was not met. Whenever the counter reached 1000(which, by looking at the match generation logs, I can see happened on several occasions), the entire match generation routine would reset and restart. Adding a requirement which would in essence eliminate two additional teams from the running after every cycle would be overly restrictive.
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Long list of Thanks/Congrats from 461. Josh Hambright Thanks and/or Congrats 10 08-04-2003 12:49
Qotw [01-26-03]: Sumo Match list of the year... Ken Leung Rumor Mill 60 06-02-2003 11:30
Thanks - Wild Stang - What a match!!!!!! archiver 1999 1 23-06-2002 22:15
FIRST sumo matches list A. Snodgrass General Forum 61 14-03-2002 10:42
Avg Score CMC General Forum 14 12-03-2002 07:23


All times are GMT -5. The time now is 03:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi