Seems like defection towards the participants overall, compared to no nukes fired:
(I asked permission from the LW team before posting.)
The source code is currently available at https://github.com/ForumMagnum/ForumMagnum/compare/master...petrovSocialDeception.
const petrovFalseAlarmMissileCount = new DatabaseServerSetting<number[]>('petrovFalseAlarmMissileCount', [])
const petrovRealAttackMissileCount = new DatabaseServerSetting<number[]>('petrovRealAttackMissileCount', [])
const getIncomingCount = (incoming: boolean, role: 'eastPetrov' | 'westPetrov') => {
const currentHour = new Date().getHours();
const roleSeed = role === 'eastPetrov' ? 0 : 13;
const seed = currentHour + roleSeed + (incoming ? 17 : 0); // Different seed for each hour, role, and incoming state
const missileCountArray = incoming ? petrovRealAttackMissileCount.get() : petrovFalseAlarmMissileCount.get();
const result = seed % missileCountArray.length
console.log({currentHour, roleSeed, incoming, seed, result})
return missileCountArray[result];
}
Considerations: