本文整理汇总了C#中Network.StartNetwork方法的典型用法代码示例。如果您正苦于以下问题:C# Network.StartNetwork方法的具体用法?C# Network.StartNetwork怎么用?C# Network.StartNetwork使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network.StartNetwork方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartNetworkTest2
public void StartNetworkTest2()
{
var bestOsEver = new OS(0.01);
var computers = new List<Computer>
{
new Computer(bestOsEver, false, new List<int> {1, 2, 3}),
new Computer(bestOsEver, false, new List<int> {0, 2}),
new Computer(bestOsEver, true, new List<int> {0, 1, 3}),
new Computer(bestOsEver, false, new List<int> {0, 3})
};
var network = new Network(computers);
network.StartNetwork();
//Network finished. All computers are infectioned
}
示例2: StartNetworkTest
public void StartNetworkTest()
{
var windows = new OS(0.5);
var linux = new OS(0.9);
var mac = new OS(0.3);
var computers = new List<Computer>
{
new Computer(windows, false, new List<int> {1, 2}),
new Computer(linux, false, new List<int> {0, 2}),
new Computer(mac, true, new List<int> {0, 1})
};
var network = new Network(computers);
network.StartNetwork();
//Network finished. All computers are infectioned
}
示例3: StartNetworkTest4
public void StartNetworkTest4()
{
var virusOs = new OS(0.99);
var pro = new OS(0.100500);
var русскаяОсь = new OS(0.005);
var computers = new List<Computer>
{
new Computer(pro, false, new List<int> {5}),
new Computer(virusOs, false, new List<int> {5}),
new Computer(virusOs, false, new List<int> {5}),
new Computer(pro, false, new List<int> {5}),
new Computer(virusOs, false, new List<int> {5}),
new Computer(русскаяОсь, false, new List<int> {0, 1, 2, 3, 4})
};
var network = new Network(computers);
network.StartNetwork();
//Network finished. There are no viruses in the system
}
示例4: StartNetworkTest3
public void StartNetworkTest3()
{
var virusOs = new OS(0.99);
var pro = new OS(0.100500);
var русскаяОсь = new OS(0.005);
var computers = new List<Computer>
{
new Computer(pro, true, new List<int> {5}),
new Computer(virusOs, false, new List<int> {5}),
new Computer(virusOs, false, new List<int> {5}),
new Computer(pro, false, new List<int> {5}),
new Computer(virusOs, true, new List<int> {5}),
new Computer(русскаяОсь, false, new List<int> {0, 1, 2, 3, 4})
};
var network = new Network(computers);
network.StartNetwork();
//Network finished. All computers are infectioned
}