Algorithms are Fundamental

Today I managed to make some serious progress before running into an interesting problem. Siboot randomizes the relationships among the Actors during initialization. The algorithm for doing so simply assigns a random number to each p-value. That’s unacceptable for two reasons.

Incorrect distribution of values
First, the random number generator used in SWAT creates random numbers evenly distributed across the range −1 to +1. This is wrong, because values close to ±1 should be rare. BNumbers are designed such that a truly random distribution would yield a bell curve centered on 0. It’s not truly a bell curve: it must decline to 0 at an x-value of 1.

Incommensurate with personality traits
The personality traits for the Actors are fixed; to have random perceptions of those values is nonsensical. So I must choose between two possible solutions:

a) randomizing the personality traits
b) making the p-values small random deviations from the trait values.

I think that option a) would deprive the Actors of any sense of genuine personality. The player should be able to develop a feel for the different Actors. That forces b) upon me, and I can handle that. And it might make my problem with the incorrect distribution of values less difficult.

But I’d still like to have a random function that generates properly distributed BNumbers. 

Well, it looks as if, once again, it’s time for:

Because I’ve overlooked the obvious:

BRandom = (absval(random))**2

What an idiot! I tell you, I’m going senile.