Fix community size ballooning to infinity with logistic growth damping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,8 @@ export function processDeveloperEcosystem(
|
||||
): DeveloperEcosystem {
|
||||
const updated = { ...eco };
|
||||
|
||||
const eraCap = TAM_BASE_SIZES[era].developer;
|
||||
|
||||
const growthRate =
|
||||
BASE_DEV_GROWTH +
|
||||
apiFreeTierDevs * FREE_TIER_DEV_MULTIPLIER +
|
||||
@@ -29,8 +31,9 @@ export function processDeveloperEcosystem(
|
||||
updated.devRelSpending * DEV_REL_EFFECTIVENESS +
|
||||
updated.sdkCoverage * SDK_GROWTH_BONUS;
|
||||
|
||||
updated.communityGrowthRate = growthRate;
|
||||
updated.communitySize = Math.max(0, updated.communitySize + updated.communitySize * growthRate);
|
||||
const logisticDamping = Math.max(0, 1 - updated.communitySize / Math.max(1, eraCap));
|
||||
updated.communityGrowthRate = growthRate * logisticDamping;
|
||||
updated.communitySize = Math.max(0, updated.communitySize + updated.communitySize * updated.communityGrowthRate);
|
||||
|
||||
if (updated.communitySize < 10 && apiTotalDevs > 0) {
|
||||
updated.communitySize += 1 + apiTotalDevs * 0.1;
|
||||
@@ -47,7 +50,6 @@ export function processDeveloperEcosystem(
|
||||
updated.documentationQuality += (docTarget - updated.documentationQuality) * 0.003;
|
||||
updated.documentationQuality = Math.min(1, Math.max(0, updated.documentationQuality));
|
||||
|
||||
const eraCap = TAM_BASE_SIZES[era].developer;
|
||||
const communityNorm = Math.min(1, updated.communitySize / Math.max(1, eraCap * 0.1));
|
||||
const activeRatio = updated.communitySize > 0
|
||||
? Math.min(1, updated.activeDevelopers / updated.communitySize)
|
||||
|
||||
Reference in New Issue
Block a user