Internal function to assign stochastic strain traits
Internal function to assign stochastic strain traits
Produces a random distribution of trait values where the mean is groupVal and the range is determined by strainOptions$percentTraitRange (if not pHtrait) and by maxPHshift if it is the pHtrait (see strainOptions)
groupVal: Scalar. Group parameter value i.e. the mean parameter value
strainOptions: list from microPopModel inputs. Contains 'distribution' i.e. the shape of the distribution ('normal' or 'uniform'). If it is not for a pH trait and the distribution is 'normal' then its std dev is groupValpercentRange/200, if distribution is 'uniform' then its range is groupVal(1 +/- percentRange/100). For a pH trait, 'maxPHshift' is the max shift in pH units and 'normal' has std dev = maxPHshift/2, and 'uniform' distribution has range groupVal +/- maxPHshift;
parName: Name of parameter. This is only used to help with error catching
pHtrait: TRUE/FALSE whether or not trait is the pH trait.
gname: Microbe name (for indexing strainOptions$percentTraitRange)
Returns
vector of values for each strain for one parameter