Decoding Simulations

class Simulator(code, channel, decoders, identifier)

Bases: object

A Simulator computes frame error rates for a code / channel combination with different decoders by monte-carlo simulations.

Simulation is started by calling the run() method.

Parameters:
  • code (BinaryLinearBlockCode) – The code for which to run simulations.
  • channel (Channel) – The channel to use for simulations.
  • decoders (list of Decoder) – List of decoder instances for which to run the simulation.
  • identifier (str) – An identifier string describing this simulation.
Variables:
  • maxSamples (int) – Maximum number of samples to simulate. (default: 100000)
  • maxErrors (int) – Maximum number of decoding errors. After that number is reached, simulation is stopped (independently of the maxSamples value). Default: 100.
  • revealSent (bool) – Whether to reveal the sent codeword to the decoder. Might be used to speed up decoding for simulation purposes. Default: False.
  • dbStoreSampleInterval (int) – Number of decoded frames after which the current results are stored to the database. Defaults to maxSamples.
  • dbStoreTimeInterval (float) – Interval (in seconds) for storing results to database. Default: 300 (5 minutes).
  • outputInterval (float) – Interval (in seconds) for statistics output (number of errors, decoding time, ...) for each decoder. Default: 30.
  • verbose (bool) – Whether to output objective value for each decoded frame. Default: True.
  • conurrent (False) – Allow concurrent decoding in case of more than one decoder. Might be buggy, use with care. Default: False.
run()

Starts the simulation with configured parameters.

class DataPoint(code, channel, wordSeed, decoder, identifier)

Bases: object

Data class storing information about a single point of frame-error rate measurement.

Variables:
  • code – The code used.
  • channel – The channel object.
  • wordSeed – The random seed used for generating random codewords.
  • decoder – The decoder instance.
  • identifier – Simulation identifier string.
store()

Store the current data of this point in the database.

checkResume()

Check if computation for this code can be resumed. For this to be true, the program name and versions have to match.

class Simulation(points=None)

Bases: list

Data class to encapsulate the information about one “Simulation”, i.e., frame-error rates for a specific tuple of (code, decoder, channel type, word seed, identifier) run for different SNR values.

The class subclasses list, the entries are DataPoint instances ordered by SNR value.

minSNR()

Minimum SNR among all points in this run.

maxSNR()

Maximum SNR among all points in this run.

date_start

Return the earliest computation start of the run.

date_end

Return the latest computation end of the run.

add(newPoint)

Add newPoint to the simulation run. The point is inserted in such a way that sorted SNR values are maintained.