NationStates Jolt Archive


International Domestic Basketball Leagues Newswire

Norwellia
21-03-2009, 13:14
Avoiding the ad space. Apparently, some people haven't heard of Firefox yet. ;)































Apparently there is not and has never been an international domestic basketball newswire. (Sarzonia started a thread way back in 2005, but there were no posts to it.) I think it's way past time we had one.

Now, being that I'm not the world's biggest basketball fan (though I did play on my high school's team), I'm not willing to input everything by hand, and I have only a tenuous grasp of ranking systems, not to mention that my time will be severely cramped when spring quarter starts in a couple of weeks, I won't be the one to start a champions' league for basketball. But I think it would be really cool if we had one, like in RL Europe, and I think it would be great if more people started running domestic leagues.

Basketsim, Dancougar's basketball scorinator based on NSFootySim, can be downloaded here (http://sites.google.com/site/nsdancougarfoo/files/basketsim.zip). It's in Python (http://www.python.org) (make sure you download Python first), so it's 100% platform-independent and it's faster than Java. It's very user-friendly, with detailed documentation, and it takes config files very similar to the ones you're already familiar with if you run a domestic soccer/football league. It doesn't do automatic scheduling yet, so it'll take some time to do the scheduling by hand, but it's worth it! It uses NBA rules, so it should be perfect for professional domestic leagues. It can also separate your teams into divisions like in the NBA, or in bracket groups, and they can play one another as many times as you feel like.

I won't be posting my scores yet, as I'm still working on putting my league together, but I thought I'd toss the line out and see if anyone's willing to bite.
Nethertopia
21-03-2009, 14:07
Not meant to burst your bubble, but:

http://forums.jolt.co.uk/showthread.php?t=422072
Newmanistan
21-03-2009, 14:09
Not meant to burst your bubble, but:

http://forums.jolt.co.uk/showthread.php?t=422072

Not to burst yours, but he alluded to that in his post. :)
Nethertopia
21-03-2009, 14:11
Eek. *slaps self* Damn my not reading things before taking action!
Norwellia
21-03-2009, 14:24
Hey, now my thread is five times as successful as that one, so ya did good, Nether :D
Dancougar
21-03-2009, 16:46
Auto-scheduling is the next thing on the list. I've got code that could probably be adapted to scheduling matches within groups; it's the non-conference scheduling that would be tricky. I'm thinking it would probably suffice to pick teams at random.

Scheduling would be defined per group. You would define bounds on how many games should be scheduled and the thing will just run off and do the work until it succeeds or determines you've given it impossible parameters. This is where dynamic programming comes in handy. I think providing an XML node that looks something like this would be sufficiently powerful:

scheduling {
optional minHomeVsGroupOpp [default = 1]
// The minimum number of games to play at home against each team in the group.

optional maxHomeVsGroupOpp [default = 1]
// The maximum number of games to play at home against each team in the group.

optional minAwayVsGroupOpp [default = 1]
// The minimum number of games to play away against each team in the group.

optional maxAwayVsGroupOpp [default = 1]
// The maximum number of games to play away against each team in the group.

optional numGroupGames [ default = see below ]
// The number of games to play against group opponents; this will be the same
// for all teams in the group. If X is the number of other teams in the group, then
// this value MUST fall within the bounds
// [x * (minHomevsGroupOpp + minAwayvsGroupOpp),
// x * (maxHomeVsGroupOpp + maxAwayVsGroupOpp)]
// It will default to the average value of the two bounds.

optional minHomeVsNonGroup [default = 0]
// The minimum number of games to play at home against non-group opponents.

optional maxHomeVsNonGroup [default = 0]
// The maximum number of games to play at home against non-group opponents.

optional minAwayVsNonGroup [default = 0]
// The minimum number of games to play away against non-group opponents.

optional maxAwayVsNonGroup [default = 0]
// The maximum number of games to play away against non-group opponents.

optional minNonGroupGames [ default = minHomeVsNonGroup + minAwayVsNonGroup ]
// The minimum number of games to play against non-group opponents. This MAY be greater
// than the number of non-group opponents there actually are, in which case some will be
// played multiple times. The scheduler will attempt to schedule no non-group opponent more
// than once except as needed.

optional maxNonGroupGames [ default = maxHomeVsNonGroup + maxAwayVsNonGroup ]
// The maximum number of games to play against non-group opponents. This MUST be greater
// than or equal to minNonGroupGames.
}

And if you want even finer grained control, you could still specify matches which must be played in addition to these. Do people have comments/suggestions/requests?
Norwellia
21-03-2009, 19:32
Wow, Dancougar, you are AWESOME. I can't believe I logged in this morning to find a solution, just like that.

Still, maybe I'm an idiot, but I couldn't figure out where to put that block of code. I snuck it into the top of my input XML file for the league, but Python choked on it:

G:\Norwellia\basketsim>main.py --config=samples\NBL.xml --output=samples\NBL.txt

Traceback (most recent call last):
File "G:\Norwellia\basketsim\main.py", line 50, in <module>
main()
File "G:\Norwellia\basketsim\main.py", line 44, in main
for league in xmlconfig.LoadLeagues(options.config):
File "G:\Norwellia\basketsim\xmlconfig.py", line 273, in LoadLeagues
dom = parse(xml_file)
File "C:\Python25\lib\xml\dom\minidom.py", line 1913, in parse
return expatbuilder.parse(file)
File "C:\Python25\lib\xml\dom\expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "C:\Python25\lib\xml\dom\expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0

and when I dragged the XML file into Firefox, it said:

XML Parsing Error: syntax error
Location: file:///G:/Norwellia/basketsim/samples/NBL.xml
Line Number 1, Column 1:scheduling {
^

So I assume I put it in the wrong place. :D Can you enlighten me as to where this block of code is supposed to go, exactly?
Dancougar
21-03-2009, 20:14
So I assume I put it in the wrong place. :D Can you enlighten me as to where this block of code is supposed to go, exactly?

Oh, that's not actually code. I'm just proposing an interface (and my syntax is totally not python :-D). The actual implementation would require a few hours of hacking.

The idea is that within the <group> definition, you'd specify scheduling with something like:

<scheduling>
<minHomeVsGroupOpp>0</minHomeVsGroupOpp>
<minAwayVsGroupOpp>0</minAwayVsGroupOpp>
<maxHomeVsNonGroup>8</maxHomeVsNonGroup>
<maxAwayVsNonGroup>8</maxAwayVsNonGroup>
<minNonGroupGames>10</minNonGroupGames>
<!-- use defaults for everything else -->
</scheduling>

My question for the board, before I started writing code, was whether or not this input looked sufficient for most scheduling needs.
Norwellia
21-03-2009, 20:51
OH! Yeah, it looks great to me. I'd love to see this in the next version of basketsim. I've got my league all ready to go, manual scheduling is just turning out to be too much of a pain to do an entire season with it, so I'll wait until you get the time to hack it together. Thanks, Dan!
Qazox
22-03-2009, 05:14
1952 QCAA Season (http://wikistates.outwardhosting.com/wiki/1952_in_QCAA_Basketball)

1952 QCAA Tourney (http://wikistates.outwardhosting.com/wiki/QCAA_1952_Tourney)
Norwellia
27-03-2009, 00:52
Sooooooo.....bumpity.

Any news, Danny?
Dancougar
27-03-2009, 01:07
Sooooooo.....bumpity.

Any news, Danny?

Probably not going to start work on it until this weekend.
Norwellia
27-03-2009, 01:16
OK, thanks for the update!
Dancougar
29-03-2009, 17:38
Update on Basketsim progress.

* I think I've worked out my algorithm for scheduling; it'll probably be slow to avoid in the insane memory requirements of a faster one. Currently the XML parser can parse the scheduling constraint object from the config file but I have no code yet to actually run the scheduling.
* Added a <gameday> abstraction to the league layer to store <game>s; this breaks backwards compatibility but is necessary to implement NSFS-style resume files, which I think are now in a workable state.

No timetable for a release, since my next three weekends are looking pretty busy and how much time I have during the week depends on how much coding I want to do after doing it all day at work.
Norwellia
29-03-2009, 17:51
Thanks again Dan! Do keep us posted! :)
Dancougar
23-05-2009, 22:24
I've set up an OOC thread on the new NS.net forums for basketball stuff, so progress can be updated there. As for auto-scheduler... yeah, I've been bad. Right now I have the algorithm more or less worked out, I have various bits of untested code written to do parts of it, and I can never get up the strength to work on it T_T...
Qazox
24-05-2009, 04:44
1953 QCAA Basketball (http://wikistates.outwardhosting.com/wiki/1953_in_QCAA_Basketball)

1953 QCAA Tourney (http://wikistates.outwardhosting.com/wiki/QCAA_1953_Tourney)