/// <summary> /// Sorts opponets of given player, according to similarity measure, by PostFlop similarity. /// </summary> /// <param name="playerStats"></param> /// <returns></returns> private DifferencePair[] getSimilarOpponents_PostFlop(GaussianDistribution aggression, GaussianDistribution WTP) { var diff = new DifferencePair[_baseModels.Count]; for (int j = 0; j < _baseModels.Count; j++) { var aggDiff = _aggressionPrior.Difference(aggression, _baseModels[j].Aggression); var wtpDiff = _wtpPrior.Difference(WTP, _baseModels[j].WTP); diff[j].Difference = (float)Math.Sqrt(aggDiff.Mean * aggDiff.Mean + wtpDiff.Mean * wtpDiff.Mean); diff[j].Index = j; } return(diff.OrderBy(ep => ep.Difference).ToArray()); }
/// <summary> /// Sorts opponets of given player, according to similarity measure, by PreFlop similarity. /// </summary> /// <param name="playerStats">Given player statistics.</param> /// <returns>Sorted opponent list.</returns> private DifferencePair[] getSimilarOpponents_PreFlop(GaussianDistribution VPIP, GaussianDistribution PFR) { var diff = new DifferencePair[_baseModels.Count]; for (int j = 0; j < _baseModels.Count; j++) { var vpipDiff = _vpipPrior.Difference(VPIP, _baseModels[j].VPIP); var pfrDiff = _pfrPrior.Difference(PFR, _baseModels[j].PFR); diff[j].Difference = (float)Math.Sqrt(vpipDiff.Mean * vpipDiff.Mean + pfrDiff.Mean * pfrDiff.Mean); diff[j].Index = j; } return(diff.OrderBy(ep => ep.Difference).ToArray()); }