Ejemplo n.º 1
0
        public void ConstructorGeneratesExpertone()
        {
            var expertone = new Expertone<string>(this.GetTestExpertise());
            var lowerItemslist = expertone.LowerValues;

            Assert.NotNull(lowerItemslist);
            Assert.AreEqual(11, lowerItemslist.Count);
            Assert.AreEqual(0.9m, lowerItemslist[0]);
            Assert.AreEqual(0.9m, lowerItemslist[1]);
            Assert.AreEqual(0.9m, lowerItemslist[2]);
            Assert.AreEqual(0.9m, lowerItemslist[3]);
            Assert.AreEqual(0.9m, lowerItemslist[4]);
            Assert.AreEqual(0.7m, lowerItemslist[5]);
            Assert.AreEqual(0.6m, lowerItemslist[6]);
            Assert.AreEqual(0.3m, lowerItemslist[7]);
            Assert.AreEqual(0.3m, lowerItemslist[8]);
            Assert.AreEqual(0.3m, lowerItemslist[9]);
            Assert.AreEqual(0m, lowerItemslist[10]);

            var upperItemslist = expertone.UpperValues;

            Assert.NotNull(upperItemslist);
            Assert.AreEqual(11, upperItemslist.Count);
            Assert.AreEqual(1, upperItemslist[0]);
            Assert.AreEqual(0.9m, upperItemslist[1]);
            Assert.AreEqual(0.9m, upperItemslist[2]);
            Assert.AreEqual(0.9m, upperItemslist[3]);
            Assert.AreEqual(0.9m, upperItemslist[4]);
            Assert.AreEqual(0.8m, upperItemslist[5]);
            Assert.AreEqual(0.8m, upperItemslist[6]);
            Assert.AreEqual(0.7m, upperItemslist[7]);
            Assert.AreEqual(0.6m, upperItemslist[8]);
            Assert.AreEqual(0.5m, upperItemslist[9]);
            Assert.AreEqual(0m, upperItemslist[10]);
        }
Ejemplo n.º 2
0
        public void GetExpectedValueRetursProperInterval()
        {
            var expertone = new Expertone<string>(this.GetTestExpertise());
            var expectedValue = expertone.GetExpectedValue();

            Assert.NotNull(expectedValue);
            Assert.AreEqual(0.67m, expectedValue.LowerBound);
            Assert.AreEqual(0.8m, expectedValue.UpperBound);
        }
Ejemplo n.º 3
0
        /// <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;
        }