Exemple #1
0
        private double MinForSection(double matrixValue, Graph graph, GraphSection section)
        {
            var min = graph.MinValue;

            if (section.Type != GraphSection.GraphSectionType.LeftShoulder)
            {
                min = (section.MinHigh - section.MinLow) * matrixValue + section.MinLow;
            }

            return(min);
        }
Exemple #2
0
        private Dictionary <string, double> MeanOfMaximum(Dictionary <string, AssociativeMatrix> matrices)
        {
            var result = new Dictionary <string, double>();

            foreach (var matrix in matrices)
            {
                var          graph      = FuzzyMachine.graphs[matrix.Key];
                var          maxvalue   = -1d;
                GraphSection maxsection = null;
                foreach (var section in graph.Sections)
                {
                    if (maxvalue < matrix.Value.MaxValues[section.Name])
                    {
                        maxvalue   = matrix.Value.MaxValues[section.Name];
                        maxsection = section;
                    }
                }
                var min = MinForSection(matrix.Value.MaxValues[maxsection.Name], graph, maxsection);
                var max = MaxForSection(matrix.Value.MaxValues[maxsection.Name], graph, maxsection);

                result.Add(matrix.Key, (min + max) / 2);
            }
            return(result);
        }