View Full Version : Easy to use Offensive Power Rankings (OPR) program for mid-regional scouting
This is awesome. Thank you!
I've been fairly googlish with my posting of source code, but here's v20's. It's fairly hackish code because I keep patching it with new features each year that I didn't originally envision, so please don't judge me on the quality.
source code ... here's v20's.
Just curious: what are you using LU decomposition for ?
Here's v20. I made it so the overall OPR is also given the coopertition adjustment (coopertition points * 5, assuming that CPs are points you could have gotten if your alliance assigned you to a different bridge), and did a clean-and-build to attempt to fix the 0xc000007b errors people are getting.
Bongle,
I might be doing this wrong, but I seem to be having a problem; whenever I submit a response to the final query (i.e. 'r' for sort teams by rank), it creates two temporary files, then shuts down. A couple years ago, when I fooled around with one of your earlier versions, it worked fine. Now however, apparently I'm doing something wrong. Any idea what I've done?
Bongle,
I might be doing this wrong, but I seem to be having a problem; whenever I submit a response to the final query (i.e. 'r' for sort teams by rank), it creates two temporary files, then shuts down. A couple years ago, when I fooled around with one of your earlier versions, it worked fine. Now however, apparently I'm doing something wrong. Any idea what I've done?
If you rename the temporary files to .html and try to view them in a browser, they should just be the FIRST results pages. If they aren't, or they look stylistically different than this (frclinks.com/e/m/nh) one, then the parser that extracts the scores might be having trouble.
Just curious: what are you using LU decomposition for ?
I believe that's the technique the matrix solving library I use (JAMA) uses. I don't know too many details about it.
If you rename the temporary files to .html and try to view them in a browser, they should just be the FIRST results pages. If they aren't, or they look stylistically different than this (frclinks.com/e/m/nh) one, then the parser that extracts the scores might be having trouble.
I believe that's the technique the matrix solving library I use (JAMA) uses. I don't know too many details about it.
Sorry, should have specified.
It doesn't ever return any results. After a second of thinking, it just shuts down, though I did notice it creating those two temp files.
Sorry, should have specified.
It doesn't ever return any results. After a second of thinking, it just shuts down, though I did notice it creating those two temp files.
Here's v21: The only new feature is that it won't instantly shut down when it has an error. This should help debug your problem. If you run the current one from a command line that'd help too.
BlacksmithWoods
07-03-2012, 21:29
What does this mean? I keep getting:
Failure to download results. Code -2147024809
Thanks! :D
Edit: Is this because I'm using v21 and I'm checking years prior to 2012?
I believe that's the technique the matrix solving library I use (JAMA) uses. I don't know too many details about it.
For coefficient matrices associated with processing data from single events one at a time (even large events), LU is probably fine. But if you ever want to do computations for, say, an entire year's worth of data in one matrix (simultaneous solution using data from all events in the year), you might want to consider using Cholesky instead. It's twice as fast. The JAMA library you are using supports Cholesky.
v22 - should fix the problems with downloading past-years results.
Ether, thanks for the tip.
Bongle, in the post-season I may assist you with some refactoring if you'd like. Extension of legacy code well after its expected end of life cycle is what I do best at work. Do you have the code up on a repository?
Clinton Bolinger
08-03-2012, 09:38
Here's v20. I made it so the overall OPR is also given the coopertition adjustment (coopertition points * 5, assuming that CPs are points you could have gotten if your alliance assigned you to a different bridge), and did a clean-and-build to attempt to fix the 0xc000007b errors people are getting.
Why wouldn't we want to have the Coopertition Points to time 10 instead of 5?
The Coop Bridge is the same maneuver as a 2-bot balance which is equal to 20 points. Also for bridge OPR I would use the BP + (CP*10) = Total Bridge Points.
This will assist team that are looking for good Bridge balancers.
-Clinton-
Why wouldn't we want to have the Coopertition Points to time 10 instead of 5?
-Clinton-
But CPs are handed out to both alliances and require both alliances to participate.
2-bot balance = 20 points granted to the 3-robot alliance that scored it = 60 robot-points.
co-op balance = 2 CPs granted to all 6 robots on the field = 12 robot-CPs. If we want it to be equivalent, then I think we should say it was 5 fake points per CP.
I could take the adjustment out entirely and make a 4th stat that just shows how many CPs a team is expected to achieve, then teams could apply their own adjustment if they felt like it.
Bongle, in the post-season I may assist you with some refactoring if you'd like. Extension of legacy code well after its expected end of life cycle is what I do best at work. Do you have the code up on a repository?
I've got it on a local perforce server in my house, but nowhere else other than my intermittent source posts on CD. Since I'm unlikely to touch the code at all post-CMP, you could take the last source post I make, make the changes, then post it back on CD (or set up an actual repository).
v22 - should fix the problems with downloading past-years results.
Ether, thanks for the tip.
I'm getting a message that says it can't download the results; does that have something to do with the firewall here at the school where I teach?
I'm getting a message that says it can't download the results; does that have something to do with the firewall here at the school where I teach?
Click on the link in this post:
http://www.chiefdelphi.com/forums/showpost.php?p=1140730&postcount=255
... and see if you have permission to download the data.
AlexD744
11-03-2012, 20:06
Click on the link in this post:
http://www.chiefdelphi.com/forums/showpost.php?p=1140730&postcount=255
... and see if you have permission to download the data.
I'm getting the same message, saying that I can not download the results. I tried clicking on the link in that post and it worked fine. Any other suggestions? If it helps the error code is: -2147024891, and I am using v22.
I'm getting the same message, saying that I can not download the results. I tried clicking on the link in that post and it worked fine. Any other suggestions? If it helps the error code is: -2147024891, and I am using v22.
I actually had a similar problem earlier today - are you trying to run it from inside the zip file? I found that windows wouldn't permit the temporary file to be created if you ran it inside the zip file. Try copying OPRNet.exe to your desktop or something, then running it.
AlexD744
11-03-2012, 20:13
I actually had a similar problem earlier today - are you trying to run it from inside the zip file? I found that windows wouldn't permit the temporary file to be created if you ran it inside the zip file. Try copying OPRNet.exe to your desktop or something, then running it.
Works perfectly now, thank you!
Excellent, I confirmed it as well. Here's v23, which downloads to your windows temp folder (as reported by GetTempPath()) rather than the local folder. It also cleans up after itself when it is done, which the old version did not.
Its saying that the file is invalid or corrupted.
Its saying that the file is invalid or corrupted.
So it is. I guess my zip file got corrupted somehow. Here's a new one.
How do you get a MSVCP100.dll?
billbo911
12-03-2012, 00:32
How do you get a MSVCP100.dll?
http://www.chiefdelphi.com/forums/showpost.php?p=1139964&postcount=243
Ok, here's v19. This includes, for 2012, the ability to rank teams on hybrid/bridge/teleop categories. I assumed that 2 coopertition points = 10 points of bridge scoring.
I may have skipped a version number.
Did you take into account that what is reported as TeleOp* is actually the SUM of that team's alliance's TeleOP plus Foul points?
*at "http://www2.usfirst.org/2012comp/Events/XXX/matchresults.html"
Did you take into account that what is reported as TeleOp* is actually the SUM of that team's alliance's TeleOP plus Foul points?
*at "http://www2.usfirst.org/2012comp/Events/XXX/matchresults.html"
Unfortunately, I can't because I don't have a readily-accessible data source (aka not the FMS twitter feed) to get the foul points from.
Unfortunately, I can't because I don't have a readily-accessible data source (aka not the FMS twitter feed) to get the foul points from.
HP and BP appear to be a straight sum. I wonder if it would be possible to calculate FP from the QS, HP, BP, TP (actually TP+FP), and CP that are in the data sets you are using ?
Or you could get the same data as the Twitter feed from CD's frcspy XML feed, no?
v24: New feature - The 'sched' statistic prints out the average OPR of your allies and opponents so you can kvetch about how you had to play 1114, 2056, 67, 341 and so on every single match and that's why you ranked so low :-)
I seem to be doing something very wrong. Every time I enter anything in the OPRnet (v24) window, it goes into what appears to be an infinite loop of location codes (I think; it's going really fast). Text saying "Please e... >>>" [enter?] zips by every loop as well.
Anyone feel like helping a clueless gearhead?
EDIT: I've tried using the sample offered in the opening lines of the OPRnet window, as well as various codes from threads like these (www.chiefdelphi.com/forums/showthread.php?t=105087).
DampRobot
04-04-2012, 19:24
I seem to be doing something very wrong. Every time I enter anything in the OPRnet (v24) window, it goes into what appears to be an infinite loop of location codes (I think; it's going really fast). Text saying "Please e... >>>" [enter?] zips by every loop as well.
Anyone feel like helping a clueless gearhead?
EDIT: I've tried using the sample offered in the opening lines of the OPRnet window, as well as various codes from threads like these (www.chiefdelphi.com/forums/showthread.php?t=105087).
I did the same thing. Instead of entering the whole string, just enter the year, hit enter, then the regional code, hit enter, etc.
I seem to be doing something very wrong. Every time I enter anything in the OPRnet (v24) window, it goes into what appears to be an infinite loop of location codes (I think; it's going really fast). Text saying "Please e... >>>" [enter?] zips by every loop as well.
Anyone feel like helping a clueless gearhead?
EDIT: I've tried using the sample offered in the opening lines of the OPRnet window, as well as various codes from threads like these (www.chiefdelphi.com/forums/showthread.php?t=105087).
I should probably fix that bug... When it asks for year, just enter the year ('2012' without quotes) and nothing else. Then when asks for regional, enter just the regional code.
The little scripts you see posted around (like "oprnet il 2009 opr r q > output.txt") are for if you want to automatically run oprnet from a batch file without having to actually interact with it. It's useful for spitting out results for a ton of regionals at once.
v25 - fixes that bug, and no longer requires the visual c++ 2010 runtimes to run! Hooray for changing a small configuration option!
Do'h! Awesome, thank you. I guess to run a batch file you have to like, use a batch file, huh? Whoops. :o
EDIT: Oh, thank you again :) [for v25]
MoHottaMoBetta
14-04-2012, 02:35
v25 works great. Thank you!!
Will you be posting the v25 sources at some point?
MoHottaMoBetta
15-04-2012, 02:51
Thanks for sharing the sources Bongle!
I'm a new mentor this year. Being a programmer I want to get my head into the actual algorithm used to calculate the OPR and DPR values to understand it for myself. A quick scan of the sources shows its playing with matrices so I am guessing its time to refresh myself on Linear Algebra.
I skimmed around the CD forums but I see mostly talk of using the values but nothing on any actual algorithm (or a description of the algorithm). I am sure there has to be some place it is described but I am just not finding it. Can anyone point me in the right direction?
Being a programmer I want to get my head into the actual algorithm used to calculate the OPR... but I am just not finding it. Can anyone point me in the right direction?
http://www.chiefdelphi.com/forums/showthread.php?p=1119150
MoHottaMoBetta
26-04-2012, 20:09
I just tried to use OPRNet 25 on a couple of the divisions at the current Championships and it is not happy with something:
3 [C:\Downloads\OPRNet25] oprnet arc 2012 opr r
Temporary file created
URL opened
Downloaded 1024 bytes
Downloaded 1245 bytes
Downloaded 1245 bytes
File download complete
Parsing!
No matches found. This regional may not have run yet, or may have HTML output that the parser does not recognize.
Failure to parse XML. Code: -2147467259
Press any key to continue . . .
3 [C:\Downloads\OPRNet25] oprnet new 2012 opr r
Temporary file created
URL opened
Downloaded 1024 bytes
Downloaded 1245 bytes
Downloaded 1245 bytes
File download complete
Parsing!
No matches found. This regional may not have run yet, or may have HTML output that the parser does not recognize.
Failure to parse XML. Code: -2147467259
Press any key to continue . . .
Is anyone else seeing this? (I know there is data as I can see it on the FIRSt site.) Just thought I would ask before I try to dive into the source.
The Lucas
27-04-2012, 01:22
3 [C:\Downloads\OPRNet25] oprnet new 2012 opr r
Temporary file created
URL opened
Downloaded 1024 bytes
Downloaded 1245 bytes
Downloaded 1245 bytes
File download complete
Parsing!
No matches found. This regional may not have run yet, or may have HTML output that the parser does not recognize.
Failure to parse XML. Code: -2147467259
Press any key to continue . . .
Is anyone else seeing this? (I know there is data as I can see it on the FIRSt site.) Just thought I would ask before I try to dive into the source.
I had that issue. Just use the full division name (e.g. newton). OPRnet just uses whatever string you type into that parameter as part of the URL. The New FIRST website no longer redirect the division abrieviations (e.g. new) to the correct URL.
On a side note, the OPRs of the Divisions Thursday night are pretty much worthless. With only 3-4 matches completed for 100 teams, the matrix is barely solveable. Expect lots of redculously high and low numbers :rolleyes:
Austin2046
27-04-2012, 01:41
I had that issue. Just use the full division name (e.g. newton). OPRnet just uses whatever string you type into that parameter as part of the URL. The New FIRST website no longer redirect the division abrieviations (e.g. new) to the correct URL.
On a side note, the OPRs of the Divisions Thursday night are pretty much worthless. With only 3-4 matches completed for 100 teams, the matrix is barely solveable. Expect lots of redculously high and low numbers :rolleyes:
lol, I ran the numbers earlier just to see how they were looking for Archimedes, and yeah... they seem, how should we say... less than accurate. :P
Yeah, the numbers probably won't be usable until teams' 6-7th matches. I wish I knew more stats and could give error bars on team's OPRs, that'd be handy. It's just a simple linear regression, I'd think the math on how to get confidence intervals would be straightforward, but I haven't found it.
MoHottaMoBetta
30-04-2012, 21:39
I found it took until the 7-8th matches to settle down enough to be usable.
For fun I also had it predict the Saturday AM matches for all 4 divisions. It correctly predicted 72.72% of the Archimedes matches and a few were pretty dang close to the predicted score. I will check how well it did on the other 3 divisions if anyone is interested.
It's just a simple linear regression, I'd think the math on how to get confidence intervals would be straightforward, but I haven't found it.
It might be more complicated than you think. Consider the following problem:
http://www.chiefdelphi.com/forums/showthread.php?p=1165314
Navid Shafa
14-03-2013, 12:32
Sorry for thread bumping if this is a dead channel, but I'm curious as to where I could find the OPRNet.exe for this season.
Joe Ross
14-03-2013, 12:36
Sorry for thread bumping if this is a dead channel, but I'm curious as to where I could find the OPRNet.exe for this season.
the previous version still works, as long as you apply the new event codes.
fr05ty27355
14-03-2013, 13:08
the previous version still works, as long as you apply the new event codes.
Where can I find the new event codes?
Where can I find the new event codes?
http://frclinks.frclinks.com/
the previous version still works, as long as you apply the new event codes.
Sweet!
Because I don't have the time anymore to update it :(
Couldn't even make it to montreal with 2702 :( :(
Navid Shafa
14-03-2013, 13:23
Thank you, I'll give it a shot!
Doesn't work for me... It doesn't allow me to use the new codes. For example, whenever I type "ista" it reprints the list of old codes.
Navid Shafa
14-03-2013, 13:53
I got it to output the raw OPR for Oregon correctly. It's just weird that it has an option to select bridge points :S
I would love to be able to sort by hybrid, climb and do everything from last year. Maybe I'll need to take a look at the source code and see how hard it would be to bring it up to speed with 2013.
I don't know if I'm up to the task, but I'd certainly like the data :)
Does it allow for week 2 events? I tried everything for Orlando and then tried San Diego to just make sure I wasn't doing anything wrong and it failed every time.
Navid Shafa
14-03-2013, 13:57
Does it allow for week 2 events? I tried everything for Orlando and then tried San Diego to just make sure I wasn't doing anything wrong and it failed every time.
Oregon was week 2 and that worked for me. Using V25, enter 2013, the new regional code from the frclink that Ether posted, then type OPR, and sort by r. Should work for Oregon, might work for other regionals too.
Oregon was week 2 and that worked for me. Using V25, enter 2013, the new regional code from the frclink that Ether posted, then type OPR, and sort by r. Should work for Oregon, might work for other regionals too.
Can anyone upload V2.5 again? The first post only has V3, in which the new codes don't work,
Navid Shafa
14-03-2013, 14:03
I should probably fix that bug... When it asks for year, just enter the year ('2012' without quotes) and nothing else. Then when asks for regional, enter just the regional code.
The little scripts you see posted around (like "oprnet il 2009 opr r q > output.txt") are for if you want to automatically run oprnet from a batch file without having to actually interact with it. It's useful for spitting out results for a ton of regionals at once.
v25 - fixes that bug, and no longer requires the visual c++ 2010 runtimes to run! Hooray for changing a small configuration option!
This was from page 19 in the thread, this is the most recent executable. Find Bongle's thread about 2/3 of the way down the page and download and extract that.
*Also the newest version is 25, not 2.5
I'd certainly like the data
What data are you looking for that can't be found in Ed Law's OPR spreadsheet (http://www.chiefdelphi.com/forums/showthread.php?p=1246344#post1246344) or the Twitter data (http://www.chiefdelphi.com/forums/showthread.php?t=114799) or Conor Ryan's FRC Analytics spreadsheet (http://www.chiefdelphi.com/forums/showthread.php?p=1241994#post1241994)?
Yep, I'd recommend using other OPR apps. Maybe next year I'll have the time to get this up to snuff, but it looks like there's lots of other ways to get OPR for now.
Navid Shafa
14-03-2013, 14:46
What data are you looking for that can't be found in Ed Law's OPR spreadsheet (http://www.chiefdelphi.com/forums/showthread.php?p=1246344#post1246344) or the Twitter data (http://www.chiefdelphi.com/forums/showthread.php?t=114799) or Conor Ryan's FRC Analytics spreadsheet (http://www.chiefdelphi.com/forums/showthread.php?p=1241994#post1241994)?
I'd like to use it like I have in the past, live updating at the regionals. I want to be able to pull Auto, Pyramid, Tele and the predict function. I know I could use Ed's after the regional, or live if I input the data myself. I guess I just got used to using this exe the past couple years.
Navid Shafa
14-03-2013, 14:48
Yep, I'd recommend using other OPR apps. Maybe next year I'll have the time to get this up to snuff, but it looks like there's lots of other ways to get OPR for now.
I can't download the OPR Android app on my phone unfortunately, if that's what you are referring to :(
I'll figure something out. Thanks for all your work in the past, I certainly took it for granted and miss it now it's gone.
I'd like to use it like I have in the past, live updating at the regionals.
OK. That part wasn't clear.
Navid Shafa
14-03-2013, 15:08
OK. That part wasn't clear.
My apologies
Pat Fairbank
14-03-2013, 18:22
frcstats.appspot.com/oprs/[event code]/2013 seems to work okay for some events, although I'm not sure if the numbers are 100% accurate. I wrote it a couple of years ago and forgot about it until now.
Example: http://frcstats.appspot.com/oprs/casd/2013
It doesn't work for e.g. http://frcstats.appspot.com/oprs/onto/2013 though I'm not sure why. It downloads the event rankings on the fly so maybe there's something different about the formatting for that event.
Joe Ross
14-03-2013, 18:26
frcstats.appspot.com/oprs/[event code]/2013 seems to work okay for some events, although I'm not sure if the numbers are 100% accurate. I wrote it a couple of years ago and forgot about it until now.
Example: http://frcstats.appspot.com/oprs/casd/2013
It doesn't work for e.g. http://frcstats.appspot.com/oprs/onto/2013 though I'm not sure why. It downloads the event rankings on the fly so maybe there's something different about the formatting for that event.
The OPRs for San Diego don't make sense.
Gaurav27
14-03-2013, 18:39
frcstats.appspot.com/oprs/[event code]/2013 seems to work okay for some events, although I'm not sure if the numbers are 100% accurate. I wrote it a couple of years ago and forgot about it until now.
Example: http://frcstats.appspot.com/oprs/casd/2013
It doesn't work for e.g. http://frcstats.appspot.com/oprs/onto/2013 though I'm not sure why. It downloads the event rankings on the fly so maybe there's something different about the formatting for that event.
The OPRs for San Diego don't make sense.
Many of the regionals' OPRs don't make much sense. They are all inflated numbers. Seems to have some sort of a base value since there is no negative OPR entry.
Navid Shafa
14-03-2013, 18:59
They are all inflated numbers. Seems to have some sort of a base value since there is no negative OPR entry.
I agree, looks like Oregon's data is rather inflated and not accurate with other OPR data. The ranking looks close, but something is not quite right...
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.