/// <summary>Disconnects all the nodes in the simulator.</summary> public void Disconnect() { SimulationEdgeListener.Clear(); foreach (NodeMapping nm in Nodes.Values) { Node node = nm.Node; node.Disconnect(); } Nodes.Clear(); }
public SimulationEdge(IEdgeSendHandler s, int local_id, int remote_id, bool is_in, int delay, TransportAddress.TAType type) : base(s, is_in) { Delay = delay; LocalID = local_id; RemoteID = remote_id; _ta_type = type; _local_ta = GetTransportAddress(local_id); _remote_ta = GetTransportAddress(remote_id); SimEL = s as SimulationEdgeListener; }
protected long Throughput(IEnumerable edge_listeners) { long data_transfered = 0; foreach (EdgeListener el in edge_listeners) { SimulationEdgeListener simel = el as SimulationEdgeListener; if (simel != null) { data_transfered += simel.BytesSent; } } return(data_transfered); }
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)); }