def hyper_113400000_x_x_armonic_10_100():

    utilization = 0.9
    for l in range(3):
        min_armonicity_grade = 0
        max_armonicity_grade = 0
        if (l == 0):
            min_armonicity_grade = 0
            max_armonicity_grade = 2
        if (l == 1):
            min_armonicity_grade = 3
            max_armonicity_grade = 6
        if (l == 2):
            min_armonicity_grade = 7
            max_armonicity_grade = 20
        create_file(("../taskset-generated/hyper_113400000_" + str(min_armonicity_grade) + "_" +str(max_armonicity_grade) +"_armonic_10_100.csv"),
                "utilization;EDF_busy_period;FPS_busy_period;EDF_first_DM_miss;EDF_schedulable;FPS_schedulable;hyperperiod;Priority_i,Deadline_i,Period_i,ID_i,WCET_i,EDF_response_time_i,FPS_response_time_i,FPS_deadline_miss_task_i,utilization_context_switch_i,utilization_clock, utilization_support_function_i")
        for j in range(500):
            taskset, utilization_context_switch, utilization_clock, utilization_support_function = \
                create_taskset_hyper_113400000_10_100(20, utilization, min_armonicity_grade, max_armonicity_grade)
            hyperperiod = calculate_hyperperiod(taskset)
            EDF_busy_period, EDF_first_DM_miss, EDF_schedulable, EDF_response_time = MAST_EDF_Analysis(taskset)
            FPS_busy_period, FPS_schedulable, FPS_response_time, FPS_deadline_miss_task = MAST_FPS_Analysis(taskset)
            register_to_file(taskset, utilization, EDF_busy_period, FPS_busy_period, EDF_first_DM_miss, EDF_schedulable,
                             FPS_schedulable, EDF_response_time, FPS_response_time, FPS_deadline_miss_task,
                             utilization_context_switch, utilization_clock, utilization_support_function, hyperperiod,
                             "../taskset-generated/hyper_113400000_" + str(min_armonicity_grade) + "_" +
                             str(max_armonicity_grade) +"armonic_10_100.csv")
def hyper_113400000_10_200_with_some_long_U_60_70_80_90():

    create_file("../taskset-generated/hyper_113400000_10_200_with_some_long_U_60_70_80_90.csv",
                "utilization;EDF_busy_period;FPS_busy_period;EDF_first_DM_miss;EDF_schedulable;FPS_schedulable;hyperperiod;Priority_i,Deadline_i,Period_i,ID_i,WCET_i,EDF_response_time_i,FPS_response_time_i,FPS_deadline_miss_task_i,utilization_context_switch_i,utilization_clock, utilization_support_function_i")
    for i in range(4):
        utilization = 0.6 + (0.1 * i)
        for j in range(500):
            taskset, utilization_context_switch, utilization_clock, utilization_support_function = \
                create_taskset_hyper_113400000_10_200_with_some_long (20, utilization, 0, 20)
            hyperperiod = calculate_hyperperiod(taskset)
            EDF_busy_period, EDF_first_DM_miss, EDF_schedulable, EDF_response_time = MAST_EDF_Analysis(taskset)
            FPS_busy_period, FPS_schedulable, FPS_response_time, FPS_deadline_miss_task = MAST_FPS_Analysis(taskset)
            register_to_file(taskset, utilization, EDF_busy_period, FPS_busy_period, EDF_first_DM_miss, EDF_schedulable,
                             FPS_schedulable, EDF_response_time, FPS_response_time, FPS_deadline_miss_task,
                             utilization_context_switch, utilization_clock, utilization_support_function, hyperperiod,
                             "../taskset-generated/hyper_113400000_10_200_with_some_long_U_60_70_80_90.csv")
def U_100_hyper_113400000_10_100():

    utilization = 1.00
    create_file("../taskset-generated/U_100_hyper_113400000_10_100.csv",
                "utilization;EDF_busy_period;FPS_busy_period;EDF_first_DM_miss;EDF_schedulable;FPS_schedulable;hyperperiod;Priority_i,Deadline_i,Period_i,ID_i,WCET_i,EDF_response_time_i,FPS_response_time_i,FPS_deadline_miss_task_i,utilization_context_switch_i,utilization_clock, utilization_support_function_i")

    for j in range(500):
        print(j)
        taskset, utilization_context_switch, utilization_clock, utilization_support_function = \
            create_taskset_hyper_113400000_10_100(20, utilization, 0, 20)
        hyperperiod = calculate_hyperperiod(taskset)
        EDF_busy_period, EDF_first_DM_miss, EDF_schedulable, EDF_response_time = MAST_EDF_Analysis(taskset)
        FPS_busy_period, FPS_schedulable, FPS_response_time, FPS_deadline_miss_task = MAST_FPS_Analysis(taskset)
        register_to_file(taskset, utilization, EDF_busy_period, FPS_busy_period, EDF_first_DM_miss, EDF_schedulable,
                         FPS_schedulable, EDF_response_time, FPS_response_time, FPS_deadline_miss_task,
                         utilization_context_switch, utilization_clock, utilization_support_function, hyperperiod,
                         "../taskset-generated/U_100_hyper_113400000_10_100.csv")
def semi_harmonic():

    create_file("../taskset-generated/semi_harmonic.csv",
                "utilization;EDF_busy_period;FPS_busy_period;EDF_first_DM_miss;EDF_schedulable;FPS_schedulable;hyperperiod;Priority_i,Deadline_i,Period_i,ID_i,WCET_i,EDF_response_time_i,FPS_response_time_i,FPS_deadline_miss_task_i,utilization_context_switch_i,utilization_clock, utilization_support_function_i")
    utilization = 0.9
    periods = semi_harmonic_periods_generator()
    for i in range(1000):
        print(i)
        taskset, utilization_context_switch, utilization_clock, utilization_support_function = \
            create_taskset_semi_harmonic(utilization, periods, i)
        hyperperiod = calculate_hyperperiod(taskset)
        EDF_busy_period, EDF_first_DM_miss, EDF_schedulable, EDF_response_time = MAST_EDF_Analysis(taskset)
        FPS_busy_period, FPS_schedulable, FPS_response_time, FPS_deadline_miss_task = MAST_FPS_Analysis(taskset)
        register_to_file(taskset, utilization, EDF_busy_period, FPS_busy_period, EDF_first_DM_miss, EDF_schedulable,
                         FPS_schedulable, EDF_response_time, FPS_response_time, FPS_deadline_miss_task,
                         utilization_context_switch, utilization_clock, utilization_support_function, hyperperiod,
                         "../taskset-generated/semi_harmonic.csv")