qns.entity.cchannel package
Submodules
qns.entity.cchannel.cchannel module
- class qns.entity.cchannel.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]
Bases:
qns.entity.entity.Entity
ClassicChannel is the channel for classic message
- install(simulator: qns.simulator.simulator.Simulator) None [source]
install
is called beforesimulator
runs to initialize or set initial events- Parameters
simulator (qns.simulator.simulator.Simulator) – the simulator
- send(packet: qns.entity.cchannel.cchannel.ClassicPacket, next_hop: qns.entity.node.node.QNode)[source]
Send a classic packet to the next_hop
- Parameters
packet (ClassicPacket) – the packet
next_hop (QNode) – the next hop QNode
- Raises
qns.entity.cchannel.cchannel.NextHopNotConnectionException – the next_hop is not connected to this channel
- class qns.entity.cchannel.cchannel.ClassicPacket(msg: Union[str, bytes, Any], src: Optional[qns.entity.node.node.QNode] = None, dest: Optional[qns.entity.node.node.QNode] = None)[source]
Bases:
object
ClassicPacket is the message that transfer on a ClassicChannel
- class qns.entity.cchannel.cchannel.RecvClassicPacket(t: Optional[qns.simulator.ts.Time] = None, name: Optional[str] = None, cchannel: Optional[qns.entity.cchannel.cchannel.ClassicChannel] = None, packet: Optional[qns.entity.cchannel.cchannel.ClassicPacket] = None, dest: Optional[qns.entity.node.node.QNode] = None, by: Optional[Any] = None)[source]
Bases:
qns.simulator.event.Event
The event for a QNode to receive a classic packet
Module contents
- class qns.entity.cchannel.ClassicChannel(name: Optional[str] = None, node_list: List[qns.entity.node.node.QNode] = [], bandwidth: int = 0, delay: Union[float, qns.models.delay.delay.DelayModel] = 0, drop_rate: float = 0, max_buffer_size: int = 0)[source]
Bases:
qns.entity.entity.Entity
ClassicChannel is the channel for classic message
- install(simulator: qns.simulator.simulator.Simulator) None [source]
install
is called beforesimulator
runs to initialize or set initial events- Parameters
simulator (qns.simulator.simulator.Simulator) – the simulator
- send(packet: qns.entity.cchannel.cchannel.ClassicPacket, next_hop: qns.entity.node.node.QNode)[source]
Send a classic packet to the next_hop
- Parameters
packet (ClassicPacket) – the packet
next_hop (QNode) – the next hop QNode
- Raises
qns.entity.cchannel.cchannel.NextHopNotConnectionException – the next_hop is not connected to this channel
- class qns.entity.cchannel.ClassicPacket(msg: Union[str, bytes, Any], src: Optional[qns.entity.node.node.QNode] = None, dest: Optional[qns.entity.node.node.QNode] = None)[source]
Bases:
object
ClassicPacket is the message that transfer on a ClassicChannel
- class qns.entity.cchannel.RecvClassicPacket(t: Optional[qns.simulator.ts.Time] = None, name: Optional[str] = None, cchannel: Optional[qns.entity.cchannel.cchannel.ClassicChannel] = None, packet: Optional[qns.entity.cchannel.cchannel.ClassicPacket] = None, dest: Optional[qns.entity.node.node.QNode] = None, by: Optional[Any] = None)[source]
Bases:
qns.simulator.event.Event
The event for a QNode to receive a classic packet