本文整理汇总了C#中Simulator.Complete方法的典型用法代码示例。如果您正苦于以下问题:C# Simulator.Complete方法的具体用法?C# Simulator.Complete怎么用?C# Simulator.Complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulator
的用法示例。
在下文中一共展示了Simulator.Complete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Normal
protected Result Normal()
{
var rstart = System.DateTime.UtcNow;
var vstart = DateTime.UtcNow;
Simulator sim = new Simulator(_parameters);
sim.Complete(true);
SimpleTimer.RunSteps(3600000);
long memory = GC.GetTotalMemory(true);
long time = (System.DateTime.UtcNow - rstart).Ticks / TimeSpan.TicksPerMillisecond;
long throughput = (long) (SimulationEdgeListener.TotalDataTransferred() /
(DateTime.UtcNow - vstart).TotalSeconds);
sim.Disconnect();
return new Result(memory, time, throughput);
}
示例2: DoNatTest
protected Result DoNatTest(Simulator sim, Node node0, Node node1)
{
sim.Complete(true);
// SimpleTimer.RunSteps(3600000);
SimpleTimer.RunSteps(600000);
long throughput = Throughput(node0.EdgeListenerList) + Throughput(node1.EdgeListenerList);
DateTime start = DateTime.UtcNow;
ManagedConnectionOverlord mco = new ManagedConnectionOverlord(node0);
mco.Start();
node0.AddConnectionOverlord(mco);
mco.Set(node1.Address);
AreConnected connected = new AreConnected(node0, node1, null);
connected.Start();
connected.Run(120);
long time = (DateTime.UtcNow - start).Ticks / TimeSpan.TicksPerMillisecond;
double avg_throughput = 0;
if(time > 0) {
throughput = Throughput(node0.EdgeListenerList) +
Throughput(node1.EdgeListenerList) - throughput;
avg_throughput = (1.0 * throughput) / time / 1000;
}
sim.Disconnect();
return new Result(connected.TATypeAsString, time, avg_throughput);
}