View Single Post
  #5   Spotlight this post!  
Unread 30-03-2008, 16:56
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Suggestion to improve the alliance choosing program

Quote:
Originally Posted by stj_1533 View Post
Bongle,

I'm not sure, but I think your code includes the numbers of all three teams on each alliance. If you're calculating the average team number of only of the teams you're paired with, wouldn't you want to keep your own team number out of the average? If that's the case, it'll flatten out the "who you are paired with" average with respect to your own team number. It won't change your opponent's average team number, though. I could easily be reading the code wrong. I thought what was important was the average team number of who you were paired with, which should ideally be constant versus team number, not the whole alliance, which your own team number will influence.

- Steve
Well, when it's doing the summing for the team's you're with, it leaves your team out of your bucket. iTeamWithSum is an array of 26 elements. iTeamWithSum[0] represents the sum of all alliance partners of (0-99) numbered teams, iTeamWithSum[1] is the sum of all alliance partners of (100-199) numbered teams, and so on. So to say that "188 (a 100-199 team) had team numbers 865 and 703", the code would be iTeamWithSum[1] += 865 + 703.

Example: Let's say we have an alliance of 1114, 1503, and 1680.

It would do:
iTeamWithSum[11] += 1680 + 1503 // 1114 was paired with 1680 and 1503
iTeamWithSum[15] += 1114 + 1680 // 1503 was paired with 1114 and 1680
iTeamWithSum[16] += 1114 + 1503 // 1680 was paired with 1114 and 1503

average[11] = (1680 + 1503) / 2; // note that this isn't affect by 1114 being on the 1114/1503/1680 alliance

So the actual team number that we're doing the indexing by is not included in the average, and thus shouldn't effect the final average (for that bucket).

Good argument though, keep them coming. We don't want to make a fuss if my code is simply wrong.
Reply With Quote