![]() |
How to CALCULATE assist points
So, I realize this is well after the fact, but during the season, as we were developing a scouting database in excel, we were considering tracking each robot's individual assist locations per cycle, using a 3x3 grid as shown in the rules. A student had proposed that coding such a system would be VERY complex, given the myriad of possible outcomes. Due to circumstances of various symmetries, etc. I understand that this amount is pared significantly. Anyway, we decided on going a different route and didn't need it, but promised him that I would figure out a way to do so in the off season. I sat down last night and came up with a rather...... ugly bit of code in excel that will in fact calculate it correctly (included below), however, I was wondering if anyone else had done this, or had suggestions for a far more STREAMLINED approach.
The 3x3 grid occurs in the range C4:E6, and at the bottom of each column, as well as to the right of each row,there is a cell with a "counta" function pertaining to its respective adjacent column or row. The code: =IF(OR(AND(COUNTA(C4:E6)>5,(COUNTIF(C7:E7,">0")+CO UNTIF(F4:F6,">0")=6)),AND(COUNTIF(C7:E7,">0")+COUN TIF(F4:F6,">0")=6,(COUNTIF(C7:E7,"=3")+COUNTIF(F4: F6,"=3"))<>2,COUNTA(C4:E6)<>4)),30,IF(AND(COUNTIF( C7:E7,">0")+COUNTIF(F4:F6,">0")=6,COUNTA(C4:E6)=4, IFERROR(CELL("contents",INDIRECT(ADDRESS(MATCH(2,F 1:F6,0),MATCH(2,A7:E7,0)))),0)<>0),30,IF(AND(COUNT IF(C7:E7,">0")>1,COUNTIF(F4:F6,">0")>1),10,0))) Basically, I began with scenarios to give 3 assists, then added elements to eliminate those which would incorrectly score 30 given the set parameters. I then proceeded to do the same with the 2 assist situations. Any input would be greatly appreciated! |
Re: How to CALCULATE assist points
and though I'm not sure what language the FMS is written in, if anyone has access to that methodology, that too would be interesting/ helpful!
|
Re: How to CALCULATE assist points
Are you interested in general approaches or just better code in Excel?
|
Re: How to CALCULATE assist points
Quote:
Code:
1) Make the power set of pairs of (robot,location with ball) |
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 |
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?
|
Re: How to CALCULATE assist points
Quote:
|
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. |
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. |
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! |
Re: How to CALCULATE assist points
Ok, second try now that I had a few more free minutes...
Quote:
|
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. |
| All times are GMT -5. The time now is 15:05. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi