Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    Hi all,

    a few days ago I found the Weewar Battle Simulator: http://www-personal.umich.edu/~mwhorton/WWsim3.html

    It's a really nice tool.:) I thought about how to exactly calculate the probabilities for all possible battles' outcomes. And yes, I finally managed to write some python code, which does exactly calculate the battle result probabilities, without having to perform simulations. (Remember: I am not calculating the actual results of a battle (because of randomness), I am calculating the probabilities for all possible outcomes.)

    Unfortunately, I do not have a root server or something I could run Django/Python at, to make use of this code. And I am not motivated enough to port it to dirty PHP or something like that.

    Moreover I think that it's better, when everybody can see how to build such a calculator. For this reason I publish my code:

    http://files.robertnitsch.de/wwbattlelib.zip

    License: GPL v2

    I hope some tools can profit from my work. Smile

    Regards, bmaker

    2008-02-04 11:00:21.0

    Hi bmaker, would you mind if I ported it to Ruby?

    2008-02-05 07:01:46.0

    No problem! Indeed, that would be even great.;)

    2008-02-05 08:12:39.0

    Considering there is some randomness in the way the actual weewar battles work, I don't know how you can exactly calculate results - the moment you introduce anything random, determinism is gone.

    That said, Matt's might need a bit of tweaking to get more accuracy out of it, but until the weewar engine removes indeterminism from the battles, you can't get things "exactly" calculated.

    2008-02-08 16:26:02.0

    Jason, read the code.

    If you flip 4 coins and count the number of heads, that's similar to the process used in weewar battles. What does it mean to calculate results exactly? Simple - give the answer "0: 1/16, 1: 4/16, 2: 6/16, 3: 4/16, 4: 1/16". In other words, give the exact probabilities. The way the old simulator works is simulation - it tosses 4 coins a godawful number of times and tallies the results. bmaker is just saying he calculates the probabilities instead of guessing them from simulation.

    2008-02-08 17:15:40.0

    GA is right.  Calculating the exact results has been discussed before, but until now no one has had the will or know-how to do so... so I'm glad to see this and it is very cool!.:)  However, an elegant calculation will still yield the same result as a "godawful" simulation, a trivial task with modern computing.

    2008-02-08 19:36:29.0

    Yeah, as per my usual MO, I didn't really read things well enough before spouting off.

    :P

    Reading just takes so much time, time I could be spending with my kids!


    2008-02-08 22:03:26.0

    GA is right. By the way I edited my post to explain what my code is actually intended to do...

    2008-02-09 11:38:37.0

    There was a small mistake, making the calculator ignore the bonus value. I uploaded the new code (see first post for download link), so now the bonus should influence the probabilities as well.

    2008-02-29 10:13:20.0

    I can serve this.  I would rather serve Ruby code than Python code, though. :)  So, where is the latest source code, bmaker/mattgrande?

    2008-03-03 11:32:09.0

    Sorry guys, I've been busy!

    2008-03-11 09:17:23.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic