시작하기무료로 시작하기

의류 생산: 다중 공정과 모듈성

패션의 수도로 알려진 이탈리아 밀라노에 위치한 의류 공장 최적화를 돕기 위해 이산 사건 모델을 만들어 달라는 요청을 받았어요.

여러분은 매우 기대되고, 의류 산업이 복잡하고 많은 공정과 자원을 포함한다는 것을 알기에, 아직 익숙해지는 단계라도 유용하고 확장 가능한 모델을 꼭 만들고 싶어요.

조사를 통해 아래 표에 제시된 공정 목록을 정리했어요. 모델의 모듈성을 높이고 안정적으로 확장할 수 있도록 각 공정을 별도의 함수로 성실하게 구현해 두었어요.

이제 관리자에게서 피드백을 받았고, 모델에 누락된 공정인 "Spot cleaning and laundry"를 추가하라는 지시를 받았어요. 이 공정은 단계 8과 9 사이에 들어가야 해요(표에서 빨간색으로 강조된 행 참조). randomsimpy 패키지는 이미 가져온 상태예요.

Table with process names, respective functions, and information about whether the process has been incorporated in the model.

이 연습은 강의의 일부입니다

Python으로 배우는 이산 사건 시뮬레이션

강의 보기

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Create a function for the new process
def ____(gen_type=None, gauss_mean=None, gauss_std=None, unif_start=None, unif_end=None):
  if gen_type == "gauss":
    duration = random.gauss(gauss_mean, gauss_std)
  elif gen_type == "uniform":
    duration = random.uniform(unif_start, unif_end)
  return duration

def all_processes(env, prod_line):

  with prod_line.request() as request:
    yield request

    t1 = fabric_relaxing(gen_type="gauss", gauss_mean=2*60, gauss_std=15)
    t2 = spread_form_layout(gen_type="gauss", gauss_mean=6, gauss_std=1)
    t3 = laying_paper_pattern(gen_type="uniform", unif_start=3, unif_end=0.5)
    t4 = marking(gen_type="gauss", gauss_mean=6, gauss_std=1)
    t5 = cutting(gen_type="gauss", gauss_mean=5, gauss_std=0.5)
    t6 = embroidery_screen_and_printing(gen_type="uniform", unif_start=10, unif_end=2)
    t7 = sewing(gen_type="gauss", gauss_mean=15, gauss_std=3)
    t8 = checking(gen_type="gauss", gauss_mean=2, gauss_std=0.5)

    # Add the new process
    tnew = ____

    # Account for the new process duration in the entire process duration
    total_duration = sum([t1, t2, t3, t4, t5, t6, t7, t8, ____, t9, t10])

    yield env.timeout(total_duration)
코드 편집 및 실행