base
Noiseless channel implementation for the coding experiments library.
This module provides a simple channel implementation that transmits messages without any modification, noise, or errors. It serves as a baseline for comparing with more complex channel models.
- class codinglab.channels.base.NoiselessChannel(logger=<codinglab.logger.NullLogger object>)[source]
Bases:
Channel[ChannelChar]Channel that transmits messages without modification.
This channel implementation faithfully transmits all messages without introducing any noise, errors, or delays. It serves as an ideal baseline channel for testing and comparison.
- Parameters:
logger (TransmissionLogger)
- _logs
List of transmission log entries (for debugging/monitoring)
- __init__(logger=<codinglab.logger.NullLogger object>)[source]
Initialize a noiseless channel.
The channel starts with an empty log for tracking transmissions.
- Parameters:
logger (TransmissionLogger)
- Return type:
None
- transmit_stream(messages)[source]
Transmit a stream of messages without modification.
This implementation simply passes through each message unchanged, while logging the transmission event for monitoring purposes.
- Parameters:
messages (
Iterator[Message[TypeVar(ChannelChar)]]) – Iterator of encoded messages to transmit- Yields:
The same messages, unchanged
- Return type:
Note
This channel maintains a log of all transmissions in the _logs attribute, which can be useful for debugging or monitoring channel activity.