Changed progressbar to show number of iterations istead of frame errors
This commit is contained in:
parent
3777bcba02
commit
516a67795f
@ -90,7 +90,7 @@ class Simulator:
|
|||||||
"the universe and everything",
|
"the universe and everything",
|
||||||
leave=False,
|
leave=False,
|
||||||
bar_format="{l_bar}{bar}| {n_fmt}/{"
|
bar_format="{l_bar}{bar}| {n_fmt}/{"
|
||||||
"total_fmt}")
|
"total_fmt} [{elapsed}]")
|
||||||
|
|
||||||
decoder = self._decoders[self._curr_decoder_index]
|
decoder = self._decoders[self._curr_decoder_index]
|
||||||
self._decoder_pbar = tqdm(total=len(self._SNRs),
|
self._decoder_pbar = tqdm(total=len(self._SNRs),
|
||||||
@ -101,11 +101,10 @@ class Simulator:
|
|||||||
bar_format="{l_bar}{bar}| {n_fmt}/{"
|
bar_format="{l_bar}{bar}| {n_fmt}/{"
|
||||||
"total_fmt}")
|
"total_fmt}")
|
||||||
|
|
||||||
self._snr_pbar = tqdm(total=self._target_frame_errors,
|
self._snr_pbar = tqdm(total=self._max_num_iterations,
|
||||||
desc=f"Simulating for SNR = {self._SNRs[0]} dB",
|
desc=f"Simulating for SNR = {self._SNRs[0]} dB",
|
||||||
leave=False,
|
leave=False,
|
||||||
bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} "
|
)
|
||||||
"[{elapsed}<{remaining}]")
|
|
||||||
|
|
||||||
def __getstate__(self) -> typing.Dict:
|
def __getstate__(self) -> typing.Dict:
|
||||||
"""Custom serialization function called by the 'pickle' module
|
"""Custom serialization function called by the 'pickle' module
|
||||||
@ -161,13 +160,12 @@ class Simulator:
|
|||||||
last transmission
|
last transmission
|
||||||
"""
|
"""
|
||||||
self._curr_num_iterations += 1
|
self._curr_num_iterations += 1
|
||||||
|
self._snr_pbar.update(1)
|
||||||
|
|
||||||
if bit_errors > 0:
|
if bit_errors > 0:
|
||||||
self._curr_num_frame_errors += 1
|
self._curr_num_frame_errors += 1
|
||||||
self._curr_num_bit_errors += bit_errors
|
self._curr_num_bit_errors += bit_errors
|
||||||
|
|
||||||
self._snr_pbar.update(1)
|
|
||||||
|
|
||||||
def _advance_state(self) -> None:
|
def _advance_state(self) -> None:
|
||||||
"""Advance the state of the simulator.
|
"""Advance the state of the simulator.
|
||||||
|
|
||||||
@ -199,6 +197,7 @@ class Simulator:
|
|||||||
self._curr_SNRs_index += 1
|
self._curr_SNRs_index += 1
|
||||||
|
|
||||||
self._snr_pbar.reset()
|
self._snr_pbar.reset()
|
||||||
|
self._overall_pbar.refresh()
|
||||||
self._snr_pbar.set_description(
|
self._snr_pbar.set_description(
|
||||||
f"Simulating for SNR = "
|
f"Simulating for SNR = "
|
||||||
f"{self._SNRs[self._curr_SNRs_index]} dB")
|
f"{self._SNRs[self._curr_SNRs_index]} dB")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user