/// <summary> /// Aggregates the linguistic information privided in the expertise using the expertone method. /// </summary> /// <param name="expertise">The expertise.</param> /// <param name="hierarchy">The hierarchy for the labels in the expertise.</param> /// <param name="referenceLevel">The reference level where we shall standarize the expertise.</param> /// <returns> /// An adjusted interval aggregating the linguistic information provided in the expertise. /// </returns> Interval IExpertoneAggregator.AggregateByExpertone(Expertise expertise, Hierarchy hierarchy, int referenceLevel) { Contract.NotNull(expertise, "expertise"); Contract.NotNull(hierarchy, "hierarchy"); var standardExpertise = this.standardizer.Standardize(expertise, hierarchy, referenceLevel); TwoTupleCardinalities cardinalities = new TwoTupleCardinalities(standardExpertise); var expertone = new Expertone<TwoTuple>(cardinalities); var expectedValue = expertone.GetExpectedValue(); var expectedInterval = expertone.Interval.LowerBound + ((expertone.Interval.Width) * expectedValue); return expectedInterval; }
/// <summary> /// Standardizes the specified expertise. /// </summary> /// <param name="expertise">The expertise.</param> /// <param name="hierarchy"></param> /// <param name="level"></param> /// <returns>A standarized expertise.</returns> Expertise IExpertiseStandardizer.Standardize(Expertise expertise, Hierarchy hierarchy, int level) { Contract.NotNull(expertise, "expertise"); Contract.NotNull(hierarchy, "hierarchy"); var result = new Expertise(expertise.Interval); foreach (var item in expertise.Opinions) { var lowerTuple = hierarchy.Translate(item.LowerOpinion, level); var upperTuple = hierarchy.Translate(item.UpperOpinion, level); result.Opinions.Add(new Opinion(lowerTuple, upperTuple)); } return result; }
/// <summary> /// Aggregates the linguistic information privided in the expertise using the LAMA operator. /// </summary> /// <param name="expertise">The expertise.</param> /// <param name="hierarchy">The hierarchy for the labels in the expertise.</param> /// <param name="referenceLevel">The reference level where we shall standarize the expertise.</param> /// <returns> /// An adjusted interval aggregating the linguistic information provided in the expertise. /// </returns> Interval ILamaAggregator.AggregateByLama(Expertise expertise, Hierarchy hierarchy, int referenceLevel) { Contract.NotNull(expertise, "expertise"); Contract.NotNull(hierarchy, "hierarchy"); var standardExpertise = this.standardizer.Standardize(expertise, hierarchy, referenceLevel); var cardinalities = new TwoTupleCardinalities(standardExpertise); Dictionary<TwoTuple, int> lowerCardinalities = cardinalities.Cardinalities.ToDictionary(k => k.Key, v => v.Value.Lower); Dictionary<TwoTuple, int> upperCardinalities = cardinalities.Cardinalities.ToDictionary(k => k.Key, v => v.Value.Upper); var aggregatedLowerTuple = this.lamaCalculator.LinguisticLama(lowerCardinalities, hierarchy[referenceLevel]); var aggregatedUpperTuple = this.lamaCalculator.LinguisticLama(upperCardinalities, hierarchy[referenceLevel]); var resultingInterval = this.AdjustInterval(expertise.Interval, aggregatedLowerTuple, aggregatedUpperTuple); return resultingInterval; }