|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: How to CALCULATE assist points
You can abuse the fact that assists can be calculated on the diagonal of the grid, if you count the robot-zone combinations along a diagonal, you can find the number of assits for a given column arrangement. If you also swap the columns around, and take the max, you can find the total assists.
Here's a quick example in python: Code:
#~/usr/bin/env python
import sys
def main ():
if (len(sys.argv) < 1 + (3*3)):
return
grid = [[0,0,0], [0,0,0], [0,0,0]]
for i in range(0, 3):
for j in range(0, 3):
grid[i][j] = int(sys.argv[1+(i*3)+j])
print "The combination:"
printgrid(grid)
print "Has", calcAssists(grid), "assists"
def calcAssists (grid):
asstCombs = [0]*(3*2*1) # 3! Combinations
asstCombs[0] = calcDiagonal([grid[0], grid[1], grid[2]])
asstCombs[1] = calcDiagonal([grid[0], grid[2], grid[1]])
asstCombs[2] = calcDiagonal([grid[1], grid[0], grid[2]])
asstCombs[3] = calcDiagonal([grid[1], grid[2], grid[0]])
asstCombs[4] = calcDiagonal([grid[2], grid[0], grid[1]])
asstCombs[5] = calcDiagonal([grid[2], grid[1], grid[0]])
return max(asstCombs)
def calcDiagonal (grid):
return (grid[0][0] + grid[1][1] + grid[2][2])
def printgrid (grid):
for i in range(0, 3):
print str(grid[i][0]), str(grid[i][1]), str(grid[i][2])
if __name__ == "__main__": main()
Last edited by timytamy : 30-07-2014 at 09:36. |
|
#2
|
|||
|
|||
|
Re: How to CALCULATE assist points
Just curious, is there any way off actually obtaining/ accessing actual FMS source code? Also, is anyone reading this familiar with what language/ protocol it employs?
|
|
#3
|
||||
|
||||
|
Re: How to CALCULATE assist points
I think that this is something that everyone wishes was available to FRC team. Unfortunately, the source code has not been publicly released.
|
|
#4
|
||||
|
||||
|
Re: How to CALCULATE assist points
Quote:
However this only specifies robot control, AFAIK the scoring system in the main FMS is not accessible by teams over the network. |
|
#5
|
||||
|
||||
|
Re: How to CALCULATE assist points
Quote:
The FMS proper (i.e. the big server box) is written primarily in .NET (with an MVC front end). There are other pieces to the field electronics (such as the driver station boxes), but I'm not sure what those run. |
|
#6
|
||||
|
||||
|
Re: How to CALCULATE assist points
Perhaps a better way of doing the calculation:
Quote:
Quote:
Note: Why doesn't excel have a function like Oracle's DECODE function in SQL? I so wanted to use that for this solution! Edit: I just realized there's an edge case this doesn't handle correctly - two robots both poses in zone 1, then a third possesses in zones 2 and 3. Back to the drawing board! Last edited by Jon Stratis : 06-08-2014 at 11:14. |
|
#7
|
||||
|
||||
|
Re: How to CALCULATE assist points
Ok, second try now that I had a few more free minutes...
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: How to CALCULATE assist points
Quote:
The performance is far better. Not a huge issue for most excels, but a huge performance difference in google spreadsheets. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|