AcTools.DataAnalyzer.HashStorage.FindSimular C# (CSharp) 메소드

FindSimular() 공개 메소드

public FindSimular ( string carId, string rulesSetId, string hashValue, double threshold, RulesSet set = null ) : IEnumerable
carId string
rulesSetId string
hashValue string
threshold double
set RulesSet
리턴 IEnumerable
        public IEnumerable<Simular> FindSimular(string carId, string rulesSetId, string hashValue, double threshold, RulesSet set = null) {
            RulesSet.Rule[] workedRules = null;

            if (!_dictionary.ContainsKey(rulesSetId)) yield break;

            foreach (var pair in _dictionary[rulesSetId]) {
                if (pair.Key == carId) continue;

                var value = set == null ? RulesSet.CompareHashes(hashValue, pair.Value) : RulesSet.CompareHashes(hashValue, pair.Value, set, out workedRules);
                if (value > threshold) {
                    yield return new Simular {CarId = pair.Key, Value = value, WorkedRules = workedRules};
                }
            }
        }