本文整理汇总了C#中ICondition.GetScore方法的典型用法代码示例。如果您正苦于以下问题:C# ICondition.GetScore方法的具体用法?C# ICondition.GetScore怎么用?C# ICondition.GetScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICondition
的用法示例。
在下文中一共展示了ICondition.GetScore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompareTo
//public float GetScoreForCondition(Condition c)
//{
// double score =
// c.alpha*
// ( (
// AccountFailuresInfrequentPassword*c.phi_infrequent +
// AccountFailuresFrequentPassword*c.phi_frequent
// ) +
// c.repeat *
// (
// RepeatAccountFailuresInfrequentPassword*c.phi_infrequent +
// RepeatAccountFailuresFrequentPassword*c.phi_frequent
// )
// )
// +
// c.beta_notypo * c.phi_infrequent * (
// PasswordFailuresNoTypoInfrequentPassword +
// RepeatPasswordFailuresNoTypoInfrequentPassword * c.repeat)
// +
// c.beta_notypo * c.phi_frequent * (
// PasswordFailuresNoTypoFrequentPassword +
// RepeatPasswordFailuresNoTypoFrequentPassword * c.repeat)
// +
// c.beta_typo * c.phi_infrequent * (
// PasswordFailuresTypoInfrequentPassword +
// RepeatPasswordFailuresTypoInfrequentPassword * c.repeat)
// +
// c.beta_typo * c.phi_frequent * (
// PasswordFailuresTypoFrequentPassword +
// RepeatPasswordFailuresTypoFrequentPassword * c.repeat)
// ;
// score -= c.gamma*SuccessfulLogins;
// if (!IsFrequentlyGuessedPassword)
// score /= c.T;
// if (DeviceCookieHadPriorSuccessfulLoginForThisAccount)
// score = 0;
// return (float) score;
//}
public int CompareTo(Trial other, ICondition condition)
{
float myScore = condition.GetScore(this);
float othersScore = condition.GetScore(other);
if (myScore < othersScore)
return -1;
if (myScore > othersScore)
return 1;
return 0;
}