public Link Remove(PacketIdentifier linkId) => new Link(Id, Source, Sink, Attributes, Content.Remove(linkId));
private void RecordDequeueAndTransmit(NodeIdentifier nodeId, PacketIdentifier packetId, LinkIdentifier linkId) { Record(new NetworkEvent.PacketDequeued(nodeId)); Record(new NetworkEvent.PacketTransmissionStarted(packetId, linkId)); }
public Link Add(PacketIdentifier linkId) => new Link(Id, Source, Sink, Attributes, Content.Add(linkId));
public PacketConsumed(PacketIdentifier packetId) { PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId)); }
public PacketEnqueued(PacketIdentifier packetId, NodeIdentifier nodeId) { PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId)); NodeId = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId)); }
public PacketTransmissionFinished(PacketIdentifier packetId, LinkIdentifier linkId) { PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId)); LinkId = linkId ?? throw new System.ArgumentNullException(nameof(linkId)); }
private void EnqueuePacked(PacketIdentifier packetId, NodeIdentifier nodeId) { var node = _nodes[nodeId]; _nodes[node.Id] = node.With(queue: q => q.Enqueue(packetId)); }
public NodeQueue Enqueue(PacketIdentifier packetId) => new NodeQueue(Content.Enqueue(packetId), Capacity);
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)); }
public Packet(PacketIdentifier id, PacketType type) { Id = id ?? throw new ArgumentNullException(nameof(id)); Type = type; }