示例#1
0
    def __init__(self, MimoSchemeClass, config_filename, spec,
                 read_command_line_args=True):
        SimulationRunner.__init__(
            self, read_command_line_args=read_command_line_args)

        # Read the simulation configuration from the file. What is read and
        self.params = SimulationParameters.load_from_config_file(
            config_filename,
            spec,
            save_parsed_file=True)

        # Set the max_bit_errors and rep_max attributes
        self.max_bit_errors = self.params['max_bit_errors']
        self.rep_max = self.params['rep_max']

        # Create the modulator object
        M = self.params['M']
        modulator_options = {'PSK': fundamental.PSK,
                             'QPSK': fundamental.QPSK,
                             'QAM': fundamental.QAM,
                             'BPSK': fundamental.BPSK}

        modulator_string = self.params['modulator']
        if modulator_string == 'BPSK' or modulator_string == 'QPSK':
            self.modulator = modulator_options[modulator_string]()
        else:
            self.modulator = modulator_options[modulator_string](M)

        # Create the MIMO object
        self.mimo_object = MimoSchemeClass()
示例#2
0
    if runner.command_line_args.index is None:
        print("Runned iterations: {0}".format(runner.runned_reps))
        print("Elapsed Time: {0}".format(runner.elapsed_time))

# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
if __name__ == '__main__1':
    try:
        # noinspection PyUnresolvedReferences
        from matplotlib import pyplot as plt
        _MATPLOTLIB_AVAILABLE = True
    except ImportError:
        _MATPLOTLIB_AVAILABLE = False

    # xxxxxxxxxx Parameters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    params = SimulationParameters.load_from_config_file('bd_config_file.txt')
    # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    # xxxxxxxx Load the results from the file xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    results_filename = 'bd_results_{Nr}x{Nt}_ext_int_rank_{ext_int_rank}'
    results_filename.format(**params.parameters)
    results = SimulationResults.load_from_file('{0}{1}'.format(
        results_filename, '.pickle'))

    SNR = results.params['SNR']
    if _MATPLOTLIB_AVAILABLE is True and SNR.size > 1:
        Pe_dBm = 10.

        # Save the Spectral Efficiency curve for the given Pe_dBm
        spec_fig = plot_spectral_efficience_all_metrics(results, Pe_dBm)
        # spec_fig.tight_layout()
示例#3
0
    if runner.command_line_args.index is None:
        print ("Runned iterations: {0}".format(runner.runned_reps))
        print ("Elapsed Time: {0}".format(runner.elapsed_time))


# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
if __name__ == '__main__1':
    try:
        from matplotlib import pyplot as plt
        _MATPLOTLIB_AVAILABLE = True
    except ImportError:
        _MATPLOTLIB_AVAILABLE = False

    # xxxxxxxxxx Parameters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    params = SimulationParameters.load_from_config_file('bd_config_file.txt')
    # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    # xxxxxxxx Load the results from the file xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    results_filename = 'bd_results_{Nr}x{Nt}_ext_int_rank_{ext_int_rank}'
    results_filename.format(**params.parameters)
    results = SimulationResults.load_from_file(
        '{0}{1}'.format(results_filename, '.pickle'))

    SNR = results.params['SNR']
    if _MATPLOTLIB_AVAILABLE is True and SNR.size > 1:
        Pe_dBm = 10

        # Save the Spectral Efficiency curve for the given Pe_dBm
        spec_fig = plot_spectral_efficience_all_metrics(results, Pe_dBm)
        # spec_fig.tight_layout()