-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hey, @BoostHungry I want to understand this average calculation better:
private static float getAgeChanceValue(uint[] familyWithSeniors) { float averageSeniorsAge = MoveInProbabilityHelper.getAverageAgeOfSeniors(familyWithSeniors); float chanceValue = ((averageSeniorsAge - (Citizen.AGE_LIMIT_ADULT - 15)) / SENIOR_AGE_RANGE) * AGE_MAX_CHANCE_VALUE; Logger.logInfo(LOG_CHANCES, "MoveInProbabilityHelper.getAgeChanceValue -- Age Chance Value: {0} -- Average Age: {1} -- ", chanceValue, averageSeniorsAge); return Math.Min(chanceValue, AGE_MAX_CHANCE_VALUE); }
And also this chances thing:
`
float chance = FAMILY_STATUS_MAX_CHANCE_VALUE;
// Make sure not to leave children alone
if (hasChildren && !hasAdults) {
Logger.logInfo(LOG_CHANCES, "MoveInProbabilityHelper.getFamilyStatusChanceValue -- Don't leave children alone");
return NO_CHANCE;
}
// If adults live in the house, 75% less chance for this factor
if (hasAdults) {
chance -= FAMILY_STATUS_MAX_CHANCE_VALUE * 0.75f;
}
// If more than one senior, 25% less chance for this factor
if (numSeniors > 1) {
chance -= FAMILY_STATUS_MAX_CHANCE_VALUE * 0.25f;
}`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels