public void ComputePersonality(int ind, float mean, float std) { personality[ind] = MathDefs.GaussianDist(mean, std); if (personality[ind] < -1f) { personality[ind] = -1f; } else if (personality[ind] > 1f) { personality[ind] = 1f; } }
public void AddDose(float sus) { if (Status == StatusType.Susceptible || Status == StatusType.Wounded) { float d; d = MathDefs.GaussianDist(DoseMean, DoseVariance); dose += d * sus * Time.deltaTime; UpdateStatus(); } }
public void DecayDose() { float d; float decayCoef = 2f; //decays in twice the time as it increases d = MathDefs.GaussianDist(DoseMean / decayCoef, DoseVariance / decayCoef); //take some percentage of the normal dose depending on susceptibility dose -= d * susceptibility * Time.deltaTime; if (dose < 0f) { dose = 0f; } UpdateStatus(); }