Пример #1
0
 def __init__(self, name, money, investition, time, time_before, IiA, KäA,
              matLevel, n_prodFam, time_x, time_before_x):
     support_functions = []
     if IiA == 1:
         support_functions.append("IiA")
     if KäA == 1:
         support_functions.append("KäA")
     if IiA == 1 and KäA == 1:
         support_functions.append("InA")
     self.I = investition
     support_functions = str(support_functions).strip("[]'").replace(
         "'", "")
     self.support_functions = support_functions
     self.table = html.Table(
         style={"width": "100%"},
         children=[
             html.Tr(children=[
                 html.Th(colSpan=4,
                         style={'text-align': 'left'},
                         children=[name])
             ]),
             html.Tr(children=[
                 html.Td(children=["Kapitalwert (€): "]),
                 html.Td(children=[money],
                         style={'color': 'red' if money < 0 else 'black'}),
                 html.Td(children=["Investitionssumme (€): "]),
                 html.Td(children=[investition])
             ]),
             html.Tr(children=[
                 html.Td(children=["Suchzeit vorher (Min,Sek): "]),
                 html.Td(children=[convert_decimal_time(time_before)]),
                 html.Td(children=["Suchzeit nachher (Min,Sek): "]),
                 html.Td(children=[convert_decimal_time(time)])
             ]),
         ] + [
             html.Tr([
                 html.Td(children=["Produktfamilie " + str(n + 1)],
                         style={"text-align": "right"}),
                 html.Td(children=[convert_decimal_time(time_before_x[n])]),
                 html.Td(children=["Produktfamilie " + str(n + 1)],
                         style={"text-align": "right"}),
                 html.Td(children=[convert_decimal_time(time_x[n])])
             ]) for n in range(0, n_prodFam)
         ] + [
             # header support function outputs
             html.Tr(children=[
                 html.Td(children=["Unterstützungen: "]),
                 html.Td(support_functions),
                 html.Td(children=["Reifegradstufe: "]),
                 html.Td(matLevel)
             ]),
             html.Br()
         ])
Пример #2
0
def calculate_npv(I_total, c_main, k_personal, r, T, t_unsupported,
                  t_supported, r_acc, l_Mx, t_DLZ, P_x):
    C_main = c_main / 100 * I_total  # K_IHJ=k_IH*I_0
    k_P = k_personal / 60  # convert to minutes
    t_DLZ = [convert_decimal_time(x, False) for x in t_DLZ]
    x_specific = sum([
        (k_P * (t_vorher - t_nachher) + e_Var * l_M *
         (t_vorher - t_nachher) / t_DLZ) * P - k_P * t_nachher * P
        for t_vorher, t_nachher, e_Var, l_M, t_DLZ, P in zip(
            t_unsupported, t_supported, r_acc, l_Mx, t_DLZ, P_x)
    ])
    npv = -I_total
    for t in range(1, int(T) + 1):
        npv += (x_specific - C_main) / ((1 + r)**t)
    return npv
Пример #3
0
def calculate_time(matLevel, cumTimeSameComponent, cumTimeSimComponent,
                   cumTimeNewComponent, IiA, KäA, cumtimeProcess,
                   cumtimeResource, n_KäA, mean_amount_of_elem_comp):
    # convert from time to decimal
    n_prodFam = len(cumtimeProcess)
    cumTimeSameComponent = [
        convert_decimal_time(x, False) for x in cumTimeSameComponent
    ]
    mean_amount_of_elem_comp = [
        convert_decimal_time(x, False) for x in mean_amount_of_elem_comp
    ]
    cumTimeSimComponent = [
        convert_decimal_time(x, False) for x in cumTimeSimComponent
    ]
    cumTimeNewComponent = [
        convert_decimal_time(x, False) for x in cumTimeNewComponent
    ]
    cumtimeProcess = [convert_decimal_time(x, False) for x in cumtimeProcess]
    cumtimeResource = [convert_decimal_time(x, False) for x in cumtimeResource]
    # calculate
    all_zeros = [0 for x in range(0, n_prodFam)]
    sameComponent = all_zeros if IiA == 1 else cumTimeSameComponent
    if KäA == 1:
        simComponent = [(0.0006 * 35 + 15 * 0.0006) * n * m
                        for n, m in zip(n_KäA, mean_amount_of_elem_comp)]
    else:
        simComponent = cumTimeSimComponent
    newComponent = all_zeros if IiA == 1 and KäA == 1 else cumTimeNewComponent

    Process = all_zeros if matLevel >= 2 else cumtimeProcess
    Resource = all_zeros if matLevel == 3 else cumtimeResource
    try:
        t_supported = [
            newComponent[x] + simComponent[x] + sameComponent[x] + Process[x] +
            Resource[x] for x in range(0, n_prodFam)
        ]
    except:
        print("error")

    return t_supported
Пример #4
0
 def __init__(self,
              KW,
              investition,
              time_after,
              time_before,
              IiA,
              KäA,
              RG,
              name=None):
     n_prodFam = len(time_after)
     self.KW = KW
     support_functions = []
     if IiA == 1:
         support_functions.append("IiA")
     if KäA == 1:
         support_functions.append("KäA")
     if IiA == 1 and KäA == 1:
         support_functions.append("InA")
     support_functions = str(support_functions).strip("[]'").replace(
         "'", "")
     self.support_functions = support_functions
     # self.name=f"Unterstützungslösung {name}" if not isinstance(name, list) else f"Unterstützungslösung {name[0]} und {name[1]}"
     self.number = name
     self.RG = RG
     self.investition = investition
     if isinstance(KW, str):
         self.table = html.P(KW)
     else:
         # children = [html.Tr(children=[
         #                 html.Th(colSpan=4, style={'text-align': 'left'},
         #                         children=[self.name])])] if name!=None else []
         children = []
         children += [
             html.Tr(children=[
                 html.Td(children=["Kapitalwert (€): "]),
                 html.Td(children=[round(KW, 2)],
                         style={'color': 'red' if KW < 0 else 'black'}),
                 html.Td(children=["Investitionssumme (€): "]),
                 html.Td(children=[investition])
             ]),
             html.Tr(children=[
                 html.Td(children=["Suchzeit vorher (Min,Sek): "]),
                 html.Td(children=[convert_decimal_time(sum(time_before))]),
                 html.Td(children=["Suchzeit nachher (Min,Sek): "]),
                 html.Td(children=[convert_decimal_time(sum(time_after))])
             ]),
         ] + [
             html.Tr([
                 html.Td(children=["Produktfamilie " + str(n + 1)],
                         style={"text-align": "right"}),
                 html.Td(children=[convert_decimal_time(time_before[n])]),
                 html.Td(children=["Produktfamilie " + str(n + 1)],
                         style={"text-align": "right"}),
                 html.Td(children=[convert_decimal_time(time_after[n])])
             ]) for n in range(0, n_prodFam)
         ] + [
             html.Tr([
                 html.Td(children=["Unterstützungen: "]),
                 html.Td(children=[support_functions]),
                 html.Td(children=["Reifegrad: "]),
                 html.Td(children=[RG])
             ])
         ]
         self.table = html.Table(style={"width": "100%"}, children=children)