Capacitated plant location - กรณีศึกษา P2

Supply Chain Analytics ด้วย Python

Aaren Stubberfield

SuSupply Chain Analytics Mgr.

โมเดล Capacitated plant location

การสร้างโมเดล

  • การผลิตที่โรงงานในแต่ละภูมิภาค
    • โรงงาน 2 ขนาด (เล็ก / ใหญ่)
  • การส่งออกผลผลิตไปยังภูมิภาคอื่น
  • โรงงานผลิตเปิด / ปิด

ภาพลูกโลกแสดงการผลิตในแต่ละภูมิภาค

Supply Chain Analytics ด้วย Python

ตัวแปรการตัดสินใจ

สิ่งที่ควบคุมได้:

  • x$_{\text{ij}}$ = ปริมาณที่ผลิตที่ตำแหน่ง _i_ และส่งไปยัง _j_
  • y$_{\text{is}}$ = 1 หากโรงงานที่ตำแหน่ง _i_ ขนาด _s_ เปิดดำเนินการ, 0 หากปิด
    • s = โรงงานขนาด เล็ก หรือ ใหญ่
Supply Chain Analytics ด้วย Python

เงื่อนไขข้อจำกัด

  • ผลผลิตรวม = อุปสงค์รวม
    • $\sum_{i=1}^{n}$ x$_{ij}$ = D$_{\text{j}}$ สำหรับ $j = 1, ..., m$
    • $n$ = จำนวนโรงงานผลิต
    • $m$ = จำนวนตลาดหรือจุดอุปสงค์รายภูมิภาค
Supply Chain Analytics ด้วย Python

เงื่อนไขข้อจำกัด

  • ผลผลิตรวม ≤ กำลังการผลิตรวม
    • $\sum_{j=1}^{m}$ x$_{ij}$ ≤ $\sum_{s=1}$ K$_{is}$y$_{is}$
    • K$_{is}$ = กำลังการผลิตที่เป็นไปได้ของโรงงาน _i_ ขนาด _s_
Supply Chain Analytics ด้วย Python
from pulp import *

# Initialize Class
model = LpProblem("Capacitated Plant Location Model", LpMinimize)

# Define Decision Variables
loc = ['A', 'B', 'C', 'D', 'E']
size = ['Low_Cap','High_Cap']
x = LpVariable.dicts("production_", [(i,j) for i in loc for j in loc], 
                      lowBound=0, upBound=None, cat='Continuous')
y = LpVariable.dicts("plant_", [(i,s) for s in size for i in loc], cat='Binary')

# Define Objective Function
model += (lpSum([fix_cost.loc[i,s]*y[(i,s)] for s in size for i in loc])
          + lpSum([var_cost.loc[i,j]*x[(i,j)] for i in loc for j in loc]))
Supply Chain Analytics ด้วย Python

ตัวอย่างโค้ด (ต่อ)

# Define the Constraints
for j in loc:
   model += lpSum([x[(i, j)] for i in loc]) == demand.loc[j,'Dmd']

for i in loc: model += lpSum([x[(i, j)] for j in loc]) <= lpSum([cap.loc[i,s]*y[(i,s)] for s in size])
Supply Chain Analytics ด้วย Python

สรุป

โมเดล Capacitated Plant Location:

  • เงื่อนไขข้อจำกัด
    • ผลผลิตรวม = อุปสงค์รวม
    • ผลผลิตรวม ≤ กำลังการผลิตรวม
Supply Chain Analytics ด้วย Python

ทบทวนความเข้าใจ

Supply Chain Analytics ด้วย Python

Preparing Video For Download...