Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Settings for the Decimals to the Wins and Draw Results and Increase the Maximum Run Count in the Battle-Simulator (2.6.14513) #11980

Open
Cernelius opened this issue Sep 21, 2023 · 7 comments

Comments

@Cernelius
Copy link
Contributor

This is a follow-up to
#11962

In that issue, I asked for a decimal to be added to the Wins and Draw results in the battle-simulator. I also linked to a forum feature request, which originally asked for two such decimals to be added instead.

The request has been implemented as per my original proposal by @asvitkine (thank you) in
#11978

Actually, I did not ask for two decimals on their own: such proposal was made together with the proposal of allowing a run-count of 100,000. Without, my request was for only 1 decimal (although at an other post at the same topic I also gave run-counts to decimals suggestions which I now believe to have been too generous).

Moreover, the decimals should be always added (no matter if they are zeros). If we are using two decimals, an 80% Win chance must be written as 80.00% (not just 80%). I consider this an actual implementation problem if the PR aimed at realizing my proposal because I always intended the decimal or decimals to be added also if any one of them is a zero.

This is a test in which at Run Count 20,000 (the maximum currently possible) I ran five battle-simulations (row-distributed) each of one to five (column-distributed) spearmen (or archers) attacking 1 horseman, 1 spearman and 1 phalangite in "270BC Wars" (substantially simulating the various possibilities of a round 1 barbarians attack on Jerusalem). Thence, I've also calculated the arithmetic mean and the mean absolute deviation (from the arithmetic mean) of each set of five battle-simulations for the same number of attacking spearmen (or archers).


5 4 3 2 1
1 46.60 23.78 6.98 0.89 0.01
2 45.98 22.90 7.16 0.84 0.00
3 46.31 23.84 7.68 0.85 0.01
4 45.27 23.35 7.34 0.93 0.01
5 46.49 23.73 7.21 0.93 0.02
arithmetic mean 46.13 23.52 7.274 0.888 0.01
mean absolute deviation (from the arithmetic mean) 0.404 0.316 0.1888 0.0344 0.004

Based on these results, I definitely believe that even at the maximum run count of 20,000 having two decimals is too much because the second decimal is virtually meaningless unless you keep running multiple simulations at 20,000 and get an idea of the deviation you are getting (which would be better and faster done by just running a single simulation at more than 20,000). At most, the second decimal has some value in extreme cases like the single spearman attacking, in which the approximation of the chance to win is 0.01%, but even that is really valuable only if I make multiple simulations, as a single one can easily give me 0.00% or 0.02%, so just having a clear 0.0% only is likely not missing much (as that also means approximatively 0 chances in 1,000 attempts, which is pretty much all you need to know in a game for deciding that you have no chances even though that is not strictly the case). On the other hand, the first decimal is fairly good both for clarifying that the 0% of the single spearman attack is actually a 0.0% (so something which has to be lower than 0.05%, which means less than 1 chance in 2,000 attempts) and for clarifying that the 1% winning chance of the two spearmen attack is actually a 0.9% chance (On a 20,000 run count with only 5 attempts I'm getting either 0.8% or 0.9%, which is practically virtually irrelevant for decision making in any games (again, good enough).).

I thus either believe that the following changes are due or suggest them.

  • Change the writing style as never to elide decimals because they are zeros.

  • Increase the max Run Count to 100,000 (up from the current 20,000) both in the "Battle Calculator" and in the "Engine Settings" (The Engine Settings already allows you to set 100,000 for the "Simulation Count", but then the given "Run Count" in the "Battle Calculator" gets actually set to 1, apparently.).

  • Set the approximation (number of decimals) of the Wins and Draw results according to the following run-counts.
    Run Count 1 to 9,999: 0 decimals.
    Run Count 10,000 to 99,999: 1 decimal.
    Run Count 100,000 (my proposed maximum): 2 decimals.


This way, everyone who uses the battle-calculator with any "Run Count" lower than 10,000 won't have any changes on this matter from the current release. In order to have a decimal, you would need to set the run-count at 10,000 or more, and only the top value of 100,000 would return results on two decimals.

Although having 2 decimals on a 10,000 run-count would mean (and actually does mean in the current https://github.com/triplea-game/triplea/releases/tag/2.6.14513 pre-release) that you are getting the exact report of all that happened during every simulation (as every 0.01% point you are getting would indeed be representing one single simulation) (something that in the release is possible only at the way-too-low 100 run-count), I don't think this is really significantly useful.

@Cernelius
Copy link
Contributor Author

Cernelius commented Sep 21, 2023

If the above suggestions are not accepted, I now definitely believe that is preferable having only one decimal (instead of two of them) ceteris paribus.

@Dronatelis
Copy link

Good day I would like to know if this issue is still available

@DanVanAtta
Copy link
Member

@Dronatelis yes!

I think most of this is ready to implement, thank you @Cernelius for taking the time to do the calculations and to write this up.

These three updates all sound good:

Change the writing style as never to elide decimals because they are zeros.

Increase the max Run Count to 100,000 (up from the current 20,000) both in the "Battle Calculator" and in the "Engine Settings" (The Engine Settings already allows you to set 100,000 for the "Simulation Count", but then the given "Run Count" in the "Battle Calculator" gets actually set to 1, apparently.).

Set the approximation (number of decimals) of the Wins and Draw results according to the following run-counts.
Run Count 1 to 9,999: 0 decimals.
Run Count 10,000 to 99,999: 1 decimal.
Run Count 100,000 (my proposed maximum): 2 decimals.

@Cernelius
Copy link
Contributor Author

I want also to point out (already did) that currently there is the problem that the maximum "Run Count" in the "Battle Calculator" is different from the same in the "Battle Simulator" of "Engine Settings". Based on my testing, the former appears to be 20,000 and the latter 100,000, so having both at 100,000 or whatever same number for both (as it should be) would actually be a problem fix rather than a feature request. Also better naming both as "Battle Simulator".

@Dronatelis
Copy link

Dronatelis commented Oct 3, 2023 via email

@Cernelius
Copy link
Contributor Author

I think this is pretty much it for now. Thank you.

@asvitkine asvitkine added the 2.6 label Oct 24, 2023
Dronatelis pushed a commit to Dronatelis/triplea that referenced this issue Nov 7, 2023
…rease the Maximum Run Count in the Battle-Simulator (2.6.14513) triplea-game#11980

Signed-off-by: df414rv <[email protected]>
@asvitkine asvitkine self-assigned this Feb 25, 2024
@asvitkine
Copy link
Contributor

I pinged the author of #12086 to see if they can wrap up their PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants