-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dynamic bot spawning based on target population #459
base: main
Are you sure you want to change the base?
Conversation
…n GameConfig.java and depending on the difference between the current population of Bots and the target population (or ratio) the decision is made which type of bot will be spawned next.
* @param world | ||
* @param game | ||
* @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either add descriptions to these or remove this part of the JavaDoc comment
public record BotPopulationDistributionTarget(double stupidBotRatio, double kamikazeBotRatio, | ||
double scaredBotRatio) { | ||
public BotPopulationDistributionTarget { | ||
assert (stupidBotRatio + kamikazeBotRatio + scaredBotRatio == 1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with exact floating point math. Better check for Math.abs(x1 + x2 + x3 - 1.0) < 1e-8
IMO we need to rethink this a bit. I would prefer the following algorithm:
Another option would be to
|
Implemented dynamic bot spawning. The target ratios are now defined in
GameConfig.java
and depending on the difference between the current population of Bots and the target population (or ratio) the decision is made which type of bot will be spawned next.