# Path: parsing_scripts/parse_ctcp_output.py
# def parse_file(filename, print_csv=False):
# 
# Path: parsing_scripts/parse_tcptrace.py
# def parse_file(filename, endpt_name="csail.mit.edu", dst_endpt_name="csail.mit.edu", print_csv=False):


import argparse
import math
import os
import pickle
import random
import re
from fractions import Fraction
from parsing_scripts import parse_ctcp_output
from parsing_scripts import parse_tcptrace

  if tot_time == 0 or tot_pkts == 0:
    return (None, None)
  avg_throughput /= tot_time
  avg_rtt /= tot_pkts

  return (avg_throughput, avg_rtt)

def analyse_pkl_data(input_directory):
	re_mahimahi_name = re.compile(r"""
		rawout-(?P<ratname>.*)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_kernel_name = re.compile(r"""
		rawout-(?P<ratname>cubic)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_nash_name = re.compile(r"""
		rawout-(?P<ratname>nash[0-9.]*)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_markovian_name = re.compile(r"""
		rawout-(?P<ratname>markovian[0-9.]*)-
		(?P<linkrate>[0-9.]+)-

# Path: parsing_scripts/parse_ctcp_output.py
# def parse_file(filename, print_csv=False):
# 
# Path: parsing_scripts/parse_tcptrace.py
# def parse_file(filename, endpt_name="csail.mit.edu", dst_endpt_name="csail.mit.edu", print_csv=False):


# Path: random-range-tests.py
import argparse
import math
import os
import pickle
import random
import re
from fractions import Fraction
from parsing_scripts import parse_ctcp_output
from parsing_scripts import parse_tcptrace


  if tot_time == 0 or tot_pkts == 0:
    return (None, None)
  avg_throughput /= tot_time
  avg_rtt /= tot_pkts

  return (avg_throughput, avg_rtt)

def analyse_pkl_data(input_directory):
	re_mahimahi_name = re.compile(r"""
		rawout-(?P<ratname>.*)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_kernel_name = re.compile(r"""
		rawout-(?P<ratname>cubic)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_nash_name = re.compile(r"""
		rawout-(?P<ratname>nash[0-9.]*)-
		(?P<linkrate>[0-9.]+)-
		(?P<minrtt>[0-9.]+)-
		(?P<numsenders>[0-9]+)$
	""", re.VERBOSE)
	re_mahimahi_markovian_name = re.compile(r"""
		rawout-(?P<ratname>markovian[0-9.]*)-
		(?P<linkrate>[0-9.]+)-

		(?P<minrtt>[0-9.]+)-