Exemplo n.º 1
0
    # enable status definition
    sla_2c_constrs_open = False
    sla_2b_constrs_open = False
    capacity_constrs_open = False
    current_location_constr_open = False
    use_location_constr_open = True

    sku_split = True
    dist_discount = 0.6
    warehouse_area_ratio = 2
    trunk_ratio = 0.2


# load the data
filename = "model_input_WL.xlsx"
data_ins = DataHandler(file=filename, config=Config)

df_performance = pd.DataFrame()
m = 0
# for num in range(37, 3, -1):

# for num in range(4,21):
for num in [10]:
    # define the facility location model
    log.info('the model {} is running ....'.format(num))
    Config.num_rdc = num
    Config.area_ratio = data_ins.warehouse_coeff[num]
    location_model = FacilityLocation(data=data_ins, config=Config)
    model = location_model.facility_location()
    if model == 0:
        continue
Exemplo n.º 2
0
Arquivo: main.py Projeto: perry-xy/SF
from core.model import Scheduler
import pandas as pd
import os

# define the log file and log level
log = Logger(log_path='./log').logger


# define the configuration parameters
class Config(object):
    Dates = []


# load the data
filename = "data_input.xlsx"
data_ins = DataHandler(file=filename, config=Config)

print(data_ins.demands)

for key in data_ins.demands.keys():
    print(key)
    data_ins.demands_daily = (data_ins.demands[key])
    scheduler = Scheduler(Config, data_ins)
    model = scheduler.resource_scheduler_deterministic()
    solution, employee_num = scheduler.scheduler_solution()
    print(solution, employee_num)
    total_cost, total_basic_cost, total_payment, total_discount_payment = scheduler.total_cost(
    )
    print(total_cost, total_basic_cost, total_payment, total_discount_payment)
    result_df = scheduler.scheduler_result()
    result_df.to_excel('results.xlsx')