当前位置: 首页>>代码示例>>C#>>正文


C# Generator.Connect方法代码示例

本文整理汇总了C#中Generator.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Generator.Connect方法的具体用法?C# Generator.Connect怎么用?C# Generator.Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Generator的用法示例。


在下文中一共展示了Generator.Connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepBalanced

        public void PrepBalanced()
        {
            Dictionary<String, Bus> buses = new Dictionary<string, Bus>();
            buses["b1"] = new Bus("b1", pr(132.79, 0), 132.79, new Point(0, 0));
            buses["b2"] = new Bus("b2", pr(133.73, -0.1), 132.79, new Point(0, 0));
            buses["b3"] = new Bus("b3", pr(133.55, -0.1), 132.79, new Point(0, 0));
            buses["b4"] = new Bus("b4", pr(133.99, -0.1), 132.79, new Point(0, 0));

            var lb1b2 = new Line("b1b2", 1);
            lb1b2.Connect(buses["b1"], buses["b2"]);
            var lb1b3 = new Line("b1b3", 2);
            lb1b3.Connect(buses["b1"], buses["b3"]);
            var lb2b4 = new Line("b2b4", 3);
            lb2b4.Connect(buses["b2"], buses["b4"]);
            var lb3b4 = new Line("b3b4", 4);
            lb3b4.Connect(buses["b3"], buses["b4"]);

            Collection<Line> lines = new Collection<Line>();
            lines.Add(lb1b2);
            lines.Add(lb1b3);
            lines.Add(lb2b4);
            lines.Add(lb3b4);

            Generator g = new Generator("g4", new Complex(318000, 0));

            g.Connect(buses["b4"]);
            Collection<Generator> generators = new Collection<Generator>();
            generators.Add(g);

            Collection<Load> loads = new Collection<Load>();
            var l1 = new Load("l1", new Complex(50000, 30990));
            l1.Connect(buses["b1"]);
            var l2 = new Load("l2", new Complex(170000, 105350));
            l2.Connect(buses["b2"]);
            var l3 = new Load("l3", new Complex(200000, 12940));
            l3.Connect(buses["b3"]);
            var l4 = new Load("l4", new Complex(80000, 49580));
            l4.Connect(buses["b4"]);
            loads.Add(l1);
            loads.Add(l2);
            loads.Add(l3);
            loads.Add(l4);

            model = new NetworkModel(buses, lines, loads, generators, new Complex(19580, -17810600), buses["b1"]);
        }
开发者ID:ElecNetKit,项目名称:ElecNetKit,代码行数:45,代码来源:BogusSimulator.cs


注:本文中的Generator.Connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。