View Single Post
  #59   Spotlight this post!  
Unread 08-03-2009, 00:31
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: Easy to use Offensive Power Rankings (OPR) program for mid-regional scouting

Quote:
Originally Posted by Bongle View Post
That depends on how flexible you want your parsing to be. I spent 2 hours trying to write an uber-XML parser with MSXML, then I gave up and spent about half an hour hacking together the one that I use now. All of FIRST's score pages from mid-2008 onwards are generated from the same application, and have identical formatting. I just read one line at a time and looked for the text that always preceded a team score. It works well enough for me, though it'll need an update if they ever change their match results page style.

Better idea, if you're not already committed to scraping from FIRST: scrape from TBA - they use the same style for all events, all years. Your program would be able to run OPRs all the way back to 2006.

Edit: Speaking of parsing, I notice that the prediction code doesn't work with a regional underway. I'll have to look at that tonight (I wasn't able to properly test it since all regionals were done when I initially wrote that feature).
You, sir, are wise.

As a professor used to say, there are always at least two ways to solve a problem. More often than not, the easy ways are not correct and the correct ways are not easy. We chose easy, so eventually it will come and bite us.

I used TBA data so you can get stats for events from 2006 to 2009. It's nearly impossible to obtain a 2007 event matrix that's not ill-conditioned - I believe it's due to FIRST's awful alliance sorting algorithms from that year, but have not looked into in detail. In short, OPR for 2007 will not work. If someone is feeling reminiscent this days, please take a look.

Here's the code, just run OPR from MATLAB's command window and ask for what you want. The script returns three arrays containing ranked OPR, DPR (or whatever you might call it) and +/- stats for that particular event.

I have tested it with several events, but bugs may arise. Please test and let me know.
Attached Files
File Type: zip OPR.zip (2.7 KB, 37 views)
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
Reply With Quote