Пример #1
0
        public override void start(Graph g)
        {
            g.finalize();
            Random rnd = new Random();

            foreach (Node n in g.nodes)
            {
                float   x   = (float)rnd.NextDouble() * 25;
                float   y   = (float)rnd.NextDouble() * 25;
                Vector2 pos = new Vector2(x, y);
                n.position = pos;
            }
        }
Пример #2
0
        public override void start(Graph g)
        {
            g.finalize();
            Random rnd = new Random();

            foreach (Node n in g.nodes)
            {
                float   x   = (float)rnd.NextDouble() * (frameSize / 2);
                float   y   = (float)rnd.NextDouble() * (frameSize / 2);
                Vector2 pos = new Vector2(x, y);
                n.position = pos;
            }
            this.k = C * (float)Math.Sqrt((frameSize * frameSize) / g.nodes.Count);
        }