Minor fixes

This commit is contained in:
Andras Schmelczer 2023-06-01 08:21:39 +01:00
parent 8817e5b090
commit c26fd93087
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 26 additions and 18 deletions

View file

@ -28,7 +28,7 @@ export class GameRules {
nextGenerationCount: number;
} = {
currentGenerationCount: 0,
nextGenerationCount: 0,
nextGenerationCount: 1,
};
public constructor(startingTimeInSeconds: number) {
@ -94,7 +94,9 @@ export class GameRules {
const currentGenerationCount =
this.nextGenerationId % 2 === 1 ? evenGenerationCount : oddGenerationCount;
if (currentGenerationCount <= 100) {
const q = currentGenerationCount / settings.agentCount;
if (currentGenerationCount <= 100 && q < 0.05) {
this.nextGenerationId++;
this.lastGenerationChangeTimeInSeconds = performance.now() / 1000;
}