Handle the case of all dec-failures

This commit is contained in:
Andreas Tsouchlos 2022-11-24 16:02:29 +01:00
parent 68751c50cd
commit daf9cc6071

View File

@ -180,9 +180,12 @@ class Simulator:
adj_num_iterations = self._curr_num_iterations - \
self._curr_num_dec_fails
self._BERs[self._curr_decoder_index][self._curr_SNRs_index] \
= self._curr_num_bit_errors / (
adj_num_iterations * self._n)
if adj_num_iterations == 0:
self._BERs[self._curr_decoder_index][self._curr_SNRs_index] = 1
else:
self._BERs[self._curr_decoder_index][self._curr_SNRs_index] \
= self._curr_num_bit_errors / (
adj_num_iterations * self._n)
self._dec_fails[self._curr_decoder_index][self._curr_SNRs_index] \
= self._curr_num_dec_fails