colin353 / mushu-new

0 stars 1 forks source link

Yield rate modifier #87

Closed iteloo closed 6 years ago

iteloo commented 6 years ago

I've implemented the yield rate modifier as a Float (assumed to be greater than 0). It affects the yield behaviour as follows:

Suppose the yield rate modifier for a fruit is r = n + p, where n = floor p. Then each factory of that fruit type yields n fruits with probability 1-p and n+1 fruits with probability p. The final yield is the sum of the yields for individual factories. This means the average yield is

n * (1-p) + (n+1) * p 
= n + p 
= r

so that the yield rate modifier tells us the average yield rate.

colin353 commented 6 years ago

Your explanation is kind of wrong (I think you mean n = floor r, not p) but I get what you're doing.

iteloo commented 6 years ago

Oh yeah, n = floor r is right.