File size: 3,431 Bytes
02fd3ca
29608b7
 
 
 
 
02fd3ca
 
29608b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02fd3ca
 
 
179d6f0
 
 
 
 
 
 
 
cd87ae5
179d6f0
 
 
 
 
cd87ae5
179d6f0
 
 
 
cd87ae5
179d6f0
 
 
 
 
 
 
 
cd87ae5
179d6f0
cd87ae5
 
179d6f0
cd87ae5
179d6f0
 
cd87ae5
179d6f0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import pandas as pd
import src.etl.transform as transformed_data
import streamlit_page.page1 as dashboard
import datetime
from datetime import timedelta
import src.etl.extract as extract


def get_date_span():
    try: 
        start_date = dashboard.start_date
        end_date = dashboard.end_date
        date_span = list(range(1, (end_date - start_date).days + 1))
        print(f"date from user input")
        return date_span, start_date, end_date
    except Exception as e:
        print(f"using default value for date span")
        return list(range(1, 5)), datetime(2025, 3, 24), datetime(2025, 3, 28)  # Default 7 days


#fetch date from streamlit or default value. The streamlit and default references the demand data (COOIS_Planned_and_Released.csv)
DATE_SPAN, start_date, end_date = get_date_span() 

# COOIS_Released_Prod_Orders.csv
PRODUCT_LIST = transformed_data.get_released_product_list(start_date, end_date)
print(PRODUCT_LIST)


def get_employee_type_list():
    try:
        streamlit_employee_type_list = dashboard.employee_type_list
        return streamlit_employee_type_list
    except Exception as e:
        print(f"using default value for employee type list")
        employee_type_list = extract.read_employee_data()
        emp_type_list = employee_type_list["employment_type"].unique()
        return emp_type_list

EMPLOYEE_TYPE_LIST = get_employee_type_list()
print(EMPLOYEE_TYPE_LIST)

def get_shift_list():
    try:
        streamlit_shift_list = dashboard.shift_list
        return streamlit_shift_list
    except Exception as e:
        print(f"using default value for shift list")
        shift_list = extract.read_shift_data()
        shift_list = shift_list["shift"].unique()
        return shift_list
SHIFT_LIST = get_shift_list()
print(SHIFT_LIST)


LINE_LIST = ["long", "short"]  # WH_Workforce_Hourly_Pay_Scale.csv -> This is default setting. User should be able to manipulate

LINE_LIST_PER_TYPE = {
    "long": 2,
    "short": 3,
}  # Work_centre_capacity but not enough on the number of line and exact number of capacity
DEMAND_LIST = {"a": 1000, "b": 6000, "c": 4000}  # COOIS_Planned_and_Released.csv
COST_LIST_PER_EMP_SHIFT = {  # WH_Workforce_Hourly_Pay_Scale
    "Fixed": {1: 0, 2: 22, 3: 18},
    "Humanizer": {1: 10, 2: 10, 3: 10},
}
PRODUCTIVITY_LIST_PER_EMP_PRODUCT = {  # Kits_Calculation
    "Fixed": {
        1: {"a": 1000, "b": 1000, "c": 1000},
        2: {"a": 1000, "b": 1000, "c": 1000},
        3: {"a": 1000, "b": 1000, "c": 1000},
    },
    "Humanizer": {
        1: {"a": 10, "b": 6, "c": 5},
        2: {"a": 1000, "b": 1000, "c": 1000},
        3: {"a": 1000, "b": 1000, "c": 1000},
    },
}  # Kits_Calculation.csv


MAX_EMPLOYEE_PER_TYPE_ON_DAY = {  # Not available information
    "Fixed": {
        t: 8 for t in DATE_SPAN
    },  # EDIT: e.g., {'x': {1:5,2:5,...}, 'y':{1:6,...}}
    "Humanizer": {t: 6 for t in DATE_SPAN},
}
# available employee but for fixed in shift 1, it is mandatory employment

MAX_HOUR_PER_PERSON_PER_DAY = 14  # legal standard
MAX_HOUR_PER_SHIFT_PER_PERSON = {1: 3, 2: 4, 3: 6}  # work_shifts_timing.csv
CAP_PER_LINE_PER_HOUR = {
    "long": 2200,
    "short": 1600,
}
# number of products that can be produced per hour per line


DAILY_WEEKLY_SCHEDULE = "daily"  # daily or weekly ,this needs to be implementedin  in         if F_x1_day is not None... F_x1_week is not None... also need to change x1 to Fixedstaff_first_shift