Esempio n. 1
0
              batch_size,
              epochs,
              verbose=1,
              validation_data=(x_test, y_test))

# Simulation
for x_test, y_test, num_of_D2Ds in zip(x_test_list, y_test_list, num_of_D2Ds):

    channel_gain_matrix = Simulation.GetChannelGainMatrix(
        x_test, num_of_cells, num_of_CUEs, num_of_D2Ds)
    QoS_of_CUE = Simulation.GetQoSofCUE(channel_gain_matrix,
                                        num_of_cells,
                                        num_of_CUEs,
                                        rate_proportion=0.05)

    y_test = Preprocessing.RemoveRedundantZero(y_test, num_of_cells,
                                               num_of_CUEs, num_of_D2Ds)
    opt_CUE_power, opt_D2D_power = Simulation.GetPowerAllocation(
        y_test, num_of_cells, num_of_CUEs, num_of_D2Ds)
    opt_CUE_rate, opt_D2D_rate = Simulation.GetDataRate(
        channel_gain_matrix, opt_CUE_power, opt_D2D_power)

    opt_system_sum_rate, opt_CUE_sum_rate, opt_D2D_sum_rate = Simulation.GetSumRate(
        opt_CUE_rate, opt_D2D_rate)
    opt_system_power_consumption, opt_CUE_power_consumption, opt_D2D_power_consumption = Simulation.GetPowerConsumption(
        opt_CUE_power, opt_D2D_power)
    opt_system_EE, opt_CUE_EE, opt_D2D_EE = Simulation.GetEnergyEfficiency(
        opt_system_sum_rate, opt_CUE_sum_rate, opt_D2D_sum_rate,
        opt_system_power_consumption, opt_CUE_power_consumption,
        opt_D2D_power_consumption)
    opt_system_UIR, opt_CUE_UIR, opt_D2D_UIR = Simulation.GetUIR(
        opt_CUE_rate, opt_D2D_rate, opt_CUE_power, opt_D2D_power, QoS_of_CUE)