Пример #1
0
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()
env.run(until=run_time)
finish_sim = time.time()

print('#' * 80)
print("Results of simulation")
print('#' * 80)
Пример #2
0
    tp_num = 100
    for i in range(tp_num):
        tp_info["TP_{0}".format(i + 1)] = {
            "capa": 100,
            "v_loaded": 0.5,
            "v_unloaded": 1.0
        }
    Resource = Resource(env,
                        model,
                        Monitor,
                        tp_info=tp_info,
                        network=network_dist)

    for i in range(len(process_list) + 1):
        if i == len(process_list):
            model['Sink'] = Sink(env, Monitor)
        else:
            model[process_list[i]] = Process(env,
                                             process_list[i],
                                             server_num[i],
                                             model,
                                             Monitor,
                                             resource=Resource,
                                             network=network_dist,
                                             transporter=True)
else:
    for i in range(len(process_list) + 1):
        if i == len(process_list):
            model['Sink'] = Sink(env, Monitor)
        else:
            model[process_list[i]] = Process(env, process_list[i],
Пример #3
0
    save_graph = True

    if save_graph:
        save_path = './data/fitting_data'
        if not os.path.exists(save_path):
            os.makedirs(save_path)

    # samp_dist = functools.partial(random.expovariate, 1)
    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
Пример #4
0
    save_graph = True

    if save_graph:
        save_path = './data/actual_data'
        if not os.path.exists(save_path):
            os.makedirs(save_path)

    # samp_dist = functools.partial(random.expovariate, 1) # need to be checked
    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)
    Outfitting = Process(env, "Outfitting", m_oft, qlimit=10000)
    Painting = Process(env, "Painting", m_pnt, qlimit=10000)

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

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

    # Run it