class Lutaml::Model::ComparableModel::DiffContext
def calculate_diff_score
-
(Float)
- The normalized diff score
def calculate_diff_score total_score = 0 total_attributes = 0 traverse_diff do |_, _, value1, value2, _| total_score += calculate_attribute_score(value1, value2) total_attributes += 1 end total_attributes.positive? ? total_score / total_attributes : 0 end