Ejemplo n.º 1
0
        public static PlotModel DesignStructureMatrix()
        {
            // See also http://en.wikipedia.org/wiki/Design_structure_matrix
            var data = new double[7, 7];

            // indexing: data[column,row]
            data[1, 0] = 1;
            data[5, 0] = 1;
            data[3, 1] = 1;
            data[0, 2] = 1;
            data[6, 2] = 1;
            data[4, 3] = 1;
            data[1, 4] = 1;
            data[5, 4] = 1;
            data[2, 5] = 1;
            data[0, 6] = 1;
            data[4, 6] = 1;

            for (int i = 0; i < 7; i++)
            {
                data[i, i] = -1;
            }

            var model = new PlotModel {
                Title = "Design structure matrix (DSM)"
            };

            model.Axes.Add(new LinearColorAxis {
                Position = AxisPosition.None, Palette = new OxyPalette(OxyColors.White, OxyColors.LightGreen), LowColor = OxyColors.Black, Minimum = 0, IsAxisVisible = false
            });
            var topAxis = new CategoryAxis
            {
                Position = AxisPosition.Top
            };

            topAxis.Labels.AddRange(new[] { "A", "B", "C", "D", "E", "F", "G" });
            model.Axes.Add(topAxis);
            var leftAxis = new CategoryAxis
            {
                Position      = AxisPosition.Left,
                StartPosition = 1,
                EndPosition   = 0
            };

            leftAxis.Labels.AddRange(new[] { "Element A", "Element B", "Element C", "Element D", "Element E", "Element F", "Element G" });
            model.Axes.Add(leftAxis);

            var hms = new DesignStructureMatrixSeries
            {
                Data              = data,
                Interpolate       = false,
                LabelFormatString = "#",
                LabelFontSize     = 0.25,
                X0 = 0,
                X1 = data.GetLength(0) - 1,
                Y0 = 0,
                Y1 = data.GetLength(1) - 1,
            };

            model.Series.Add(hms);
            return(model);
        }
Ejemplo n.º 2
0
        public static PlotModel DesignStructureMatrix()
        {
            // See also http://en.wikipedia.org/wiki/Design_structure_matrix
            var data = new double[7, 7];

            // indexing: data[column,row]
            data[1, 0] = 1;
            data[5, 0] = 1;
            data[3, 1] = 1;
            data[0, 2] = 1;
            data[6, 2] = 1;
            data[4, 3] = 1;
            data[1, 4] = 1;
            data[5, 4] = 1;
            data[2, 5] = 1;
            data[0, 6] = 1;
            data[4, 6] = 1;

            for (int i = 0; i < 7; i++)
            {
                data[i, i] = -1;
            }

            var model = new PlotModel { Title = "Design structure matrix (DSM)" };
            model.Axes.Add(new LinearColorAxis { Position = AxisPosition.None, Palette = new OxyPalette(OxyColors.White, OxyColors.LightGreen), LowColor = OxyColors.Black, Minimum = 0, IsAxisVisible = false });
            var topAxis = new CategoryAxis
            {
                Position = AxisPosition.Top
            };
            topAxis.Labels.AddRange(new[] { "A", "B", "C", "D", "E", "F", "G" });
            model.Axes.Add(topAxis);
            var leftAxis = new CategoryAxis
            {
                Position = AxisPosition.Left,
                StartPosition = 1,
                EndPosition = 0
            };
            leftAxis.Labels.AddRange(new[] { "Element A", "Element B", "Element C", "Element D", "Element E", "Element F", "Element G" });
            model.Axes.Add(leftAxis);

            var hms = new DesignStructureMatrixSeries
            {
                Data = data,
                Interpolate = false,
                LabelFormatString = "#",
                LabelFontSize = 0.25,
                X0 = 0,
                X1 = data.GetLength(0) - 1,
                Y0 = 0,
                Y1 = data.GetLength(1) - 1,
            };

            model.Series.Add(hms);
            return model;
        }