Commit 8ded5a5c authored by Ashkan's avatar Ashkan

Update

parent 874c2286
Pipeline #4322 failed with stages
in 2 seconds
app_max_latency,app_max_residual_loss_rate,app_data_rate,app_pkt_length,ch_loss_rate,ch_rtt_prop_fwd,ch_data_rate_btl_fwd,sys_block_coding_dly,sys_red_pkt_trans_dly,sys_proc_dly,sys_pkt_loss_detection_dly,sys_src_pkt_interval
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,0.00014,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,4e-05,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,0.00313,1e-05,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.0005,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,0.00014,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,0.00014,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,4e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,4e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,4e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,4e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,1e-05,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,1e-05,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,1e-05,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,4e-05,1e-05,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.0005,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.0005,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.0005,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.0005,0.0001
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.00014,0.5
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.00014,0.0292
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.00014,0.0017
10.0,0.00073681,10000000.0,428.0,0.2,0.0737,10000000.0,0.01,3e-05,1e-05,0.00014,0.0001
......@@ -292,20 +292,6 @@ class PrrtCodingConfiguration:
return True
return False
def is_maximum_loss_fulfilled(self):
total_packet_erasure = 0
for i in range(1, self.k):
for j in range(max(self.n - self.k + 1, i), self.n - self.k + i):
packet_erasure_at_i = i * prrt_utils.hypergeometric_distribution(self.n, self.k, i, j) * prrt_utils.get_error_prob(
j,
self.n,
self.prrtChannelParameters.loss_rate_fwd)
total_packet_erasure += packet_erasure_at_i
residual_packet_erasure_rate = (1 / self.k) * total_packet_erasure # Pr(k, n)
if (residual_packet_erasure_rate <= self.prrtApplicationParameters.max_residual_loss_rate):
return True
return False
# For now this condition is ignored.
def is_app_data_rate_fulfilled(self):
data_rate_constraint = self.prrtChannelParameters.data_rate_btl_fwd / (1 + self.get_redundant_information())
......
......@@ -23,14 +23,14 @@ cpdef float residual_packet_erasure_rate(k, n, ch_loss_rate):
total_packet_erasure += i * hypergeometric_distribution(n, k, i, j) \
* get_error_prob(j, n, ch_loss_rate)
# Pr(k, n)
return (1 / k) * total_packet_erasure
return total_packet_erasure / k
cpdef int get_k_lim(smallestK, biggestK, loss_rate_fwd, max_residual_loss_rate):
if biggestK < smallestK:
return smallestK
mid_point = math.ceil((biggestK + smallestK) / 2)
cdef int mid_point = math.ceil((biggestK + smallestK) / 2)
cdef float p_r = np.around(residual_packet_erasure_rate(mid_point, biggestK, loss_rate_fwd),8) # Pr(k, n_max)
if p_r == max_residual_loss_rate:
return int(mid_point)
......@@ -44,7 +44,7 @@ cpdef int estimate_n_for_k(k, n_max, loss_rate_fwd, max_residual_loss_rate):
cdef int n = k + 1
while residual_packet_erasure_rate(k, n, loss_rate_fwd) > max_residual_loss_rate \
and n <= n_max - step_size:
n = n + step_size
n += step_size
return n
......
......@@ -6,16 +6,16 @@ import numpy as np
import pandas as pd
from multiprocessing import Pool
# ds_basename = os.listdir("../../hecps/code/ML/data/")
# TODO (MOEIN) : Replace @ with dataset1, dataset2 or dataset3 for each different server.
ds_all = set(os.listdir("documents/input/dataset1/"))
ds_done = set(os.listdir("documents/output/dataset1/"))
if len(ds_done) != 0:
ds_done = {s.replace("out", "in") for s in ds_done}
ds_left_to_do = list(ds_all - ds_done)
print(str(len(ds_left_to_do)) + " number left to be done.")
# ds_rel_input_path = "../../hecps/code/ML/data/"
# ds_rel_output_path = "documents/bigdata/"
#['documents/1','documents/2','documents/3','documents/4','documents/5','documents/6']
# ds_basename = os.listdir("documents/input/")
ds_basename = ["LONG_in_12_param_4_sz_zzelqt"]
ds_rel_input_path = "documents/input/"
ds_rel_output_path = "documents/output/"
ds_rel_input_path = "documents/input/dataset1/"
ds_rel_output_path = "documents/output/dataset1/"
columns_order = ["app_max_latency", "app_max_residual_loss_rate", "app_data_rate", "app_pkt_length",
......@@ -46,10 +46,10 @@ def test_case(dataset_basename):
save_result_to = pd.DataFrame()
# Load dataset in chunk
for df_in_chunk in pd.read_csv(ds_rel_input_path + dataset_basename, sep=',', chunksize=100):
print(dataset_basename + " started.")
# print(dataset_basename + " started.")
for index, row in df_in_chunk.iterrows():
if index == 1:
print(str(index))
# if index == 1:
# print(str(index))
appParams = prrt.PrrtApplicationParameters(row['app_max_latency'], row['app_max_residual_loss_rate'], row['app_data_rate'], row['app_pkt_length'])
chnlParams = prrt.PrrtChannelParameters(row['ch_loss_rate'], 0, row['ch_rtt_prop_fwd'], 0, row['ch_data_rate_btl_fwd'], 0)
sysParams = prrt.PrrtSystemParameters(0, np.round(row['sys_red_pkt_trans_dly'], 5), 0, 0, row['sys_src_pkt_interval'])
......@@ -94,17 +94,16 @@ def test_case(dataset_basename):
# 'search': searchAlgorithm,
'time' : 0,
'config': ["INV_PRM_NPM"],
'fec_balance': config[3]}, ignore_index=True, sort=False)
'fec_balance': ""}, ignore_index=True, sort=False)
counter += 1
#print("Chunk round: " + str(counter))
save_result_to.to_csv(ds_rel_output_path + dataset_basename.replace("in", "out", 1), sep=',', index = False, columns = columns_order)
print(dataset_basename + " finished.")
print(dataset_basename.replace("in", "out", 1) + " finished.")
# test_case(ds_basename)
# TODO (MOEIN) : You can adjust number of core to use by setting processes.
if __name__ == '__main__':
pool = Pool(processes=1)
pool.map(test_case, ds_basename, chunksize=1)
pool = Pool(processes=70)
pool.map(test_case, ds_left_to_do, chunksize=1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment