示例#1
0
 public Link Remove(PacketIdentifier linkId)
 => new Link(Id, Source, Sink, Attributes, Content.Remove(linkId));
示例#2
0
        private void RecordDequeueAndTransmit(NodeIdentifier nodeId, PacketIdentifier packetId, LinkIdentifier linkId)
        {
            Record(new NetworkEvent.PacketDequeued(nodeId));

            Record(new NetworkEvent.PacketTransmissionStarted(packetId, linkId));
        }
示例#3
0
 public Link Add(PacketIdentifier linkId)
 => new Link(Id, Source, Sink, Attributes, Content.Add(linkId));
示例#4
0
 public PacketConsumed(PacketIdentifier packetId)
 {
     PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId));
 }
示例#5
0
 public PacketEnqueued(PacketIdentifier packetId, NodeIdentifier nodeId)
 {
     PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId));
     NodeId   = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
 }
示例#6
0
 public PacketTransmissionFinished(PacketIdentifier packetId, LinkIdentifier linkId)
 {
     PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId));
     LinkId   = linkId ?? throw new System.ArgumentNullException(nameof(linkId));
 }
示例#7
0
        private void EnqueuePacked(PacketIdentifier packetId, NodeIdentifier nodeId)
        {
            var node = _nodes[nodeId];

            _nodes[node.Id] = node.With(queue: q => q.Enqueue(packetId));
        }
示例#8
0
 public NodeQueue Enqueue(PacketIdentifier packetId)
 => new NodeQueue(Content.Enqueue(packetId), Capacity);
示例#9
0
 public AddPacket(PacketIdentifier packedId, PacketType type, NodeIdentifier node)
 {
     PackedId = packedId ?? throw new System.ArgumentNullException(nameof(packedId));
     Type     = type;
     NodeId   = node ?? throw new System.ArgumentNullException(nameof(node));
 }
示例#10
0
 public Packet(PacketIdentifier id, PacketType type)
 {
     Id   = id ?? throw new ArgumentNullException(nameof(id));
     Type = type;
 }