開始使用免費開始

數學模型:納入關鍵流程

你已建立下列字典 processes,其中包含一家生產手機公司的供應鏈各步驟資訊。

processes = {
    "Sourcing raw material":  5,
    "Transport of raw material": 1,
    "Manufacturing parts": 3,
    "Assembling parts": 2,
    "Selling products": 3,
}

你的模型儲存在名為 discrete_model_build_phone() 的函式中,會依照字典中的流程來模擬你的生產線。模型的輸入參數(依序)為:

  1. processes:包含各流程資訊的字典
  2. simulation_time:模擬執行時間長度。

模型中的時間單位為天。

套件 Maptlotlib.pyplot 已替你載入為 plt。

本練習屬於課程

Python 的離散事件模擬

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Add the new key-value pair to the processes dictionary
processes["____"] = ____

# Assign the simulation time
simulation_time = ____

# Run the model
time_all = ____(____)
編輯並執行程式碼