コード例 #1
0
        public TestCompoundLayout()
        {
            InitializeComponent();

            var g = new CompoundGraph <object, IEdge <object> >();

            var vertices = new string[30];

            for (int i = 0; i < 30; i++)
            {
                vertices[i] = i.ToString();
                g.AddVertex(vertices[i]);
            }

            for (int i = 6; i < 15; i++)
            {
                g.AddChildVertex(vertices[i % 5], vertices[i]);
            }
            g.AddChildVertex(vertices[5], vertices[4]);
            g.AddChildVertex(vertices[5], vertices[2]);
            g.AddChildVertex(vertices[16], vertices[0]);
            g.AddChildVertex(vertices[16], vertices[1]);
            g.AddChildVertex(vertices[16], vertices[3]);
            g.AddChildVertex(vertices[16], vertices[20]);
            g.AddChildVertex(vertices[16], vertices[21]);
            g.AddChildVertex(vertices[16], vertices[22]);
            g.AddChildVertex(vertices[16], vertices[23]);
            g.AddChildVertex(vertices[16], vertices[24]);
            g.AddChildVertex(vertices[4], vertices[25]);
            g.AddChildVertex(vertices[4], vertices[26]);
            g.AddChildVertex(vertices[4], vertices[27]);

            g.AddEdge(new Edge <object>(vertices[0], vertices[1]));
            g.AddEdge(new Edge <object>(vertices[0], vertices[2]));
            g.AddEdge(new Edge <object>(vertices[2], vertices[4]));
            g.AddEdge(new Edge <object>(vertices[0], vertices[7]));
            g.AddEdge(new Edge <object>(vertices[8], vertices[7]));
            //g.AddEdge(new Edge<object>(vertices[13], vertices[12]));
            g.AddEdge(new Edge <object>(vertices[3], vertices[20]));
            g.AddEdge(new Edge <object>(vertices[20], vertices[21]));
            g.AddEdge(new Edge <object>(vertices[20], vertices[22]));
            g.AddEdge(new Edge <object>(vertices[22], vertices[23]));
            g.AddEdge(new Edge <object>(vertices[23], vertices[24]));
            g.AddEdge(new Edge <object>(vertices[0], vertices[28]));
            g.AddEdge(new Edge <object>(vertices[0], vertices[29]));
            g.AddEdge(new Edge <object>(vertices[25], vertices[27]));
            g.AddEdge(new Edge <object>(vertices[26], vertices[25]));
            g.AddEdge(new Edge <object>(vertices[14], vertices[27]));
            g.AddEdge(new Edge <object>(vertices[14], vertices[26]));
            g.AddEdge(new Edge <object>(vertices[14], vertices[25]));
            g.AddEdge(new Edge <object>(vertices[26], vertices[27]));


            layout.LayoutMode                  = LayoutMode.Automatic;
            layout.LayoutAlgorithmType         = "CompoundFDP";
            layout.OverlapRemovalConstraint    = AlgorithmConstraints.Automatic;
            layout.OverlapRemovalAlgorithmType = "FSA";
            layout.HighlightAlgorithmType      = "Simple";
            layout.Graph = g;
        }
コード例 #2
0
        public TestCompoundLayout()
        {
            InitializeComponent();

            var g = new CompoundGraph<object, IEdge<object>>();

            var vertices = new string[30];
            for (int i = 0; i < 30; i++)
            {
                vertices[i] = i.ToString();
                g.AddVertex(vertices[i]);
            }

            for (int i = 6; i < 15; i++)
            {
                g.AddChildVertex(vertices[i%5], vertices[i]);
            }
            g.AddChildVertex(vertices[5], vertices[4]);
            g.AddChildVertex(vertices[5], vertices[2]);
            g.AddChildVertex(vertices[16], vertices[0]);
            g.AddChildVertex(vertices[16], vertices[1]);
            g.AddChildVertex(vertices[16], vertices[3]);
            g.AddChildVertex(vertices[16], vertices[20]);
            g.AddChildVertex(vertices[16], vertices[21]);
            g.AddChildVertex(vertices[16], vertices[22]);
            g.AddChildVertex(vertices[16], vertices[23]);
            g.AddChildVertex(vertices[16], vertices[24]);
            g.AddChildVertex(vertices[4], vertices[25]);
            g.AddChildVertex(vertices[4], vertices[26]);
            g.AddChildVertex(vertices[4], vertices[27]);

            g.AddEdge(new Edge<object>(vertices[0], vertices[1]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[2]));
            g.AddEdge(new Edge<object>(vertices[2], vertices[4]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[7]));
            g.AddEdge(new Edge<object>(vertices[8], vertices[7]));
            //g.AddEdge(new Edge<object>(vertices[13], vertices[12]));
            g.AddEdge(new Edge<object>(vertices[3], vertices[20]));
            g.AddEdge(new Edge<object>(vertices[20], vertices[21]));
            g.AddEdge(new Edge<object>(vertices[20], vertices[22]));
            g.AddEdge(new Edge<object>(vertices[22], vertices[23]));
            g.AddEdge(new Edge<object>(vertices[23], vertices[24]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[28]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[29]));
            g.AddEdge(new Edge<object>(vertices[25], vertices[27]));
            g.AddEdge(new Edge<object>(vertices[26], vertices[25]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[27]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[26]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[25]));
            g.AddEdge(new Edge<object>(vertices[26], vertices[27]));
            

            layout.LayoutMode = LayoutMode.Automatic;
            layout.LayoutAlgorithmType = "CompoundFDP";
            layout.OverlapRemovalConstraint = AlgorithmConstraints.Automatic;
            layout.OverlapRemovalAlgorithmType = "FSA";
            layout.HighlightAlgorithmType = "Simple";
            layout.Graph = g;
        }
コード例 #3
0
        public static ICompoundGraph <TVertex, TEdge> CreateCompoundGraph <TVertex, TEdge>(
            int vertexCount,
            int edgeCount,
            [NotNull, InstantHandle] Func <int, TVertex> vertexFactory,
            [NotNull, InstantHandle] Func <TVertex, TVertex, TEdge> edgeFactory,
            [NotNull] Random random)
            where TEdge : IEdge <TVertex>
        {
            var graph = new CompoundGraph <TVertex, TEdge>(false, vertexCount);

            var verticesMap = new Dictionary <int, TVertex>();

            for (int i = 0; i < vertexCount; ++i)
            {
                TVertex vertex = vertexFactory(i);
                verticesMap[i] = vertex;
                graph.AddVertex(vertex);
            }

            for (int i = 0; i < vertexCount / 3; ++i)
            {
                int     vertexIndex1;
                int     vertexIndex2;
                TVertex vertex1;
                TVertex vertex2;
                do
                {
                    vertexIndex1 = random.Next(vertexCount);
                    vertexIndex2 = random.Next(vertexCount);
                    vertex1      = verticesMap[vertexIndex1];
                    vertex2      = verticesMap[vertexIndex2];
                } while (vertexIndex1 == vertexIndex2 ||
                         graph.IsChildVertex(vertex2));

                graph.AddChildVertex(vertex1, vertex2);
            }

            for (int i = 0; i < edgeCount; ++i)
            {
                int     childIndex;
                int     parentIndex;
                TVertex child;
                TVertex parent;
                do
                {
                    childIndex  = random.Next(vertexCount);
                    parentIndex = random.Next(vertexCount);
                    child       = verticesMap[childIndex];
                    parent      = verticesMap[parentIndex];
                } while (childIndex == parentIndex ||
                         graph.ContainsEdge(parent, child));

                // Create the edge between the 2 vertex
                graph.AddEdge(edgeFactory(parent, child));
            }

            return(graph);
        }
コード例 #4
0
        private string[] InitVertices(CompoundGraph <object, IEdge <object> > g, int vertexCount)
        {
            var vertices = new string[vertexCount];

            for (int i = 0; i < vertexCount; i++)
            {
                vertices[i] = i.ToString();
                g.AddVertex(vertices[i]);
            }
            return(vertices);
        }
コード例 #5
0
        private IBidirectionalGraph <object, IEdge <object> > ConvertGraph(PocGraph graph)
        {
            var g = new CompoundGraph <object, IEdge <object> >();

            foreach (var item in graph.Vertices)
            {
                g.AddVertex(item.ID);
            }

            foreach (var item in graph.Edges)
            {
                g.AddEdge(new Edge <object>(item.Source.ID, item.Target.ID));
            }


            return(g);
        }
コード例 #6
0
        private IBidirectionalGraph<object, IEdge<object>> ConvertGraph(PocGraph graph)
        {
            var g = new CompoundGraph<object, IEdge<object>>();

            foreach (var item in graph.Vertices)
            {
                g.AddVertex(item.ID);

            }

            foreach (var item in graph.Edges)
            {
                g.AddEdge(new Edge<object>(item.Source.ID, item.Target.ID));
            }


            return g;
        }
コード例 #7
0
        void RecGraph(MainForm frm, string file)
        {

            var g = new CompoundGraph<object, IEdge<object>>();

            var map = new Dictionary<uint, CodeBlock>();

            string[] ent = File.ReadAllText(file).Split(new string[] { "block:" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string e in ent)
            {
                string[] st = e.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

                var entr = new CodeBlock();

                entr["block"] = st[0];

                for (int i = 1; i < st.Length; i++)
                {
                    if (st[i] == "{")
                        break;
                    else
                    {
                        string[] lst = st[i].Split(new char[] { ':' }, 2);
                        if (lst.Length == 2)
                        {
                            entr[lst[0]] = lst[1];
                        }
                    }
                }

                map[entr.block] = entr;
            }

            map = map.Where(x => x.Value.runs > 0).ToDictionary(x => x.Key, x => x.Value);

            long v = map.Sum(x => x.Value.cost);

            CodeBlock.gcost = v;

            double runcumsum = 0;

            var intrnode = map.Values.OrderByDescending(x => x.cost).Where(x => (runcumsum += x.cost) < 0.60 * v).Take(1000).ToList();

            var varp = intrnode.Select(x => x.hash);

            long v1 = intrnode.Sum(x => x.cost);

            foreach (var r in intrnode)
            {
                g.AddVertex(r);
            }

            var newstuff = new List<CodeBlock>();

        reloop:
            foreach (var r in intrnode)
            {
                CodeBlock va, vb;


                if (map.TryGetValue(r["pNextBlock"], out va))
                {
                    if (!g.ContainsVertex(va)) { newstuff.Add(va); g.AddVertex(va); v1 += va.cost; }

                    g.AddEdge(new Edge<object>(r, va));
                }

                if (map.TryGetValue(r["pBranchBlock"], out vb))
                {
                    if (!g.ContainsVertex(vb)) { newstuff.Add(vb); g.AddVertex(vb); v1 += vb.cost; }

                    g.AddEdge(new Edge<object>(r, vb));
                }
            }

            if (newstuff.Count != 0)
            {
                intrnode = newstuff;
                newstuff = new List<CodeBlock>();
                goto reloop;
            }

            frm.Text = "Showing " + v1 * 100 / v + "% (using " + g.VertexCount + " out of " + map.Count + ", " + g.VertexCount * 100 / map.Count + "% of blocks)";


            var ordlst = map.Values.OrderByDescending(x => x.cost).ToList();

            double rvv = 0;



            foreach (var i in ordlst)
            {
                rvv += i.cost;
                i.cumsum = rvv;
            }

            var cs = frm.chart2.Series.Add("CumSum(cost) / decrease(cost)");
            var pr = frm.chart1.Series.Add("Cost / addr");
            var bl = frm.chart1.Series.Add("gopc / addr");
            var gs = frm.chart1.Series.Add("cycl / addr");

            cs.ChartType = SeriesChartType.StepLine;

            pr.ChartType = SeriesChartType.BoxPlot;
            bl.ChartType = SeriesChartType.BoxPlot;
            gs.ChartType = SeriesChartType.BoxPlot;

            foreach (var i in ordlst)
            {
                cs.Points.AddY(i.cumsum * 100.0 / CodeBlock.gcost);
            }

            rvv = 0;
            foreach (var i in ordlst.OrderBy(x => x.pos))
            {
                rvv += i.cost;
                //if (rvv > v * 0.01)
                {
                    pr.Points.AddXY(i.pos, Math.Log(i.cost + 1));
                    bl.Points.AddXY(i.pos, Math.Log(i.guest_opcodes + 1));
                    gs.Points.AddXY(i.pos, Math.Log(i.guest_cycles / 4 + 1));
                }
            }
            /*
            var vertices = new string[30];
            
            for (int i = 0; i < 30; i++)
            {
                vertices[i] = i.ToString();
                g.AddVertex(vertices[i]);
            }
            
            for (int i = 6; i < 15; i++)
            {
                g.AddChildVertex(vertices[i % 5], vertices[i]);
            }
            g.AddChildVertex(vertices[5], vertices[4]);
            g.AddChildVertex(vertices[5], vertices[2]);
            g.AddChildVertex(vertices[16], vertices[0]);
            g.AddChildVertex(vertices[16], vertices[1]);
            g.AddChildVertex(vertices[16], vertices[3]);
            g.AddChildVertex(vertices[16], vertices[20]);
            g.AddChildVertex(vertices[16], vertices[21]);
            g.AddChildVertex(vertices[16], vertices[22]);
            g.AddChildVertex(vertices[16], vertices[23]);
            g.AddChildVertex(vertices[16], vertices[24]);
            g.AddChildVertex(vertices[4], vertices[25]);
            g.AddChildVertex(vertices[4], vertices[26]);
            g.AddChildVertex(vertices[4], vertices[27]);

            g.AddEdge(new Edge<object>(vertices[0], vertices[1]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[2]));
            g.AddEdge(new Edge<object>(vertices[2], vertices[4]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[7]));
            g.AddEdge(new Edge<object>(vertices[8], vertices[7]));
            //g.AddEdge(new Edge<object>(vertices[13], vertices[12]));
            g.AddEdge(new Edge<object>(vertices[3], vertices[20]));
            g.AddEdge(new Edge<object>(vertices[20], vertices[21]));
            g.AddEdge(new Edge<object>(vertices[20], vertices[22]));
            g.AddEdge(new Edge<object>(vertices[22], vertices[23]));
            g.AddEdge(new Edge<object>(vertices[23], vertices[24]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[28]));
            g.AddEdge(new Edge<object>(vertices[0], vertices[29]));
            g.AddEdge(new Edge<object>(vertices[25], vertices[27]));
            g.AddEdge(new Edge<object>(vertices[26], vertices[25]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[27]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[26]));
            g.AddEdge(new Edge<object>(vertices[14], vertices[25]));
            g.AddEdge(new Edge<object>(vertices[26], vertices[27]));
            */

            layout.LayoutMode = LayoutMode.Automatic;
            layout.LayoutAlgorithmType = "CompoundFDP";
            layout.OverlapRemovalConstraint = AlgorithmConstraints.Automatic;
            layout.OverlapRemovalAlgorithmType = "FSA";
            layout.HighlightAlgorithmType = "Simple";

            /*
            using (FileStream w = File.Create("c:\\fail.bin"))
                g.SerializeToBinary(w);
            */

            layout.Graph = g;
        }
コード例 #8
0
        void RecGraph(MainForm frm, string file)
        {
            var g = new CompoundGraph <object, IEdge <object> >();

            var map = new Dictionary <uint, CodeBlock>();

            string[] ent = File.ReadAllText(file).Split(new string[] { "block:" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string e in ent)
            {
                string[] st = e.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

                var entr = new CodeBlock();

                entr["block"] = st[0];

                for (int i = 1; i < st.Length; i++)
                {
                    if (st[i] == "{")
                    {
                        break;
                    }
                    else
                    {
                        string[] lst = st[i].Split(new char[] { ':' }, 2);
                        if (lst.Length == 2)
                        {
                            entr[lst[0]] = lst[1];
                        }
                    }
                }

                map[entr.block] = entr;
            }

            map = map.Where(x => x.Value.runs > 0).ToDictionary(x => x.Key, x => x.Value);

            long v = map.Sum(x => x.Value.cost);

            CodeBlock.gcost = v;

            double runcumsum = 0;

            var intrnode = map.Values.OrderByDescending(x => x.cost).Where(x => (runcumsum += x.cost) < 0.60 * v).Take(1000).ToList();

            var varp = intrnode.Select(x => x.hash);

            long v1 = intrnode.Sum(x => x.cost);

            foreach (var r in intrnode)
            {
                g.AddVertex(r);
            }

            var newstuff = new List <CodeBlock>();

reloop:
            foreach (var r in intrnode)
            {
                CodeBlock va, vb;


                if (map.TryGetValue(r["pNextBlock"], out va))
                {
                    if (!g.ContainsVertex(va))
                    {
                        newstuff.Add(va); g.AddVertex(va); v1 += va.cost;
                    }

                    g.AddEdge(new Edge <object>(r, va));
                }

                if (map.TryGetValue(r["pBranchBlock"], out vb))
                {
                    if (!g.ContainsVertex(vb))
                    {
                        newstuff.Add(vb); g.AddVertex(vb); v1 += vb.cost;
                    }

                    g.AddEdge(new Edge <object>(r, vb));
                }
            }

            if (newstuff.Count != 0)
            {
                intrnode = newstuff;
                newstuff = new List <CodeBlock>();
                goto reloop;
            }

            frm.Text = "Showing " + v1 * 100 / v + "% (using " + g.VertexCount + " out of " + map.Count + ", " + g.VertexCount * 100 / map.Count + "% of blocks)";


            var ordlst = map.Values.OrderByDescending(x => x.cost).ToList();

            double rvv = 0;



            foreach (var i in ordlst)
            {
                rvv     += i.cost;
                i.cumsum = rvv;
            }

            var cs = frm.chart2.Series.Add("CumSum(cost) / decrease(cost)");
            var pr = frm.chart1.Series.Add("Cost / addr");
            var bl = frm.chart1.Series.Add("gopc / addr");
            var gs = frm.chart1.Series.Add("cycl / addr");

            cs.ChartType = SeriesChartType.StepLine;

            pr.ChartType = SeriesChartType.BoxPlot;
            bl.ChartType = SeriesChartType.BoxPlot;
            gs.ChartType = SeriesChartType.BoxPlot;

            foreach (var i in ordlst)
            {
                cs.Points.AddY(i.cumsum * 100.0 / CodeBlock.gcost);
            }

            rvv = 0;
            foreach (var i in ordlst.OrderBy(x => x.pos))
            {
                rvv += i.cost;
                //if (rvv > v * 0.01)
                {
                    pr.Points.AddXY(i.pos, Math.Log(i.cost + 1));
                    bl.Points.AddXY(i.pos, Math.Log(i.guest_opcodes + 1));
                    gs.Points.AddXY(i.pos, Math.Log(i.guest_cycles / 4 + 1));
                }
            }

            /*
             * var vertices = new string[30];
             *
             * for (int i = 0; i < 30; i++)
             * {
             *  vertices[i] = i.ToString();
             *  g.AddVertex(vertices[i]);
             * }
             *
             * for (int i = 6; i < 15; i++)
             * {
             *  g.AddChildVertex(vertices[i % 5], vertices[i]);
             * }
             * g.AddChildVertex(vertices[5], vertices[4]);
             * g.AddChildVertex(vertices[5], vertices[2]);
             * g.AddChildVertex(vertices[16], vertices[0]);
             * g.AddChildVertex(vertices[16], vertices[1]);
             * g.AddChildVertex(vertices[16], vertices[3]);
             * g.AddChildVertex(vertices[16], vertices[20]);
             * g.AddChildVertex(vertices[16], vertices[21]);
             * g.AddChildVertex(vertices[16], vertices[22]);
             * g.AddChildVertex(vertices[16], vertices[23]);
             * g.AddChildVertex(vertices[16], vertices[24]);
             * g.AddChildVertex(vertices[4], vertices[25]);
             * g.AddChildVertex(vertices[4], vertices[26]);
             * g.AddChildVertex(vertices[4], vertices[27]);
             *
             * g.AddEdge(new Edge<object>(vertices[0], vertices[1]));
             * g.AddEdge(new Edge<object>(vertices[0], vertices[2]));
             * g.AddEdge(new Edge<object>(vertices[2], vertices[4]));
             * g.AddEdge(new Edge<object>(vertices[0], vertices[7]));
             * g.AddEdge(new Edge<object>(vertices[8], vertices[7]));
             * //g.AddEdge(new Edge<object>(vertices[13], vertices[12]));
             * g.AddEdge(new Edge<object>(vertices[3], vertices[20]));
             * g.AddEdge(new Edge<object>(vertices[20], vertices[21]));
             * g.AddEdge(new Edge<object>(vertices[20], vertices[22]));
             * g.AddEdge(new Edge<object>(vertices[22], vertices[23]));
             * g.AddEdge(new Edge<object>(vertices[23], vertices[24]));
             * g.AddEdge(new Edge<object>(vertices[0], vertices[28]));
             * g.AddEdge(new Edge<object>(vertices[0], vertices[29]));
             * g.AddEdge(new Edge<object>(vertices[25], vertices[27]));
             * g.AddEdge(new Edge<object>(vertices[26], vertices[25]));
             * g.AddEdge(new Edge<object>(vertices[14], vertices[27]));
             * g.AddEdge(new Edge<object>(vertices[14], vertices[26]));
             * g.AddEdge(new Edge<object>(vertices[14], vertices[25]));
             * g.AddEdge(new Edge<object>(vertices[26], vertices[27]));
             */

            layout.LayoutMode                  = LayoutMode.Automatic;
            layout.LayoutAlgorithmType         = "CompoundFDP";
            layout.OverlapRemovalConstraint    = AlgorithmConstraints.Automatic;
            layout.OverlapRemovalAlgorithmType = "FSA";
            layout.HighlightAlgorithmType      = "Simple";

            /*
             * using (FileStream w = File.Create("c:\\fail.bin"))
             *  g.SerializeToBinary(w);
             */

            layout.Graph = g;
        }
コード例 #9
0
 private string[] InitVertices(CompoundGraph<object, IEdge<object>> g, int vertexCount)
 {
     var vertices = new string[vertexCount];
     for (int i = 0; i < vertexCount; i++)
     {
         vertices[i] = i.ToString();
         g.AddVertex(vertices[i]);
     }
     return vertices;
 }
コード例 #10
0
        public void Evaluate(int SpreadMax)
        {
            if (FBuild[0] || (pd.InputChanged && init))
            {
                graph.Clear();
                VSize.Clear();
                VThickness.Clear();
                VType.Clear();
                VPos.Clear();
                VCache.Clear();

                for (int i = 0; i < FVertices.SliceCount; i++)
                {
                    graph.AddVertex(FVertices[i]);
                    VSize.Add(FVertices[i], new Size(FVSize[i], FVSize[i]));
                    VThickness.Add(FVertices[i], new Thickness(1.0));
                    VType.Add(FVertices[i], FVType[i]);
                    VPos.Add(FVertices[i], new Point(FVPos[i].x, FVPos[i].y));
                    VCache.Add(FVertices[i]);
                }
                for (int i = 0; i < Math.Max(FEdgeFrom.SliceCount, FEdgeTo.SliceCount); i++)
                {
                    graph.AddEdge(new Edge <string>(FEdgeFrom[i], FEdgeTo[i]));
                }

                var cparams = new CompoundFDPLayoutParameters();
                foreach (var prop in typeof(CompoundFDPLayoutParameters).GetProperties())
                {
                    var input = pd.InputPins[prop.Name].Spread[0];
                    if (!(input.ToString().StartsWith("0") && input.ToString().EndsWith("0")))
                    {
                        prop.SetValue(cparams, pd.InputPins[prop.Name].Spread[0]);
                    }
                }
                layout = new CompoundFDPLayoutAlgorithm <string, IEdge <string>, CompoundGraph <string, IEdge <string> > >(graph, VSize, VThickness, VType, VPos, cparams);
                foreach (var prop in typeof(CompoundFDPLayoutParameters).GetProperties())
                {
                    var input = pd.InputPins[prop.Name].Spread[0];
                    if (!(input.ToString().StartsWith("0") && input.ToString().EndsWith("0")))
                    {
                        prop.SetValue(layout.Parameters, pd.InputPins[prop.Name].Spread[0]);
                    }
                }
                layout.Finished += (sender, args) =>
                {
                    FPosOut.SliceCount = VCache.Count;
                    for (int i = 0; i < VCache.Count; i++)
                    {
                        var point = layout.VertexPositions[VCache[i]];
                        FPosOut[i] = new Vector2D(point.X, point.Y);
                    }
                };
                if (FAsync[0])
                {
                    Task.Run(() =>
                    {
                        layout.Compute();
                    });
                }
                else
                {
                    layout.Compute();
                }
                init = true;
            }
            if (layout != null)
            {
                FState[0] = layout.State.ToString();
            }
        }