<commit_before>import sys
import simpy
import random
import math
import logging
import time
import numpy as np
import csv


def final_cost_info(env,lab,gui,int_db):

    #First, retrieve the costs with ETs

    final_et_costs = costs_ET(env,lab,gui,int_db)

    print('The final total costs of ET are %.2f EUR.' % final_et_costs)

    #text_widget = gui.text_widget

    gui.text.insert('3.0','The final total costs of ET are %.2f EUR. \n' % final_et_costs)

    #Afterwards, define the costs of reagents

    final_reagent_costs = costs_reagents(env,lab,gui,int_db)

    print('The final total costs of reagents are %.2f EUR.' % final_reagent_costs)

    gui.text.insert('4.0','The final total costs of reagents are %.2f EUR. \n' % final_reagent_costs)

    final_labor_costs = costs_labor(env,lab,gui,int_db)

    print('The final total labor costs are %.2f EUR.' % final_labor_costs)

    gui.text.insert('5.0','The final total labor costs are %.2f EUR. \n' % final_labor_costs)

    final_facility_costs = costs_facility(env,lab,int_db)

    print('The final total costs of the facility are %.2f EUR.' % final_facility_costs)

    gui.text.insert('6.0','The final total costs of the facility are %.2f EUR. \n' % final_facility_costs)

    final_equip_util_costs = costs_equip_util(env,lab,int_db)

    print('The final total costs with equipment utilization are %.2f EUR.' % final_equip_util_costs)

    gui.text.insert('7.0','The final total costs with equipment utilization are %.2f EUR. \n' % final_equip_util_costs)

    final_qc_costs = costs_qc(env,lab,int_db)

    print('The final total costs of quality control are %.2f EUR.' % final_qc_costs)

    gui.text.insert('8.0','The final total costs of quality control are %.2f EUR. \n' % final_qc_costs)

    final_total_costs = (final_et_costs + final_reagent_costs + final_labor_costs + final_facility_costs + final_equip_util_costs + final_qc_costs)

    array_final_costs = np.array([final_et_costs, final_reagent_costs, final_labor_costs, final_facility_costs, final_equip_util_costs, final_qc_costs])*100/final_total_costs

    print(np.round(array_final_costs,2))

    final_costs_per_dose = final_total_costs / lab.total_doses

    print('The total costs per dose are %.2f EUR.' % final_costs_per_dose)

    print(final_costs_per_dose)
    print(gui.SALES_PRICE)

    gui.NET_PROFIT += (gui.SALES_PRICE - final_costs_per_dose)*gui.ANNUAL_DEMAND

    print(gui.NET_PROFIT)

    gui.text.insert('9.0','The total costs per dose are %.2f EUR. \n' % final_costs_per_dose)

    if gui.NET_PROFIT > 0:

        gui.text.insert('10.0','Congrats! You have now a profit of %.2f EUR! \n' %gui.NET_PROFIT)
        gui.results.appendEvent(env.now, 'loss')

    else:

        gui.text.insert('10.0','Tragedy! You are broke!\n')
        gui.results.appendEvent(env.now, 'profit')

    # AC MOD - track costs
    gui.results.set_costs(
        final_et_costs, final_reagent_costs, final_labor_costs, final_facility_costs,
        final_equip_util_costs, final_qc_costs, final_total_costs, final_costs_per_dose
    )

    #Add a test to write the values to a file

    f = open("simdata_test.txt",'w')
    f.write("Total costs per dose "+str(final_costs_per_dose))
    f.close()

    #Write the CPDs to a file

    cpds_dict = lab.cpds_per_donor<commit_msg>solved incorrect functions name<commit_after>import sys
import simpy
import random
import math
import logging
import time
import numpy as np
import csv


def final_cost_info(env,lab,gui,int_db):

    #First, retrieve the costs with ETs

    final_et_costs = costs_ET(env,lab,gui,int_db)

    print('The final total costs of ET are %.2f EUR.' % final_et_costs)

    #text_widget = gui.text_widget

    gui.text.insert('3.0','The final total costs of ET are %.2f EUR. \n' % final_et_costs)

    #Afterwards, define the costs of reagents

    final_reagent_costs = costs_reagents(env,lab,gui,int_db)

    print('The final total costs of reagents are %.2f EUR.' % final_reagent_costs)

    gui.text.insert('4.0','The final total costs of reagents are %.2f EUR. \n' % final_reagent_costs)

    final_labor_costs = costs_labor(env,lab,gui,int_db)

    print('The final total labor costs are %.2f EUR.' % final_labor_costs)

    gui.text.insert('5.0','The final total labor costs are %.2f EUR. \n' % final_labor_costs)

    final_facility_costs = costs_facility(env,lab,int_db)

    print('The final total costs of the facility are %.2f EUR.' % final_facility_costs)

    gui.text.insert('6.0','The final total costs of the facility are %.2f EUR. \n' % final_facility_costs)

    final_equip_util_costs = costs_equip_util(env,lab,int_db)

    print('The final total costs with equipment utilization are %.2f EUR.' % final_equip_util_costs)

    gui.text.insert('7.0','The final total costs with equipment utilization are %.2f EUR. \n' % final_equip_util_costs)

    final_qc_costs = costs_qc(env,lab,int_db)

    print('The final total costs of quality control are %.2f EUR.' % final_qc_costs)

    gui.text.insert('8.0','The final total costs of quality control are %.2f EUR. \n' % final_qc_costs)

    final_total_costs = (final_et_costs + final_reagent_costs + final_labor_costs + final_facility_costs + final_equip_util_costs + final_qc_costs)

    array_final_costs = np.array([final_et_costs, final_reagent_costs, final_labor_costs, final_facility_costs, final_equip_util_costs, final_qc_costs])*100/final_total_costs

    print(np.round(array_final_costs,2))

    final_costs_per_dose = final_total_costs / lab.total_doses

    print('The total costs per dose are %.2f EUR.' % final_costs_per_dose)

    print(final_costs_per_dose)
    print(gui.SALES_PRICE)

    gui.NET_PROFIT += (gui.SALES_PRICE - final_costs_per_dose)*gui.ANNUAL_DEMAND

    print(gui.NET_PROFIT)

    gui.text.insert('9.0','The total costs per dose are %.2f EUR. \n' % final_costs_per_dose)

    if gui.NET_PROFIT > 0:

        gui.text.insert('10.0','Congrats! You have now a profit of %.2f EUR! \n' %gui.NET_PROFIT)
        gui.results.append_event(env.now, 'loss')

    else:

        gui.text.insert('10.0','Tragedy! You are broke!\n')
        gui.results.append_event(env.now, 'profit')

    # AC MOD - track costs
    gui.results.set_costs(
        final_et_costs, final_reagent_costs, final_labor_costs, final_facility_costs,
        final_equip_util_costs, final_qc_costs, final_total_costs, final_costs_per_dose
    )

    #Add a test to write the values to a file

    f = open("simdata_test.txt",'w')
    f.write("Total costs per dose "+str(final_costs_per_dose))
    f.close()

    #Write the CPDs to a file

    cpds_dict = lab.cpds_per_donor
{'fraction_non_alphanumeric': 0.1037081700331625, 'fraction_numerical': 0.012059089538739826, 'mean_word_length': 3.9588938714499253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6093869', 'n_tokens_mistral': 2587, 'n_tokens_neox': 2390, 'n_words': 564}