Exemplo n.º 1
0
        public I_Layout Generate()
        {
            var state = 0;

            switch (state)
            {
            case 0:
                Console.WriteLine("-----");
                Console.WriteLine("ok Start Layout Generation");
                var delete_success = ConvertNetwork.DeleteLayoutOutput();
                if (!delete_success)
                {
                    goto default;
                }

                var python_success = this.RawGenerate();
                if (!python_success)
                {
                    goto default;
                }

                var raw_position_list = ConvertNetwork.GetRawPositionList();
                if (raw_position_list == null)
                {
                    goto default;
                }
                var layout = new LayoutFactory().Generate(raw_position_list, this.MyNetwork.NodeList, this.MyLayoutEnum);
                Console.WriteLine("ok Success Layout Generation");
                return(layout);

            default:
                Console.WriteLine("no Failure Layout Generation");
                return(null);
            }
        }
Exemplo n.º 2
0
        public I_Network Generate(int network_seed, bool seed_enable)
        {
            RandomPool.Declare(SeedEnum.LayoutSeed, network_seed);
            var state = 0;

            switch (state)
            {
            case 0:
                Console.WriteLine("-----");
                Console.WriteLine("ok Start Network Generation");
                var delete_success = ConvertNetwork.DeleteNetworkOutput();
                if (!delete_success)
                {
                    goto default;
                }

                var python_success = this.RawGenerate(network_seed, seed_enable);
                if (!python_success)
                {
                    goto default;
                }

                var raw_edge_list = ConvertNetwork.GetRawEdgeList();
                var node_num      = ConvertNetwork.GetRawNodeNum();
                var network_enum  = this.MyNetworkEnum;
                if (raw_edge_list == null || node_num == 0 || network_enum == NetworkEnum.Void)
                {
                    goto default;
                }

                Console.WriteLine("ok Load Raw Network");
                Console.WriteLine("ok Node: " + node_num);
                Console.WriteLine("ok Edge: " + raw_edge_list.Count);
                Console.WriteLine("ok NetworkEnum: " + network_enum.ToString());
                Console.WriteLine("ok Network Seed: " + network_seed);
                var network = new NetworkFactory().Generate(node_num, raw_edge_list, network_enum, network_seed);
                if (network == null)
                {
                    goto default;
                }

                Console.WriteLine("ok Success Network Generation");
                return(network);

            default:
                Console.WriteLine("no Failure Network Generation");
                return(null);
            }
        }
Exemplo n.º 3
0
        new public I_Layout Generate()
        {
            var state = 0;

            switch (state)
            {
            case 0:
                Console.WriteLine("-----");
                Console.WriteLine("ok Start Layout Generation");
                var delete_success = ConvertNetwork.DeleteLayoutOutput();
                if (!delete_success)
                {
                    goto default;
                }

                var layout = this.LayoutGenerate(this.MyNetwork.NodeList, this.MyLayoutEnum);
                Console.WriteLine("ok Success Layout Generation");
                return(layout);

            default:
                Console.WriteLine("no Failure Layout Generation");
                return(null);
            }
        }