HaskellAnalysisProgram-0.1.0: src/MetaHS/Extensions/MacroLevelAggregation/Population.hs
{-|
Module : MetaHS.MacroLevelAggregation
Description : The MetaHS Macro-level aggregation method: population
Copyright : Copyright (C) 2017-2019 H.H.R.F. Vos, S. Kamps
License : -- This file is distributed under the terms of the Apache License 2.0.
For more information, see the file "LICENSE", which is included in the distribution.
Stability : experimental
Calculates the metric population corresponding to supplied Relation Key.
-}
module MetaHS.Extensions.MacroLevelAggregation.Population
where
import MetaHS.Extensions.MacroLevelAggregation.Utils
import qualified MetaHS.DataModel.MetaModel as MetaModel
import MetaHS.EDSL.MetaModel
import Data.List (sort)
-- | Calculates the metric population corresponding to supplied Relation Key.
population :: RelationKey -- ^ The MetaModel Relation Key (E.g., LCOM).
-> MetaModel.MetaModel -- ^ The MetaModel Containing the associated key.
-> [Int] -- ^ The set containing the MetricValues
population key mm = sort $ getMetricElements key mm