Example #1
0
data[(0, 'process_time')] = None
data[(0, 'process')] = "Process1"

# Sink
data[(1, 'start_time')] = None
data[(1, 'process_time')] = None
data[(1, 'process')] = 'Sink'

# Simulation Modeling
env = simpy.Environment()
model = {}  # process_dict
process_time = {"Process1": [5.0]}  # server에 할당할 process time

# Monitor
filepath = './result/event_log_DD1_1.csv'
Monitor = Monitor(filepath)

Source = Source(env, 'Source', data, model, Monitor)

for i in range(len(process_list) + 1):
    if i == len(process_list):
        model['Sink'] = Sink(env, 'Sink', Monitor)
    else:
        model['Process{0}'.format(i + 1)] = Process(env,
                                                    'Process{0}'.format(i + 1),
                                                    server_num,
                                                    model,
                                                    Monitor,
                                                    process_time=process_time)

start_sim = time.time()
Example #2
0
        df.loc[block_code][(n, 'process')] = activity
        n += 1

    df.loc[block_code][(n, 'process')] = 'Sink'

df.sort_values(by=[(0, 'start_time')], axis=0, inplace=True)

parts = []
for i in range(len(df)):
    parts.append(Part(df.index[i], df.iloc[i]))

env = simpy.Environment()
model = {}
server_num = np.full(len(process_list), 1)

Monitor = Monitor('../result/event_log_master_plan_with_tp_df.csv')
Source = Source(env, parts, model, Monitor)
###################
# transporter 사용 시 True, 아니면 False
network_using = True

if network_using:
    # network -> distance data
    network_dist = pd.read_excel('../network/distance_data_masterplan.xlsx')
    network_dist = network_dist.set_index('Unnamed: 0', drop=True)
    # Resource
    tp_info = {}
    tp_num = 100
    for i in range(tp_num):
        tp_info["TP_{0}".format(i + 1)] = {
            "capa": 100,
Example #3
0
    samp_dist = 1

    m_assy = 334
    m_oft = 322
    m_pnt = 263

    Source = Source(env, "Source", data)
    Sink = Sink(env, "Sink", rec_lead_time=True, rec_arrivals=True)
    Assembly = Process(env, "Assembly", m_assy,
                       qlimit=10000)  # 조립 공정 작업장 수 = 200
    Outfitting = Process(env, "Outfitting", m_oft,
                         qlimit=10000)  # 의장 공정 작업장 수 = 185
    Painting = Process(env, "Painting", m_pnt,
                       qlimit=10000)  # 도장 공정 작업장 수 = 155

    Monitor1 = Monitor(env, Assembly, samp_dist)
    Monitor2 = Monitor(env, Outfitting, samp_dist)
    Monitor3 = Monitor(env, Painting, samp_dist)

    Source.out = Assembly
    Assembly.out = Outfitting
    Outfitting.out = Painting
    Painting.out = Sink

    # Run it
    start = time.time()
    env.run()
    finish = time.time()

    print('#' * 80)
    print("Results of simulation")
Example #4
0
        save_path = './data/factory physics'
        if not os.path.exists(save_path):
            os.makedirs(save_path)

    # samp_dist = functools.partial(random.expovariate, 1)
    samp_dist = 1

    m_1 = 1
    m_2 = 1

    Source = Source(env, "Source", data)
    Sink = Sink(env, "Sink", rec_lead_time=True, rec_arrivals=True)
    Process1 = Process(env, "Process1", m_1, qlimit=10000)  # 조립 공정 작업장 수 = 200
    Process2 = Process(env, "Process2", m_2, qlimit=10000)  # 의장 공정 작업장 수 = 185

    Monitor1 = Monitor(env, Process1, samp_dist)
    Monitor2 = Monitor(env, Process2, samp_dist)

    Source.out = Process1
    Process1.out = Process2
    Process2.out = Sink

    # Run it
    start = time.time()
    env.run()
    finish = time.time()

    print('#' * 80)
    print("Results of simulation")
    print('#' * 80)