開始使用免費開始

執行離散事件模型

你的「Farming Operation」團隊終於列出了這個版本的離散事件模型要納入的流程,你之後還會持續精修。流程如下面的表格所示,時間單位為天。

Table with process names and their respective duration to be used to create a dictionary.

讓我們建立一個包含這些流程的字典,並將模型執行 365 天。

本練習屬於課程

Python 的離散事件模擬

檢視課程

練習說明

  • 依據表格更新所提供的字典,填入對應的流程。
  • 將適當的值指定給變數 simulation_time。
  • 執行名為 discrete_model_farm() 的函式中所儲存的模型,記得它需要 process_dict 與 simulation_time 作為輸入變數(依此順序)。

動手互動練習

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

# Create dictionary
process_dict = {
    "____": ____,
    "____": ____,
    "Weeding": 4,
    "Planting": 2,
    "Watering and growing": 60,
    "Harvesting": 7,
    "Delivery": 2
}

# Simulatiom time (days)
____

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